Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
fd03002
feat: add GitLab platform example with Replicated onboarding (re-o64)
kriscoleman Mar 22, 2026
8479f15
fix(gitlab): use external postgresql/redis for CMX compatibility
kriscoleman Mar 22, 2026
ff126bf
fix(ci): use ci-values.yaml for helm template to satisfy required cha…
kriscoleman Mar 23, 2026
59ea548
fix(ci): use semver-compatible version for PR releases
kriscoleman Mar 23, 2026
5b18ebc
fix(ci): remove unsupported release-notes input from create-release a…
kriscoleman Mar 23, 2026
ecb4ff4
fix(ci): use app-specific GITLAB_REPLICATED_API_TOKEN secret
kriscoleman Mar 23, 2026
30f230e
fix(ci): use full path for helm chart tgz in create-release action
kriscoleman Mar 23, 2026
da8ee81
fix(ci): include kots yaml-dir in create-release to allow channel pro…
kriscoleman Mar 23, 2026
2bf7b00
fix(ci): remove yaml-dir from create-release (unsupported with chart)
kriscoleman Mar 23, 2026
eab5063
fix(gitlab): address PR review comments
kriscoleman Mar 30, 2026
7b054ee
fix(gitlab): use --yaml-dir kots for KOTS-enabled releases; add --pro…
kriscoleman Mar 30, 2026
d906dc6
fix(gitlab): add proper Helm CLI customer install flow; validate via …
kriscoleman Mar 30, 2026
d0d3b7f
fix(ci): use yaml-dir for KOTS-enabled releases in CI workflow
kriscoleman Mar 30, 2026
58df3a4
Merge branch 'main' into feat/gitlab-platform-example
adamancini Mar 31, 2026
3704eed
fix(dependabot): remove YAML aliases not supported by Dependabot (#145)
kriscoleman Mar 31, 2026
66af25f
fix(dependabot): merge helm entries to avoid overlapping directories …
kriscoleman Mar 31, 2026
584ff48
feat(gitlab): add .envrc.example and direnv setup instructions
kriscoleman Mar 31, 2026
528abe4
fix(gitlab): fix make lint failures
kriscoleman Mar 31, 2026
7c49019
fix(flagd): move secret check out of job-level if condition (#148)
kriscoleman Apr 1, 2026
5f6f7c3
feat: add GitLab platform example with Replicated onboarding (re-o64)
kriscoleman Mar 22, 2026
a2d5ee1
fix(gitlab): use external postgresql/redis for CMX compatibility
kriscoleman Mar 22, 2026
6842ea8
fix(ci): use ci-values.yaml for helm template to satisfy required cha…
kriscoleman Mar 23, 2026
6ae6437
fix(ci): use semver-compatible version for PR releases
kriscoleman Mar 23, 2026
a8b360b
fix(ci): remove unsupported release-notes input from create-release a…
kriscoleman Mar 23, 2026
660f9aa
fix(ci): use app-specific GITLAB_REPLICATED_API_TOKEN secret
kriscoleman Mar 23, 2026
c853646
fix(ci): use full path for helm chart tgz in create-release action
kriscoleman Mar 23, 2026
7fdcbfd
fix(ci): include kots yaml-dir in create-release to allow channel pro…
kriscoleman Mar 23, 2026
2c0fb66
fix(ci): remove yaml-dir from create-release (unsupported with chart)
kriscoleman Mar 23, 2026
ec589c4
fix(gitlab): address PR review comments
kriscoleman Mar 30, 2026
784cc6e
fix(gitlab): use --yaml-dir kots for KOTS-enabled releases; add --pro…
kriscoleman Mar 30, 2026
c332cde
fix(gitlab): add proper Helm CLI customer install flow; validate via …
kriscoleman Mar 30, 2026
ef82cfc
fix(ci): use yaml-dir for KOTS-enabled releases in CI workflow
kriscoleman Mar 30, 2026
abd3caa
feat(gitlab): add .envrc.example and direnv setup instructions
kriscoleman Mar 31, 2026
e4dd44b
fix(gitlab): fix make lint failures
kriscoleman Mar 31, 2026
fb310d3
Merge branch 'feat/gitlab-platform-example' of https://github.com/rep…
kriscoleman Apr 22, 2026
55008f6
wip: stashed work
kriscoleman Apr 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 7 additions & 15 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
# When adding a new Helm chart that depends on the Replicated SDK,
# add a corresponding entry here so Dependabot keeps it up to date.
#
# NOTE: Dependabot requires unique (ecosystem, directory) pairs, so we
# use a single entry with groups to separate Replicated SDK updates from
# everything else. Both follow a weekly cadence as a result.
#
version: 2
updates:
# Track the Replicated SDK on a weekly cadence
- package-ecosystem: "helm"
directories: &helm-dirs
directories:
- "/applications/fake-services/app"
- "/applications/mlflow/charts/mlflow"
- "/applications/n8n/charts/n8n"
Expand All @@ -17,21 +20,10 @@ updates:
- "/applications/wg-easy/charts/wg-easy"
schedule:
interval: "weekly"
allow:
- dependency-name: "replicated"
groups:
replicated-sdk:
patterns:
- "replicated"

# Track all other Helm dependencies on a monthly cadence
- package-ecosystem: "helm"
directories: *helm-dirs
schedule:
interval: "monthly"
ignore:
- dependency-name: "replicated"
groups:
all-other-deps:
patterns:
- "*"
exclude-patterns:
- "replicated"
12 changes: 10 additions & 2 deletions .github/workflows/flagd-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,18 @@ jobs:
fi
echo "Checksum changed: $CHECKSUM_BEFORE -> $CHECKSUM_AFTER"

check-secret:
runs-on: ubuntu-22.04
outputs:
has-token: ${{ steps.check.outputs.has-token }}
steps:
- id: check
run: echo "has-token=${{ secrets.REPLICATED_PLATFORM_EXAMPLES_TOKEN != '' }}" >> "$GITHUB_OUTPUT"

helm-install-test:
runs-on: ubuntu-22.04
needs: [lint-and-template]
if: ${{ secrets.REPLICATED_PLATFORM_EXAMPLES_TOKEN != '' }}
needs: [lint-and-template, check-secret]
if: needs.check-secret.outputs.has-token == 'true'
defaults:
run:
working-directory: applications/flagd
Expand Down
134 changes: 134 additions & 0 deletions .github/workflows/gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
name: GitLab CI

# Security note: GITLAB_REPLICATED_API_TOKEN must be from a dedicated service account,
# NOT a personal token. Create one at: vendor.replicated.com >
# Account Settings > Service Accounts.

on:
pull_request:
paths:
- 'applications/gitlab/charts/**'
- 'applications/gitlab/kots/**'
- 'applications/gitlab/tests/**'
- 'applications/gitlab/Makefile'
- '.github/workflows/gitlab-ci.yml'
push:
branches:
- main
paths:
- 'applications/gitlab/charts/**'
- 'applications/gitlab/kots/**'
- 'applications/gitlab/tests/**'
- 'applications/gitlab/Makefile'
- '.github/workflows/gitlab-ci.yml'

env:
APP_SLUG: gitlab-pika

jobs:
lint-and-template:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: applications/gitlab
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Helm
uses: azure/setup-helm@v4.3.0
with:
version: v3.13.3

- name: Add Helm repositories
run: make add-helm-repositories

- name: Update dependencies
run: make update-dependencies

- name: Helm lint
run: helm lint ./charts/gitlab

- name: Helm template
run: helm template gitlab ./charts/gitlab -f tests/helm/ci-values.yaml > /dev/null

create-release:
if: github.event_name == 'pull_request'
runs-on: ubuntu-22.04
needs: [lint-and-template]
defaults:
run:
working-directory: applications/gitlab
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v4.3.0
with:
version: v3.13.3

- name: Set release version
id: set-release-version
run: |
git_hash=$(git rev-parse --short HEAD)
version="0.1.0-pr.${{ github.event.pull_request.number }}.${git_hash}"
echo "VERSION=${version}" >> $GITHUB_ENV

- name: Add Helm repositories
run: make add-helm-repositories

- name: Package Helm chart into kots/
run: helm package ./charts/gitlab --version ${{ env.VERSION }} -u -d kots/

- name: Create Replicated release on Unstable
uses: replicatedhq/compatibility-actions/create-release@v1
with:
app-slug: ${{ env.APP_SLUG }}
api-token: ${{ secrets.GITLAB_REPLICATED_API_TOKEN }}
yaml-dir: applications/gitlab/kots
version: ${{ env.VERSION }}
promote-channel: Unstable

promote-stable:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-22.04
needs: [lint-and-template]
defaults:
run:
working-directory: applications/gitlab
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v4.3.0
with:
version: v3.13.3

- name: Set release version
id: set-release-version
run: |
git_hash=$(git rev-parse --short HEAD)
date_version=$(date -u '+%Y.%-m.%-d-%H%M%S')
version="${date_version}-${git_hash}"
echo "VERSION=${version}" >> $GITHUB_ENV

- name: Add Helm repositories
run: make add-helm-repositories

- name: Package Helm chart into kots/
run: helm package ./charts/gitlab --version ${{ env.VERSION }} -u -d kots/

- name: Create release and promote to Stable
uses: replicatedhq/compatibility-actions/create-release@v1
with:
app-slug: ${{ env.APP_SLUG }}
api-token: ${{ secrets.GITLAB_REPLICATED_API_TOKEN }}
yaml-dir: applications/gitlab/kots
version: ${{ env.VERSION }}
promote-channel: Stable
1 change: 1 addition & 0 deletions applications/gitlab/.cluster-id
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
44637dd1
23 changes: 23 additions & 0 deletions applications/gitlab/.envrc.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copy this file to .envrc and fill in your values, then run `direnv allow`.
# .envrc is git-ignored so your credentials stay local.
#
# Install direnv: https://direnv.net/docs/installation.html

# Your Replicated Vendor Portal API token.
# Create one at: vendor.replicated.com > Account Settings > API Tokens
# For CI, use a dedicated service account token instead of a personal token.
export REPLICATED_API_TOKEN=

# Your Replicated app slug (shown in the Vendor Portal URL and app settings).
# Example: my-app-slug
export REPLICATED_APP=

# (Optional) License ID for testing the customer Helm install flow.
# This is the `installationId` field from `replicated customer create --output json`,
# NOT the top-level `id` field. Used with `helm registry login` and
# `--set global.replicated.licenseID=` during CMX validation.
export REPLICATED_LICENSE_ID=

# (Optional) Customer email associated with the license above.
# Used as the username for `helm registry login registry.replicated.com`.
export REPLICATED_CUSTOMER_EMAIL=
1 change: 1 addition & 0 deletions applications/gitlab/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
kots/*.tgz
114 changes: 114 additions & 0 deletions applications/gitlab/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
.PHONY: add-helm-repositories update-dependencies lint package release \
cluster-create cluster-delete setup-deps teardown-deps install uninstall

PG_PASSWORD ?= gitlab-pg-pass
REDIS_PASSWORD ?= gitlab-redis-pass

CHART_DIR := charts/gitlab
CLUSTER_NAME ?= gitlab-cmx
CMX_DISTRIBUTION ?= k3s
CMX_VERSION ?= 1.32
CMX_INSTANCE ?= r1.xlarge
CMX_DISK ?= 100
CMX_TTL ?= 4h
CLUSTER_ID_FILE := .cluster-id

add-helm-repositories:
helm repo add gitlab https://charts.gitlab.io/
helm repo update

update-dependencies:
helm dependency update $(CHART_DIR)

lint:
helm lint $(CHART_DIR)
helm template gitlab $(CHART_DIR) -f tests/helm/ci-values.yaml > /dev/null

package: update-dependencies
helm package $(CHART_DIR) -d kots/

release: package
REPLICATED_API_TOKEN=$(REPLICATED_API_TOKEN) replicated release create \
--app $(REPLICATED_APP) \
--yaml-dir kots \
--promote Unstable \
--release-notes "Release via Makefile"

# CMX cluster management
cluster-create:
@echo "Creating CMX cluster '$(CLUSTER_NAME)'..."
replicated cluster create \
--distribution $(CMX_DISTRIBUTION) \
--version $(CMX_VERSION) \
--instance-type $(CMX_INSTANCE) \
--disk $(CMX_DISK) \
--ttl $(CMX_TTL) \
--name $(CLUSTER_NAME) \
--wait 10m \
--output json | jq -r '.id' > $(CLUSTER_ID_FILE)
replicated cluster kubeconfig $$(cat $(CLUSTER_ID_FILE))
@echo "Cluster ready. ID: $$(cat $(CLUSTER_ID_FILE))"

cluster-delete:
@test -f $(CLUSTER_ID_FILE) || (echo "No $(CLUSTER_ID_FILE) found. Run 'make cluster-create' first."; exit 1)
replicated cluster rm $$(cat $(CLUSTER_ID_FILE))
rm -f $(CLUSTER_ID_FILE)

# In-cluster PostgreSQL and Redis for CMX testing (not for production)
setup-deps:
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
kubectl create namespace gitlab --dry-run=client -o yaml | kubectl apply -f -
helm upgrade --install postgresql bitnami/postgresql \
--namespace gitlab \
--set fullnameOverride=external-postgresql \
--set auth.username=gitlab \
--set auth.password=$(PG_PASSWORD) \
--set auth.database=gitlabhq_production \
--set primary.resourcesPreset=none \
--set primary.resources.requests.memory=1Gi \
--set primary.resources.limits.memory=2Gi \
--wait
helm upgrade --install redis bitnami/redis \
--namespace gitlab \
--set fullnameOverride=external-redis \
--set architecture=standalone \
--set auth.password=$(REDIS_PASSWORD) \
--wait
kubectl create secret generic gitlab-external-pg-password \
--from-literal=password=$(PG_PASSWORD) \
--namespace gitlab \
--dry-run=client -o yaml | kubectl apply -f -
kubectl create secret generic gitlab-external-redis-password \
--from-literal=redis-password=$(REDIS_PASSWORD) \
--namespace gitlab \
--dry-run=client -o yaml | kubectl apply -f -
@echo "Granting superuser to gitlab DB user so migrations can CREATE EXTENSION..."
kubectl exec -n gitlab pod/external-postgresql-0 -- \
env PGPASSWORD=$$(kubectl get secret external-postgresql -n gitlab \
-o jsonpath='{.data.postgres-password}' | base64 -d) \
psql -U postgres -c "ALTER USER gitlab SUPERUSER;"

teardown-deps:
helm uninstall postgresql --namespace gitlab --ignore-not-found
helm uninstall redis --namespace gitlab --ignore-not-found

# Helm install / uninstall (customer flow via Replicated OCI registry)
install:
@test -n "$(REPLICATED_CUSTOMER_EMAIL)" || (echo "REPLICATED_CUSTOMER_EMAIL is not set"; exit 1)
@test -n "$(REPLICATED_LICENSE_ID)" || (echo "REPLICATED_LICENSE_ID is not set"; exit 1)
helm registry login registry.replicated.com \
--username $(REPLICATED_CUSTOMER_EMAIL) \
--password $(REPLICATED_LICENSE_ID)
helm install gitlab \
oci://registry.replicated.com/$(REPLICATED_APP)/unstable/gitlab \
--namespace gitlab \
--create-namespace \
--set global.replicated.licenseID=$(REPLICATED_LICENSE_ID) \
-f tests/helm/cmx-deploy-values.yaml \
--timeout 20m \
--wait

uninstall:
helm uninstall gitlab --namespace gitlab
kubectl delete namespace gitlab --ignore-not-found
Loading
Loading