Fix deploy guard logic, use multiple lines

This commit is contained in:
Ilya Dmitrichenko
2018-05-21 09:55:02 +01:00
parent 6c3569e131
commit 39dde13700
+7 -4
View File
@@ -17,12 +17,15 @@ jobs:
steps:
- checkout
- setup_remote_docker: {docker_layer_caching: true}
- run:
name: Login to the registry
command: '[[ -z "${CIRCLE_PR_NUMBER}" ]] && (echo $REGISTRY_PASSWORD | docker login --username $REGISTRY_USERNAME --password-stdin)'
- run:
name: Build and push the image to the registry with Skaffold
command: '[[ -z "${CIRCLE_PR_NUMBER}" ]] && skaffold build --profile=production'
command: |
if [[ -z "${CIRCLE_PULL_REQUEST}" ]] && [[ "${CIRCLE_PROJECT_USERNAME}" = "stefanprodan" ]] ; then
echo $REGISTRY_PASSWORD | docker login --username $REGISTRY_USERNAME --password-stdin
skaffold build --profile=production
else
echo "Do not push image"
fi
workflows:
version: 2