only log into docker when password available

This commit is contained in:
Kyle Spearrin 2019-03-08 16:38:21 -05:00
parent 526df6e41a
commit 60039de67d
2 changed files with 5 additions and 1 deletions

View File

@ -19,7 +19,6 @@ init:
- ps: Install-Product node $env:nodejs_version - ps: Install-Product node $env:nodejs_version
install: install:
- sh: echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- ps: choco install cloc --no-progress - ps: choco install cloc --no-progress
- ps: cloc --include-lang TypeScript,JavaScript,HTML,Sass,CSS --vcs git - ps: cloc --include-lang TypeScript,JavaScript,HTML,Sass,CSS --vcs git
- ps: $env:package_version = (Get-Content -Raw -Path package.json | ConvertFrom-Json).version - ps: $env:package_version = (Get-Content -Raw -Path package.json | ConvertFrom-Json).version

View File

@ -15,6 +15,11 @@ fi
echo "Prod deploy: ${PROD_DEPLOY}" echo "Prod deploy: ${PROD_DEPLOY}"
echo "Tag name: ${TAG_NAME}" echo "Tag name: ${TAG_NAME}"
if [ "${DOCKER_USERNAME}" != "" -a "${DOCKER_PASSWORD}" != "" ]
then
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
fi
chmod +x ./build.sh chmod +x ./build.sh
./build.sh ./build.sh
./build.sh tag dev ./build.sh tag dev