Skip to content
Snippets Groups Projects
Commit b547d1e7 authored by Sam Galson's avatar Sam Galson
Browse files

Merge branch 'only_push_to_hub_when_docker_hub_set' into 'master'

Silently skip the build stage if the DOCHERHUB secret vars are not set

See merge request pubsweet/pubsweet!45
parents cf45b13e b38507e9
No related branches found
No related tags found
No related merge requests found
...@@ -17,10 +17,10 @@ build: ...@@ -17,10 +17,10 @@ build:
stage: build stage: build
script: script:
- docker version - docker version
- docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD - if [ -n "$DOCKERHUB_USERNAME" ] && [ -n "$DOCKERHUB_PASSWORD" ]; then docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD; fi
- echo "Ignore warning! Cannot perform an interactive login from a non TTY device" - echo "Ignore warning! Cannot perform an interactive login from a non TTY device"
- docker build -t $IMAGE_ORG/$IMAGE_NAME:$CI_COMMIT_SHA . - docker build -t $IMAGE_ORG/$IMAGE_NAME:$CI_COMMIT_SHA .
- docker push $IMAGE_ORG/$IMAGE_NAME:$CI_COMMIT_SHA - if [ -n "$DOCKERHUB_USERNAME" ] && [ -n "$DOCKERHUB_PASSWORD" ]; then docker push $IMAGE_ORG/$IMAGE_NAME:$CI_COMMIT_SHA; fi
lint:style: lint:style:
image: $IMAGE_ORG/$IMAGE_NAME:$CI_COMMIT_SHA image: $IMAGE_ORG/$IMAGE_NAME:$CI_COMMIT_SHA
...@@ -73,7 +73,7 @@ stop_review:ui: ...@@ -73,7 +73,7 @@ stop_review:ui:
image: xpub/deployer:latest image: xpub/deployer:latest
stage: review stage: review
variables: variables:
PACKAGE_NAME: ui PACKAGE_NAME: ui
GIT_STRATEGY: none GIT_STRATEGY: none
environment: environment:
name: $PACKAGE_NAME/review/$CI_COMMIT_REF_NAME name: $PACKAGE_NAME/review/$CI_COMMIT_REF_NAME
......
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