Commit 52174a70 authored by Sam Galson's avatar Sam Galson

push image tagged latest after tests

parent 30524078
......@@ -17,9 +17,10 @@ build:
stage: build
script:
- docker version
- docker build -t $IMAGE_ORG/$IMAGE_NAME:$CI_COMMIT_SHA .
- if [ -z "$DOCKERHUB_USERNAME" ] || [ -z "$DOCKERHUB_PASSWORD" ]; then echo "Not pushing" && exit 0; fi
- docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
- echo "Ignore warning! Cannot perform an interactive login from a non TTY device"
- docker build -t $IMAGE_ORG/$IMAGE_NAME:$CI_COMMIT_SHA .
- docker push $IMAGE_ORG/$IMAGE_NAME:$CI_COMMIT_SHA
lint:
......@@ -40,6 +41,18 @@ test:
- cd ${HOME}
- npm run test
push:latest:
image: docker:latest
stage: staging
script:
- if [ -z "$DOCKERHUB_USERNAME" ] || [ -z "$DOCKERHUB_PASSWORD" ]; then echo "Not pushing" && exit 0; fi
- docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
- echo "Ignore warning! Cannot perform an interactive login from a non TTY device"
- docker build -t $IMAGE_ORG/$IMAGE_NAME:latest --label COMMIT_SHA=$CI_COMMIT_SHA .
- docker push $IMAGE_ORG/$IMAGE_NAME:latest
only:
- master
# -----------------------------------------------
# xpub-collabra ---------------------------------
# -----------------------------------------------
......
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