From 8fd99d2e263f7591890a16b531b04770ef260443 Mon Sep 17 00:00:00 2001 From: Afonso Pinto Date: Mon, 28 Oct 2019 19:57:06 +0100 Subject: [PATCH 1/3] Fix travis build --- .travis.yml | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index deb223ce1..0e014306d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,9 +12,12 @@ env: - LANDING_PAGE: "http://localhost:8080/org.geppetto.frontend" services: - docker -install: - - npm install -g jest@24.8.0 puppeteer@1.17.0 jest-puppeteer@4.3.0 @babel/preset-env@7.4.5 url-join@4.0.0 @babel/core@7.4.5 +before_install: + - if [ $TRAVIS_BRANCH != "master" ]; then git clone -b development https://github.com/openworm/geppetto-client.git; fi script: + - pwd + - ls + - npm list -g --depth=0 - travis_retry docker build -t=$IMAGE_NAME --build-arg targetBranch=$TRAVIS_BRANCH --build-arg originBranch=$TRAVIS_PULL_REQUEST_BRANCH --build-arg defaultBranch=$DEFAULT_BRANCH $DOCKER_FOLDER - travis_retry docker run -t -dit --name=$CONTAINER_NAME -p 8080:8080 $IMAGE_NAME - bash $TRAVIS_BUILD_DIR/tests/casperjs/utilities/test_geppetto_server.sh @@ -22,19 +25,20 @@ script: - http_status=$(curl -s -I $1 $LANDING_PAGE | grep HTTP/1.1 | awk {'print $2'}) - echo "$http_status" - while [ "$http_status" == "404" ]; do - echo "Restart run. Printing logs for debugging purposes"; - sudo docker cp $CONTAINER_NAME:/home/developer/virgo/serviceability/logs/log.log /etc; - tail -n 200 /etc/log.log; - docker stop $(docker ps -a -q); - sleep 10; - docker rm $(docker ps -a -q); - sleep 10; - travis_retry docker run -t -dit --name=$CONTAINER_NAME -p 8080:8080 $IMAGE_NAME; - bash $TRAVIS_BUILD_DIR/tests/casperjs/utilities/test_geppetto_server.sh; - sleep 60; - http_status=$(curl -s -I $1 $LANDING_PAGE | grep HTTP/1.1 | awk {'print $2'}); - echo "Done restarting $http_status"; + echo "Restart run. Printing logs for debugging purposes"; + sudo docker cp $CONTAINER_NAME:/home/developer/virgo/serviceability/logs/log.log /etc; + tail -n 200 /etc/log.log; + docker stop $(docker ps -a -q); + sleep 10; + docker rm $(docker ps -a -q); + sleep 10; + travis_retry docker run -t -dit --name=$CONTAINER_NAME -p 8080:8080 $IMAGE_NAME; + bash $TRAVIS_BUILD_DIR/tests/casperjs/utilities/test_geppetto_server.sh; + sleep 60; + http_status=$(curl -s -I $1 $LANDING_PAGE | grep HTTP/1.1 | awk {'print $2'}); + echo "Done restarting $http_status"; done; + - npm list -g --depth=0 - travis_wait 35 travis_retry npm test -- --verbose --colors - docker ps -a; - sudo docker cp $CONTAINER_NAME:/home/developer/virgo/serviceability/logs/log.log /etc From bf6ad8dff5492dcdcbfa50312c8cc69ac38ff6ef Mon Sep 17 00:00:00 2001 From: Afonso Pinto Date: Mon, 28 Oct 2019 19:58:26 +0100 Subject: [PATCH 2/3] Remove debugging commands --- .travis.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0e014306d..ab03dbcba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,9 +15,6 @@ services: before_install: - if [ $TRAVIS_BRANCH != "master" ]; then git clone -b development https://github.com/openworm/geppetto-client.git; fi script: - - pwd - - ls - - npm list -g --depth=0 - travis_retry docker build -t=$IMAGE_NAME --build-arg targetBranch=$TRAVIS_BRANCH --build-arg originBranch=$TRAVIS_PULL_REQUEST_BRANCH --build-arg defaultBranch=$DEFAULT_BRANCH $DOCKER_FOLDER - travis_retry docker run -t -dit --name=$CONTAINER_NAME -p 8080:8080 $IMAGE_NAME - bash $TRAVIS_BUILD_DIR/tests/casperjs/utilities/test_geppetto_server.sh @@ -38,7 +35,6 @@ script: http_status=$(curl -s -I $1 $LANDING_PAGE | grep HTTP/1.1 | awk {'print $2'}); echo "Done restarting $http_status"; done; - - npm list -g --depth=0 - travis_wait 35 travis_retry npm test -- --verbose --colors - docker ps -a; - sudo docker cp $CONTAINER_NAME:/home/developer/virgo/serviceability/logs/log.log /etc From 3722e3d2a0ff65a5656cb1746800708995d99ab7 Mon Sep 17 00:00:00 2001 From: Afonso Pinto Date: Mon, 28 Oct 2019 21:19:44 +0100 Subject: [PATCH 3/3] Use variable instead of string --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ab03dbcba..a38afcb00 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,7 @@ env: services: - docker before_install: - - if [ $TRAVIS_BRANCH != "master" ]; then git clone -b development https://github.com/openworm/geppetto-client.git; fi + - if [ $TRAVIS_BRANCH != "master" ]; then git clone -b $DEFAULT_BRANCH https://github.com/openworm/geppetto-client.git; fi script: - travis_retry docker build -t=$IMAGE_NAME --build-arg targetBranch=$TRAVIS_BRANCH --build-arg originBranch=$TRAVIS_PULL_REQUEST_BRANCH --build-arg defaultBranch=$DEFAULT_BRANCH $DOCKER_FOLDER - travis_retry docker run -t -dit --name=$CONTAINER_NAME -p 8080:8080 $IMAGE_NAME