reformat common-services

This commit is contained in:
thibault.raquet 2024-02-29 09:15:13 +01:00
parent 1ead2558d8
commit 0dcebe0f48
2 changed files with 6 additions and 30 deletions

View file

@ -1,14 +1,10 @@
stages:
- push
variables:
K3S_VERSION: 1.28.3
push:staging:
stage: push
image: alpine/k8s:$K3S_VERSION
image: alpine/git
variables:
KUBE_CONTEXT: ldc-web/cluster-k8s:k8s-ldc-web
DEPLOY_BRANCH: deploy/staging
ENV: $ENV_STAGING
rules:
@ -16,33 +12,11 @@ push:staging:
when: manual
- when: never
before_script:
- apk update && apk add gettext git
- apk update && apk add gettext
script:
- export $(cat $ENV | xargs)
- echo "Update namespaces"
- |
for namespace in namespaces/*.yaml;
do envsubst < $namespace > $namespace.tmp;
mv $namespace.tmp $namespace;
done
- echo "Update manifests"
- |
for svc in manifests/common-services/*/*.yaml;
do envsubst < $svc > $svc.tmp; mv $svc.tmp $svc;
done
- echo "Deploy secrets"
- |
for secret in secrets/*.yaml;
do envsubst < $secret | kubectl apply -f -;
done
- echo "Deploy values ConfigMaps"
- |
for val in values/*.yaml;
do envsubst < $val > $val.tmp;
kubectl create configmap -n manifests/common-services $(basename "${val%.*}")-values -o yaml --dry-run=client --from-file=$val.tmp | kubectl apply -f -;
rm $val.tmp;
done
- echo "Pushing updated manifests in ${} branch"
- for namespace in namespaces/*.yaml; do envsubst < $namespace > $namespace.tmp; mv $namespace.tmp $namespace; done
- for svc in manifests/common-services/*/*.yaml; do envsubst < $svc > $svc.tmp; mv $svc.tmp $svc; done
- |
git config user.name "Bot Auto Deploy"
git config user.email "autodeploy@mediactivegroup.com"

View file

@ -24,6 +24,8 @@ spec:
name: gitlab-agent
namespace: common-services
values:
image:
tag: "${GITLAB_AGENT_VERSION}"
config:
kasAddress: "wss://lab.s-web.fr/-/kubernetes-agent/"
secretName: gitlab-agent-token