Skip to content

Commit 12e8165

Browse files
authored
Merge pull request #1612 from HSLdevcom/travis-prod-release
Improve travis build
2 parents 55fba67 + fad416f commit 12e8165

File tree

4 files changed

+30
-28
lines changed

4 files changed

+30
-28
lines changed

.travis.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,6 @@ branches:
77

88
cache: yarn
99

10-
before_install:
11-
- export CHROME_BIN=/usr/bin/google-chrome
12-
- export DISPLAY=:99.0
13-
- /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16
14-
- sudo apt-get install -y libappindicator1 fonts-liberation
15-
- wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
16-
- sudo dpkg -i google-chrome*.deb
17-
- openssl aes-256-cbc -K $encrypted_59b1a6418079_key -iv $encrypted_59b1a6418079_iv -in test/.dropbox_uploader.enc -out test/.dropbox_uploader -d
18-
1910
language: node_js
2011

2112
node_js:

test/deploy.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
set -e
33
ORG=${ORG:-hsldevcom}
44

5-
if [[ "$TRAVIS_BRANCH" = "master" && "$TRAVIS_PULL_REQUEST" = "false" ]]; then
5+
if [[ -n "$TRAVIS_TAG" || ( "$TRAVIS_BRANCH" = "master" && "$TRAVIS_PULL_REQUEST" = "false") ]]; then
66
docker pull $ORG/digitransit-ui:ci-$TRAVIS_COMMIT
77
docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_AUTH
8-
if [ -z "$TRAVIS_TAG" ]; then
9-
echo "Pushing dev release to docker"
10-
docker tag $ORG/digitransit-ui:ci-$TRAVIS_COMMIT $ORG/digitransit-ui:latest
11-
docker push $ORG/digitransit-ui:latest
12-
else
8+
if [ -n "$TRAVIS_TAG" ]; then
139
echo "Pushing prod release to docker"
1410
docker tag $ORG/digitransit-ui:ci-$TRAVIS_COMMIT $ORG/digitransit-ui:prod
1511
docker push $ORG/digitransit-ui:prod
12+
else
13+
echo "Pushing dev release to docker"
14+
docker tag $ORG/digitransit-ui:ci-$TRAVIS_COMMIT $ORG/digitransit-ui:latest
15+
docker push $ORG/digitransit-ui:latest
1616
fi
1717
fi

test/flow.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44
if [ -n "$TRAVIS_TAG" ]; then exit 0; fi
55

66
set -e
7+
8+
export CHROME_BIN=/usr/bin/google-chrome
9+
export DISPLAY=:99.0
10+
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16
11+
sudo apt-get install -y libappindicator1 fonts-liberation
12+
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
13+
sudo dpkg -i google-chrome*.deb
14+
715
ORG=${ORG:-hsldevcom}
816
yarn install
917

test/visual.sh

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,24 @@
33
# do nothing if the build is for tagging a prod release
44
if [ -n "$TRAVIS_TAG" ]; then exit 0; fi
55

6+
if [ -z "$BS_ACCESS_KEY" ]; then
7+
echo "BS_ACCESS_KEY not set, failing build on purpose"
8+
exit 1
9+
fi
10+
611
set -e
712
ORG=${ORG:-hsldevcom}
813
yarn install
914

10-
if [ -n "$BS_ACCESS_KEY" ]; then
11-
docker run -d -e CONFIG=hsl -p 127.0.0.1:8080:8080 $ORG/digitransit-ui:ci-$TRAVIS_COMMIT
12-
IDENTIFIER=${TRAVIS_COMMIT}_${VISUAL} yarn run test-visual -- --browser $VISUAL
13-
RESULT=$?
14-
if [ $RESULT -ne 0 ]; then
15-
echo "Uploading test images to https://www.dropbox.com/sh/emh3x8h38egy2k1/AAAq_eLYDxJ0AJAwFffoZqH9a?dl=0"
16-
tar czf gemini-report-$TRAVIS_COMMIT-$VISUAL.tar.gz gemini-report
17-
./test/dropbox_uploader.sh upload gemini-report-$TRAVIS_COMMIT-$VISUAL.tar.gz /gemini-report-$TRAVIS_COMMIT-$VISUAL.tar.gz
18-
fi
19-
exit $RESULT
20-
else
21-
echo "BS_ACCESS_KEY not set, failing build on purpose"
22-
exit 1
15+
openssl aes-256-cbc -K $encrypted_59b1a6418079_key -iv $encrypted_59b1a6418079_iv -in test/.dropbox_uploader.enc -out test/.dropbox_uploader -d
16+
docker run -d -e CONFIG=hsl -p 127.0.0.1:8080:8080 $ORG/digitransit-ui:ci-$TRAVIS_COMMIT
17+
18+
set +e
19+
IDENTIFIER=${TRAVIS_COMMIT}_${VISUAL} yarn run test-visual -- --browser $VISUAL
20+
RESULT=$?
21+
if [ $RESULT -ne 0 ]; then
22+
echo "Uploading test images to https://www.dropbox.com/sh/emh3x8h38egy2k1/AAAq_eLYDxJ0AJAwFffoZqH9a?dl=0"
23+
tar czf gemini-report-$TRAVIS_COMMIT-$VISUAL.tar.gz gemini-report
24+
./test/dropbox_uploader.sh upload gemini-report-$TRAVIS_COMMIT-$VISUAL.tar.gz /gemini-report-$TRAVIS_COMMIT-$VISUAL.tar.gz
2325
fi
26+
exit $RESULT

0 commit comments

Comments
 (0)