Commit a6f60b6d authored by Daniel LACROIX's avatar Daniel LACROIX
Browse files

update gitlab CI

parent 2f2c5b2d
image: docker:stable
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
GIT_SUBMODULE_STRATEGY: recursive
DOCKER_TLS_CERTDIR: ""
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
GIT_SUBMODULE_STRATEGY: recursive
services:
- docker:dind
before_script:
- docker info
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker:dind
build:
stage: build
script:
- docker pull $CI_REGISTRY_IMAGE:latest || true
- docker build --cache-from $CI_REGISTRY_IMAGE:latest --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA --tag $CI_REGISTRY_IMAGE:latest .
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
- docker push $CI_REGISTRY_IMAGE:latest
before_script:
- docker info
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
only:
- develop
- master
stage: build
script:
- docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME || true
- docker build --cache-from $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME .
- echo $CI_REGISTRY
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
deploy:
image: roffe/kubectl
stage: deploy
tags:
- deploy
only:
- develop
script:
- echo $CI_PROJECT_NAME
- echo $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
- echo $KUBE_URL
- echo $KUBE_NS
- kubectl --insecure-skip-tls-verify -n $KUBE_NS --server=$KUBE_URL --token=$KUBE_TOKEN patch deployment $CI_PROJECT_NAME -p "{\"spec\":{\"template\":{\"metadata\":{\"labels\":{\"redeploy\":\"$(date +%s)\"}}}}}"
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