Clean up CI pipeline and remove unused values files

- Use branch name (CI_COMMIT_REF_SLUG) instead of commit SHA for feature IDs
- Remove commented-out code and unused deploy template
- Fix deploy_stage to use kubectl config use-context
- Remove values-production.yaml and values-external.yaml
This commit is contained in:
Mondo Diaz
2026-01-13 21:51:50 +00:00
parent 09b51f5223
commit d8b68da004
3 changed files with 30 additions and 201 deletions

View File

@@ -27,31 +27,16 @@ python_tests:
- cd backend
- python -m pytest -v || echo "No tests yet"
# deploy_helm_charts:
# stage: deploy
# image:
# name: deps.global.bsf.tools/registry-1.docker.io/alpine/k8s:1.29.12
# parallel:
# matrix:
# # - ENV: "prod"
# # VALUES_FILE: "helm/values-prod.yaml"
# # CONTEXT: "esv/bsf/bsf-services/gitlab-kaas-agent-config:services-prod-agent"
# # NAMESPACE: "bsf-services-namespace"
# # ONLY: "main"
# - ENV: "dev"
# VALUES_FILE: "helm/orchard/values.yaml"
# CONTEXT: "esv/bsf/bsf-services/gitlab-kaas-agent-config:services-prod-agent"
# NAMESPACE: "bsf-services-dev-namespace"
# # ONLY: ["branches", "!main"]
# script:
# - kubectl config use-context $CONTEXT
# - echo "Deploy - buildah push ${IMAGE_NAME}:latest"
# - |
# helm upgrade --install orchard-dev ./helm/orchard --namespace $NAMESPACE -f $VALUES_FILE
.deploy_template: &deploy_template
# Deploy to stage (main branch)
deploy_stage:
stage: deploy
image: deps.global.bsf.tools/registry-1.docker.io/alpine/k8s:1.29.12
variables:
ENV: stage
NAMESPACE: orch-stage-namespace
VALUES_FILE: helm/orchard/values-stage.yaml
before_script:
- kubectl config use-context esv/bsf/bsf-integration/orchard/orchard-mvp:orchard-stage
- helm version
- helm repo add stable https://charts.helm.sh/stable
- helm repo add bitnami https://charts.bitnami.com/bitnami
@@ -59,41 +44,25 @@ python_tests:
- helm dependency update
- helm repo update
script:
- echo "Deploying to $ENV environment in namespace $NAMESPACE using chart $VALUES_FILE with agent $AGENT"
- helm upgrade --install orchard-$ENV ./helm/orchard --namespace $NAMESPACE -f $VALUES_FILE --set image.tag=$IMAGE
- echo "Deploying to stage environment"
- cd $CI_PROJECT_DIR
- helm upgrade --install orchard-stage ./helm/orchard --namespace $NAMESPACE -f $VALUES_FILE --set image.tag=$CI_COMMIT_SHA
environment:
name: $ENV
name: stage
url: https://orchard-stage.common.global.bsf.tools
kubernetes:
agent: $AGENT
# Deploy to stage (main branch)
deploy_stage:
image: deps.global.bsf.tools/registry-1.docker.io/alpine/k8s:1.29.12
stage: deploy
variables:
ENV: stage
NAMESPACE: orch-stage-namespace
VALUES_FILE: "helm/orchard/values-stage.yaml"
AGENT: esv/bsf/bsf-integration/orchard/orchard-mvp:orchard-stage
IMAGE: $CI_COMMIT_SHA
agent: esv/bsf/bsf-integration/orchard/orchard-mvp:orchard-stage
rules:
- if: '$CI_COMMIT_BRANCH == "main"'
when: always
<<: *deploy_template
# Deploy feature branch to dev namespace
deploy_feature:
image: deps.global.bsf.tools/registry-1.docker.io/alpine/k8s:1.29.12
stage: deploy
image: deps.global.bsf.tools/registry-1.docker.io/alpine/k8s:1.29.12
variables:
FEATURE_ID: feat-$CI_COMMIT_SHORT_SHA
ENV: feat-$CI_COMMIT_SHORT_SHA
NAMESPACE: orch-dev-namespace
VALUES_FILE: "helm/orchard/values-dev.yaml"
AGENT: esv/bsf/bsf-integration/orchard/orchard-mvp:orchard
IMAGE: $CI_COMMIT_SHA
FEATURE_HOST: orchard-$CI_COMMIT_SHORT_SHA.common.global.bsf.tools
MINIO_HOST: minio-$CI_COMMIT_SHORT_SHA.common.global.bsf.tools
VALUES_FILE: helm/orchard/values-dev.yaml
before_script:
- kubectl config use-context esv/bsf/bsf-integration/orchard/orchard-mvp:orchard
- helm version
@@ -103,21 +72,21 @@ deploy_feature:
- helm dependency update
- helm repo update
script:
- echo "Deploying feature branch to $ENV environment"
- echo "Deploying feature branch $CI_COMMIT_REF_SLUG"
- cd $CI_PROJECT_DIR
- |
helm upgrade --install orchard-$FEATURE_ID ./helm/orchard \
helm upgrade --install orchard-$CI_COMMIT_REF_SLUG ./helm/orchard \
--namespace $NAMESPACE \
-f $VALUES_FILE \
--set image.tag=$IMAGE \
--set ingress.hosts[0].host=$FEATURE_HOST \
--set ingress.tls[0].hosts[0]=$FEATURE_HOST \
--set ingress.tls[0].secretName=orchard-$FEATURE_ID-tls \
--set minioIngress.host=$MINIO_HOST \
--set minioIngress.tls.secretName=minio-$FEATURE_ID-tls
--set image.tag=$CI_COMMIT_SHA \
--set ingress.hosts[0].host=orchard-$CI_COMMIT_REF_SLUG.common.global.bsf.tools \
--set ingress.tls[0].hosts[0]=orchard-$CI_COMMIT_REF_SLUG.common.global.bsf.tools \
--set ingress.tls[0].secretName=orchard-$CI_COMMIT_REF_SLUG-tls \
--set minioIngress.host=minio-$CI_COMMIT_REF_SLUG.common.global.bsf.tools \
--set minioIngress.tls.secretName=minio-$CI_COMMIT_REF_SLUG-tls
environment:
name: review/$CI_COMMIT_REF_SLUG
url: https://orchard-$CI_COMMIT_SHORT_SHA.common.global.bsf.tools
url: https://orchard-$CI_COMMIT_REF_SLUG.common.global.bsf.tools
on_stop: cleanup_feature
kubernetes:
agent: esv/bsf/bsf-integration/orchard/orchard-mvp:orchard
@@ -128,21 +97,19 @@ deploy_feature:
# Cleanup feature branch deployment
cleanup_feature:
stage: deploy
variables:
FEATURE_ID: feat-$CI_COMMIT_SHORT_SHA
NAMESPACE: orch-dev-namespace
AGENT: esv/bsf/bsf-integration/orchard/orchard-mvp:orchard
image: deps.global.bsf.tools/registry-1.docker.io/alpine/k8s:1.29.12
variables:
NAMESPACE: orch-dev-namespace
before_script:
- kubectl config use-context esv/bsf/bsf-integration/orchard/orchard-mvp:orchard
script:
- echo "Cleaning up feature deployment orchard-$FEATURE_ID"
- helm uninstall orchard-$FEATURE_ID --namespace $NAMESPACE || true
- echo "Cleaning up feature deployment orchard-$CI_COMMIT_REF_SLUG"
- helm uninstall orchard-$CI_COMMIT_REF_SLUG --namespace $NAMESPACE || true
environment:
name: review/$CI_COMMIT_REF_SLUG
action: stop
kubernetes:
agent: $AGENT
agent: esv/bsf/bsf-integration/orchard/orchard-mvp:orchard
rules:
- if: '$CI_COMMIT_BRANCH && $CI_COMMIT_BRANCH != "main"'
when: manual