Don't push test image to repository anymore

This commit is contained in:
Rémy Jacquin 2017-10-15 15:00:52 +02:00
parent b1db27cd59
commit afb3b96834
No known key found for this signature in database
GPG Key ID: BEEF3B9EC3E7FBE9

View File

@ -11,32 +11,24 @@ services:
- docker:dind - docker:dind
stages: stages:
- build
- test - test
- cleanup
- deploy - deploy
before_script: before_script:
- docker info - docker info
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
build:
stage: build
script:
- docker build -t $IMAGE_NAME .
- docker push $IMAGE_NAME
test: test:
stage: test stage: test
script: script:
- docker pull $IMAGE_NAME - docker build -t $IMAGE_NAME .
- docker run -v `pwd`:/git $IMAGE_NAME /bin/sh -c "wget -qO- https://fedoraproject.org/static/hotspot.txt | grep OK && cd /git && hugo" - docker run -v `pwd`:/git $IMAGE_NAME /bin/sh -c "wget -qO- https://fedoraproject.org/static/hotspot.txt | grep OK && cd /git && hugo"
deploy: deploy:
stage: deploy stage: deploy
script: script:
- docker pull $IMAGE_NAME - docker build -t $IMAGE_NAME -t $IMAGE_LATEST .
- docker tag $IMAGE_NAME $IMAGE_LATEST - docker push $IMAGE_NAME
- docker push $IMAGE_LATEST - docker push $IMAGE_LATEST
only: only:
- tags - tags