forked from External/greenlight
New updates to scripts for travis (#381)
This commit is contained in:
parent
fff8a52cc2
commit
6ebdd43709
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue