Commit ef2b40f2 authored by David Blyth's avatar David Blyth

GitLab CI: added deployment

parent 3695abca
Pipeline #147 passed with stages
in 8 seconds
......@@ -3,12 +3,13 @@ before_script:
stages:
- build
- deploy
- build_cleanup
build_test:
stage: build
script:
- docker build -t argonneeic/base:$CI_COMMIT_REF_NAME --build-arg BUILD_THREADS=20 .
- docker build -t argonneeic/base:$CI_COMMIT_REF_SLUG --build-arg BUILD_THREADS=20 .
except:
- master
......@@ -19,7 +20,14 @@ build_latest:
only:
- master
cleanup_docker:
docker_hub_push:
stage: deploy
script:
- bash deploy.sh
only:
- master
cleanup_docker_containers:
stage: build_cleanup
script:
- docker rm $(docker ps -qa --no-trunc --filter "status=exited")
......
#!/bin/bash
docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_PASSWD
docker push argonneeic/base:latest
tag=$(git describe --exact-match --tags HEAD)
if [ "$?" == "0" ]; then
docker tag argonneeic/base argonneeic/base:$tag
docker push argonneeic/base:$tag
fi
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