Newer
Older

Marco De Donno
committed
variables:
GIT_SUBMODULE_STRATEGY: recursive
stages:
- build
- push

Marco De Donno
committed
before_script:
- docker --version
- docker-compose --version
build:
stage: build
script:
- echo "__branch__ = '${CI_COMMIT_REF_NAME}'" > ./web/app/version.py
- echo "__commit__ = '${CI_COMMIT_SHA}'" >> ./web/app/version.py
- echo "__commiturl__ = '${GIT_PROJECT_URL}/commit/${CI_COMMIT_SHA}'" >> ./web/app/version.py
- echo "__treeurl__ = '${GIT_PROJECT_URL}/tree/${CI_COMMIT_SHA}'" >> ./web/app/version.py
- echo "__date__ = '$(git show -s --format=%ci $CI_COMMIT_SHA)'" >> ./web/app/version.py
- echo "__version__ = __branch__ + ' - ' + __commit__[ 0:8 ] + ' - ' + __date__ " >> ./web/app/version.py
- echo "__author_name__ = '$(git show -s --format=%an $CI_COMMIT_SHA)'" >> ./web/app/version.py
- echo "__author_email__ = '$(git show -s --format=%ae $CI_COMMIT_SHA)'" >> ./web/app/version.py
- echo "__author__ = __author_name__ + ' <' + __author_email__ + '>'" >> ./web/app/version.py

Marco De Donno
committed
- make build
push:
stage: push
only:
- master
script:
- make push
clean:
stage: clean

Marco De Donno
committed
script:
- make clean
script:
- echo Deploying production on ${PROD_HOST}...
- docker -H ${PROD_HOST} service update --force --detach --image=$(docker inspect --format='{{index .RepoDigests 0}}' ${REGISTRY}/icnml_web) ${PROD_SERVICE_NAME}