Commit ff7824f2 authored by Hervé  MENAGER's avatar Hervé MENAGER

deployment cleanup, with some help from @bbrancot

parent 12b005f9
Pipeline #10624 failed with stages
in 40 seconds
......@@ -14,8 +14,20 @@ build:
stage: build
script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- docker build --pull -t "$CI_REGISTRY_IMAGE" .
- docker push "$CI_REGISTRY_IMAGE"
- docker pull "$CI_REGISTRY_IMAGE:latest" || true
- docker pull "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" || true
- docker build
--build-arg CI_COMMIT_REF_SLUG
--build-arg CI_COMMIT_SHA
--build-arg CI_COMMIT_SHORT_SHA
--cache-from "$CI_REGISTRY_IMAGE:latest"
--cache-from "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
--tag "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
--tag "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA"
--tag "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA
.
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA"
only:
- master
tags:
......@@ -32,9 +44,10 @@ deploy:
name: galaxy-cwl-dev
url: https://galaxy-cwl-dev.pasteur.cloud
script:
- yum install gettext -y
- kubectl delete secret registry-gitlab -n $NAMESPACE --ignore-not-found=true
- kubectl create secret docker-registry -n $NAMESPACE registry-gitlab --docker-server=registry-gitlab.pasteur.fr --docker-username=$DEPLOY_USER --docker-password=$DEPLOY_TOKEN --docker-email=hmenager@pasteur.fr
- sed "s/__NAMESPACE__/${NAMESPACE}/g" manifest.yaml | kubectl apply -f -
- envsubst < manifest.yaml | kubectl apply -f -
- kubectl patch deployment galaxy-cwl-is -p "{\"spec\":{\"template\":{\"metadata\":{\"labels\":{\"date\":\"`date +'%s'`\"}}}}}"
only:
- master
......
......@@ -8,12 +8,12 @@ spec:
template:
metadata:
labels:
app: __NAMESPACE__
app: ${NAMESPACE}
role: front
spec:
containers:
- name: galaxy-cwl-is
image: registry-gitlab.pasteur.fr/hub/galaxy-cwl-is:latest
image: ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHA}
imagePullPolicy: Always
ports:
- containerPort: 80
......@@ -25,11 +25,11 @@ kind: Service
metadata:
name: galaxy-cwl-is
labels:
app: __NAMESPACE__
app: ${NAMESPACE}
role: front
spec:
selector:
app: __NAMESPACE__
app: ${NAMESPACE}
role: front
ports:
- name: http
......@@ -42,13 +42,13 @@ kind: Ingress
metadata:
name: galaxy-cwl-is
labels:
app: __NAMESPACE__
app: ${NAMESPACE}
role: front
annotations:
kubernetes.io/ingress.class: "traefik"
spec:
rules:
- host: galaxy-cwl-dev.pasteur.cloud
- host: ${PUBLIC_URL}
http:
paths:
- backend:
......
Markdown is supported
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