Skip to content

Commit

Permalink
replace common exports with reusable shell scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
rickyliumerkle committed Oct 7, 2019
1 parent 9845e5c commit a20adde
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,8 @@ services:
- 'docker'

before_install:
- echo GET CONFIG FROM DOCKERFILE
- export IMAGE_NAME=$(grep imagename= Dockerfile | sed -e 's/.*imagename="\(.*\)".*/\1/')
- export TEST_COMMAND=$(grep test.command= Dockerfile | sed -e 's/.*test.command="\(.*\)".*/\1/')
- export TEST_COMMAND_VERIFY=$(grep test.command.verify= Dockerfile | sed -e 's/.*test.command.verify="\(.*\)".*/\1/')
- export IMAGE_VERSION=$(grep version= Dockerfile | sed -e 's/.*version="\(.*\)".*/\1/')
- export IMAGE="$ORGANISATION_NAME/$IMAGE_NAME"
- echo IMAGE_NAME=$IMAGE_NAME
- echo IMAGE_VERSION=$IMAGE_VERSION
- echo TEST_COMMAND=$TEST_COMMAND
- echo TEST_COMMAND_VERIFY=$TEST_COMMAND_VERIFY
- echo GET CONFIG FROM GIT
- export CURRENT_VERSION=$(git describe --tag --always --long | sed -e 's/\(.*\)-\(.*\)-.*/\1.\2/')
- declare -a CURRENT_VERSION_ARRAY="(${CURRENT_VERSION//./ })"; export SEMVER_MAJOR=${CURRENT_VERSION_ARRAY[0]}; export SEMVER_MINOR=${CURRENT_VERSION_ARRAY[1]}; export SEMVER_PATCH=${CURRENT_VERSION_ARRAY[2]}; export SEMVER_BUILD=${CURRENT_VERSION_ARRAY[-1]}
- export SEMVER_BUILD=$(( ${SEMVER_PATCH} + ${SEMVER_BUILD} ))
- echo SEMVER_MAJOR:${SEMVER_MAJOR}
- echo SEMVER_MINOR:${SEMVER_MINOR}
- echo SEMVER_BUILD:${SEMVER_BUILD}
- export SEMVER=${SEMVER_MAJOR}.${SEMVER_MINOR}.${SEMVER_BUILD}
- echo SEMVER:$SEMVER
- if [[ ${SEMVER_MAJOR} == "" ]]; then travis_terminate 1; fi
- export TRAVIS_TAG=$SEMVER
- echo TRAVIS_TAG:$TRAVIS_TAG
- source <(curl -s https://raw.githubusercontent.com/aem-design/aemdesign-docker/master/scripts/travis/get_config.sh)
- source <(curl -s https://raw.githubusercontent.com/aem-design/aemdesign-docker/master/scripts/travis/get_version.sh)

#build and test
install:
Expand Down

0 comments on commit a20adde

Please sign in to comment.