Skip to content

Commit

Permalink
Update travis config to run integration tests
Browse files Browse the repository at this point in the history
- Add utilities/verify.sh script that avoid running IT tests on PRs
- Move key decryption to utilities/verify.sh (we need API key)
- Call utilities/verity.sh from .travis.yml
  • Loading branch information
mziccard committed Oct 7, 2015
1 parent 3f9f621 commit 37ef974
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ before_install:
- git clone -b travis `git config --get remote.origin.url` target/travis
- cp target/travis/settings.xml ~/.m2/settings.xml
install: mvn install -DskipTests=true -Dgpg.skip=true
script: mvn verify
script:
- utilities/verify.sh
branches:
only:
- master
Expand Down
6 changes: 0 additions & 6 deletions utilities/after_success.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ if [ "${TRAVIS_JDK_VERSION}" == "oraclejdk7" -a "${TRAVIS_BRANCH}" == "master" -

SITE_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -Ev '(^\[|\w+:)')
if [ "${SITE_VERSION##*-}" != "SNAPSHOT" ]; then
# Get signing tools
openssl aes-256-cbc -K $encrypted_631490ecae8f_key -iv $encrypted_631490ecae8f_iv -in target/travis/signing-tools.tar.enc -out target/travis/signing-tools.tar -d
mkdir target/travis/signing-tools
chmod 700 target/travis/signing-tools
tar xvf target/travis/signing-tools.tar -C target/travis/signing-tools

# Deploy site if not a SNAPSHOT
git config --global user.name "travis-ci"
git config --global user.email "[email protected]"
Expand Down
19 changes: 19 additions & 0 deletions utilities/verify.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

# This script is used by Travis-CI to run tests.
# This script is referenced in .travis.yml.

if [ "${TRAVIS_BRANCH}" == "master" -a "${TRAVIS_PULL_REQUEST}" == "false" ]; then
# Get signing tools and API keyfile
openssl aes-256-cbc -K $encrypted_631490ecae8f_key -iv $encrypted_631490ecae8f_iv -in target/travis/signing-tools.tar.enc -out target/travis/signing-tools.tar -d
mkdir target/travis/signing-tools
chmod 700 target/travis/signing-tools
tar xvf target/travis/signing-tools.tar -C target/travis/signing-tools
# Export test env variables
export GCLOUD_TESTS_PROJECT_ID="gcloud-devel"
export GCLOUD_TESTS_KEY=$TRAVIS_BUILD_DIR/target/travis/signing-tools/gcloud-devel-travis.json
# Run verify
mvn verify
else
mvn verify -DskipITs
fi

0 comments on commit 37ef974

Please sign in to comment.