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.
|
# Build.
|
||||||
- ./scripts/image_build.sh $CI_PROJECT_PATH $CI_COMMIT_REF_NAME $CI_COMMIT_SHA
|
- ./scripts/image_build.sh $CI_PROJECT_PATH $CI_COMMIT_REF_NAME $CI_COMMIT_SHA
|
||||||
only:
|
only:
|
||||||
|
refs:
|
||||||
|
- branches
|
||||||
|
- tags
|
||||||
variables:
|
variables:
|
||||||
- $CD_DOCKER_USERNAME
|
- $CD_DOCKER_USERNAME
|
||||||
- $CD_DOCKER_PASSWORD
|
- $CD_DOCKER_PASSWORD
|
||||||
|
@ -54,6 +57,7 @@ deploy:
|
||||||
only:
|
only:
|
||||||
refs:
|
refs:
|
||||||
- branches
|
- branches
|
||||||
|
- tags
|
||||||
variables:
|
variables:
|
||||||
- $CD_DOCKER_USERNAME
|
- $CD_DOCKER_USERNAME
|
||||||
- $CD_DOCKER_PASSWORD
|
- $CD_DOCKER_PASSWORD
|
||||||
|
|
|
@ -20,7 +20,7 @@ jobs:
|
||||||
- stage: build
|
- stage: build
|
||||||
name: build docker image
|
name: build docker image
|
||||||
script: bash scripts/image_build.sh $TRAVIS_REPO_SLUG $TRAVIS_BRANCH $TRAVIS_COMMIT
|
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:
|
notifications:
|
||||||
email: false
|
email: false
|
||||||
|
|
|
@ -52,7 +52,7 @@ fi
|
||||||
|
|
||||||
# Set the version tag when it is a release or the commit sha was included.
|
# Set the version tag when it is a release or the commit sha was included.
|
||||||
if [[ "$CD_REF_NAME" == *"release"* ]]; then
|
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
|
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
|
sed -i "s/VERSION =.*/VERSION = \"$CD_REF_NAME ($(expr substr $CD_COMMIT_SHA 1 8))\"/g" config/initializers/version.rb
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue