Commit fc209029 authored by lecornichon's avatar lecornichon
Browse files

Update .gitlab-ci.yml

parent 283e1f2e
Pipeline #6379 failed with stages
in 45 seconds
......@@ -6,7 +6,7 @@ stages:
- deploy
variables:
CONTAINER_IMAGE: ${DOCKER_USER}/myapps-${CI_COMMIT_SHORT_SHA}
CONTAINER_IMAGE: ${DOCKER_USER}/kub-dty-${CI_COMMIT_SHORT_SHA}
......@@ -18,8 +18,8 @@ build:
before_script:
- docker login ${HARBOR_SERVER} --username ${DOCKER_USER} --password ${DOCKER_PASSWORD}
script:
- docker build -t myapps .
- docker tag myapps zasyvcng.gra5.container-registry.ovh.net/library/${CI_COMMIT_SHORT_SHA}
- docker build -t template .
- docker tag template zasyvcng.gra5.container-registry.ovh.net/library/${CI_COMMIT_SHORT_SHA}
- docker push zasyvcng.gra5.container-registry.ovh.net/library/${CI_COMMIT_SHORT_SHA}
deploy:
......@@ -33,12 +33,5 @@ deploy:
- kubectl config set-credentials ${USER} --token="${USER_TOKEN}"
- kubectl config set-context ${CONTEXT} --cluster=${CLUSTER} --user=${USER}
- kubectl config use-context ${CONTEXT}
- sed -i "s/latest/${CI_COMMIT_SHORT_SHA}/g" kube/deployment.yaml
- sed -i "s/project/${CI_PROJECT_NAME}-${CI_PROJECT_ID}/g" kube/deployment.yaml
- sed -i "s/template/${CI_PROJECT_NAME}-${CI_PROJECT_ID}/g" kube/service.yaml
- sed -i "s/template/${CI_PROJECT_NAME}-${CI_PROJECT_ID}/g" kube/ingress.yaml
- sed -i "s/NAMESPACE/${NAMESPACE}/g" kube/deployment.yaml
- sed -i "s/NAMESPACE/${NAMESPACE}/g" kube/service.yaml
- sed -i "s/NAMESPACE/${NAMESPACE}/g" kube/ingress.yaml
- sed -i "s/domain/${URL}/g" kube/ingress.yaml
- kubectl apply -f kube
- helm upgrade --install ${PROJECT_NAME} myapps-chart-0.1.0.tgz --debug --namespace=${NAMESPACE} --set ingress.tls[0].secretName=${PROJECT_NAME}-tls,ingress.hosts[0].host=${URL},ingress.serviceName={PROJECT_NAME},${DB_IMAGE}.enabled=true,initdbUser=admin,initdbPassword=${PASSWORD_DB},db.user=admin,db.password=${PASSWORD_DB},image.repository=zasyvcng.gra5.container-registry.ovh.net/library/${CI_COMMIT_SHORT_SHA},myapps.namespace=${NAMESPACE},myapps.name=${PROJECT_NAME},myapps.selector=${PROJECT_NAME},myapps.nameDB=${PROJECT_NAME}-database,persistence.size=1Gi,master.persistence.size=1Gi,slave.persistence.size=1GiserviceAccount.create=true,serviceAccount.name=${PROJECT_NAME}.user --values=values.yaml
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment