From ff704694d4208a1d1934a3d698579ae14113af05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BCdiger=20Herrmann?= Date: Sat, 10 Dec 2016 17:39:54 +0100 Subject: [PATCH] Set up Travis-CI build See #52 Move CI build to Travis --- .gitignore | 1 + .travis-deploy.sh | 43 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 49 ++++++++++++++++++++++++++++++++++++++++++++++ deploy-key.enc | Bin 0 -> 3264 bytes deploy-key.pub | 1 + 5 files changed, 94 insertions(+) create mode 100644 .travis-deploy.sh create mode 100644 .travis.yml create mode 100644 deploy-key.enc create mode 100644 deploy-key.pub diff --git a/.gitignore b/.gitignore index 58eba01d..231b06a2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ bin/ target/ +deploy-key Thumbs.db .DS_Store hs_err_pid*.log diff --git a/.travis-deploy.sh b/.travis-deploy.sh new file mode 100644 index 00000000..7770b7b0 --- /dev/null +++ b/.travis-deploy.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +function error_exit +{ + echo -e "\e[01;31m$1\e[00m" 1>&2 + exit 1 +} + +if [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then + echo -e "Starting to deploy to gh-pages...\n" + + # create and cd into temporary deployment work directory + mkdir deployment-work + cd deployment-work + + # setup ssh agent + ENCRYPTED_KEY="encrypted_${ENCRYPTION_LABEL}_key" + ENCRYPTED_IV="encrypted_${ENCRYPTION_LABEL}_iv" + openssl aes-256-cbc -K ${!ENCRYPTED_KEY} -iv ${!ENCRYPTED_IV} -in deploy-key.enc -out deploy-key -d + chmod 600 deploy-key + eval `ssh-agent -s` + ssh-add deploy-key + + # setup git and clone from gh-pages branch + git config --global user.email "travis-deployer@codeaffine.com" + git config --global user.name "Travis Deployer" + git clone --quiet --branch=gh-pages git@github.com:${TRAVIS_REPO_SLUG}.git . > /dev/null 2>&1 || error_exit "Error cloning gh-pages" + + # clean the repository directory, then copy the build result into it + git rm -rf repository + mkdir -p repository + cp -rf ../com.codeaffine.extras.repository/target/repository/* ./repository + + # add, commit and push files + git add -f repository + git commit -m "[ci skip] Deploy Travis build #${TRAVIS_BUILD_NUMBER} to gh-pages" + git push -fq origin gh-pages > /dev/null 2>&1 || error_exit "Error uploading the build result to gh-pages" + + # go back to the directory where we started + cd .. + + echo -e "Done with deployment to gh-pages\n" +fi \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..ba7ee13f --- /dev/null +++ b/.travis.yml @@ -0,0 +1,49 @@ +env: + global: + - ENCRYPTION_LABEL: "8c7035aad7a2" + +install: true + +sudo: false + +language: java + +jdk: + - oraclejdk8 + +branches: + only: + - master + +addons: + apt: + packages: + - gnome-themes-standard + - metacity + - libwebkit-dev + +script: + - mvn -q -f clean verify -Dtarget-platform-classifier=eclipse-4.5 + - mvn -q -f clean verify -Dtarget-platform-classifier=eclipse-4.6 + - mvn -q -f clean verify -Dtarget-platform-classifier=eclipse-4.7 + +before_install: + - openssl aes-256-cbc -K $encrypted_8c7035aad7a2_key -iv $encrypted_8c7035aad7a2_iv -in deploy-key.enc -out deploy-key -d + +before_script: + - export DISPLAY=:99.0 + - sh -e /etc/init.d/xvfb start + - sleep 5 + - metacity --sm-disable --replace & + - sleep 5 + +after_success: + - chmod a+x .travis-deploy.sh + - "./.travis-deploy.sh" + +after_failure: + - cat com.codeaffine.extras.ide.test/target/surefire-reports/*.txt + - cat com.codeaffine.extras.imageviewer.test/target/surefire-reports/*.txt + - cat com.codeaffine.extras.jdt.test/target/surefire-reports/*.txt + - cat com.codeaffine.extras.launch.test/target/surefire-reports/*.txt + - cat com.codeaffine.extras.workingset.test/target/surefire-reports/*.txt diff --git a/deploy-key.enc b/deploy-key.enc new file mode 100644 index 0000000000000000000000000000000000000000..ead71332207678676c4eef4524d38e85553e5520 GIT binary patch literal 3264 zcmV;x3_tTL&_5(69a1V6p%dCYZ10%v+=9%)xlZabz0`5f330JI?Z9}(?Yq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