New updates to scripts for travis (#381)

This commit is contained in:
Jesus Federico 2019-02-26 09:34:51 -05:00 committed by GitHub
parent fff8a52cc2
commit 6ebdd43709
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View File

@ -31,6 +31,9 @@ build:
# Build.
- ./scripts/image_build.sh $CI_PROJECT_PATH $CI_COMMIT_REF_NAME $CI_COMMIT_SHA
only:
refs:
- branches
- tags
variables:
- $CD_DOCKER_USERNAME
- $CD_DOCKER_PASSWORD
@ -54,6 +57,7 @@ deploy:
only:
refs:
- branches
- tags
variables:
- $CD_DOCKER_USERNAME
- $CD_DOCKER_PASSWORD

View File

@ -20,7 +20,7 @@ jobs:
- stage: build
name: build docker image
script: bash scripts/image_build.sh $TRAVIS_REPO_SLUG $TRAVIS_BRANCH $TRAVIS_COMMIT
if: !env(TRAVIS_PULL_REQUEST) AND env(CD_BUILD_IGNORE) IS NOT present AND env(CD_DOCKER_USERNAME) IS present AND env(CD_DOCKER_PASSWORD) IS present
if: type NOT IN (pull_request) AND env(CD_BUILD_IGNORE) IS NOT present AND env(CD_DOCKER_USERNAME) IS present AND env(CD_DOCKER_PASSWORD) IS present
notifications:
email: false

View File

@ -52,7 +52,7 @@ fi
# Set the version tag when it is a release or the commit sha was included.
if [[ "$CD_REF_NAME" == *"release"* ]]; then
sed -i "s/VERSION =.*/VERSION = \"$(expr substr $CD_REF_NAME 9)\"/g" config/initializers/version.rb
sed -i "s/VERSION =.*/VERSION = \"${CD_REF_NAME:8}\"/g" config/initializers/version.rb
elif [ ! -z $CD_COMMIT_SHA ]; then
sed -i "s/VERSION =.*/VERSION = \"$CD_REF_NAME ($(expr substr $CD_COMMIT_SHA 1 8))\"/g" config/initializers/version.rb
fi