From 5dcc6a6f9636c3ff599a9468bf6c65992c3bdef8 Mon Sep 17 00:00:00 2001 From: Matthew B White Date: Thu, 15 Jun 2017 17:16:09 +0100 Subject: [PATCH 1/3] drop in the detection script for live testing --- .travis/before-install.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.travis/before-install.sh b/.travis/before-install.sh index 8f9f56ca19..b839231f1c 100755 --- a/.travis/before-install.sh +++ b/.travis/before-install.sh @@ -51,6 +51,33 @@ echo "->- Build cfg being used" cat ${DIR}/build.cfg echo "-<-" + +###### +# checking the changes that are in this file +echo $TRAVIS_COMMIT_RANGE +echo $TRAVIS_COMMIT +echo $TRAVIS_EVENT_TYPE + + +if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then + git show --pretty=format: --name-only "$COMMIT_RANGE"|sort|uniq > changedfiles.log +elif [ -n "$TRAVIS_PULL_REQUEST" ]; then + git diff --name-only "$TRAVIS_COMMIT" "$TRAVIS_BRANCH" > changedfiles.log +fi + +cat changedfiles.log | sed '/^\s*$/d' | awk '!/composer-website/ { exit 1 }' +if [ $? -eq 0 ] +then + echo "Only docs changes" +else + echo "More than docs changes" +fi +rm changedfiles.log +###### + + + + # Check of the task current executing if [ "${FC_TASK}" = "docs" ]; then echo Doing Docs - no requirement for installations of other software From 4629d765059c6c0ea2ecaeb99a34796ff1ca0e5e Mon Sep 17 00:00:00 2001 From: Matthew B White Date: Thu, 15 Jun 2017 17:35:04 +0100 Subject: [PATCH 2/3] correct range variable --- .travis/before-install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis/before-install.sh b/.travis/before-install.sh index b839231f1c..063a558cba 100755 --- a/.travis/before-install.sh +++ b/.travis/before-install.sh @@ -10,7 +10,7 @@ sudo rm /usr/local/bin/docker-compose curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose chmod +x docker-compose sudo mv docker-compose /usr/local/bin -echo "Docker-compose version: " +echo "Docker-compose version: " docker-compose --version # Update docker @@ -22,7 +22,7 @@ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" sudo apt-get update sudo apt-get install docker-ce -echo "Docker version: " +echo "Docker version: " docker --version # Grab the parent (root) directory. @@ -60,7 +60,7 @@ echo $TRAVIS_EVENT_TYPE if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then - git show --pretty=format: --name-only "$COMMIT_RANGE"|sort|uniq > changedfiles.log + git show --pretty=format: --name-only "$TRAVIS_COMMIT_RANGE"|sort|uniq > changedfiles.log elif [ -n "$TRAVIS_PULL_REQUEST" ]; then git diff --name-only "$TRAVIS_COMMIT" "$TRAVIS_BRANCH" > changedfiles.log fi From e204400eaf84e169d631fd3795b7190d725337c4 Mon Sep 17 00:00:00 2001 From: Matthew B White Date: Fri, 16 Jun 2017 09:53:50 +0100 Subject: [PATCH 3/3] updates --- .travis/before-install.sh | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/.travis/before-install.sh b/.travis/before-install.sh index 063a558cba..6ba32b6b36 100755 --- a/.travis/before-install.sh +++ b/.travis/before-install.sh @@ -54,11 +54,25 @@ echo "-<-" ###### # checking the changes that are in this file -echo $TRAVIS_COMMIT_RANGE -echo $TRAVIS_COMMIT -echo $TRAVIS_EVENT_TYPE +echo "Travis commit range $TRAVIS_COMMIT_RANGE" +echo "Travis commit $TRAVIS_COMMIT" +echo "Travis event type $TRAVIS_EVENT_TYPE" +if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then + echo -e "Build Pull Request #$TRAVIS_PULL_REQUEST => Branch [$TRAVIS_BRANCH]" +elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" == "" ]; then + echo -e 'Build Branch with Snapshot => Branch ['$TRAVIS_BRANCH']' +elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" != "" ]; then + echo -e 'Build Branch for Release => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG']' +else + echo -e 'WARN: Should not be here => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG'] Pull Request ['$TRAVIS_PULL_REQUEST']' +fi + + +cd $TRAVIS_BUILD_DIR +git diff --name-only $(echo $TRAVIS_COMMIT_RANGE | sed 's/\.//') + if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then git show --pretty=format: --name-only "$TRAVIS_COMMIT_RANGE"|sort|uniq > changedfiles.log elif [ -n "$TRAVIS_PULL_REQUEST" ]; then @@ -73,6 +87,8 @@ else echo "More than docs changes" fi rm changedfiles.log + +cd - > /dev/null ######