Commit e2294f60 authored by Jure's avatar Jure

Don't exit but instead just check conditions for each step in the build phase

parent eccfe8cc
Pipeline #3994 failed with stages
in 17 seconds
......@@ -16,12 +16,11 @@ build:
image: docker:latest
stage: build
script:
- if [ -z "$DOCKERHUB_USERNAME" ] && [ -z "$DOCKERHUB_PASSWORD"]; then exit 1; fi
- docker version
- docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
- if [ -z "$DOCKERHUB_USERNAME" ] && [ -z "$DOCKERHUB_PASSWORD"]; then docker version; fi
- if [ -z "$DOCKERHUB_USERNAME" ] && [ -z "$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"
- docker build -t $IMAGE_ORG/$IMAGE_NAME:$CI_COMMIT_SHA .
- docker push $IMAGE_ORG/$IMAGE_NAME:$CI_COMMIT_SHA
- if [ -z "$DOCKERHUB_USERNAME" ] && [ -z "$DOCKERHUB_PASSWORD"]; then docker build -t $IMAGE_ORG/$IMAGE_NAME:$CI_COMMIT_SHA .; fi
- if [ -z "$DOCKERHUB_USERNAME" ] && [ -z "$DOCKERHUB_PASSWORD"]; then docker push $IMAGE_ORG/$IMAGE_NAME:$CI_COMMIT_SHA; fi
lint:style:
image: $IMAGE_ORG/$IMAGE_NAME:$CI_COMMIT_SHA
......
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