From a7cd2ff95b1dec324ce66fae6b86c8993f352041 Mon Sep 17 00:00:00 2001 From: Jamie McCarthy Date: Tue, 4 Apr 2017 11:10:52 -0400 Subject: [PATCH] Add Jenkinsfile --- Jenkinsfile | 27 +++++++++++++++++++++++++++ bin/test_run.sh | 6 +++++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..dd87dfe6 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,27 @@ +#!/usr/bin/env groovy + +properties(defaultVars.projectProperties) + +node { + checkout scm + + stage('Test') { + try { + cancelBuildsOfSameJob() + notifyBuild('STARTED', '#app-log-autotune') + ansiColor('xterm') { + withVoxOpsSSHKeyPath { + sh "./bin/test_docker_build.sh" + if (env.BRANCH_NAME == 'master') { + pushGemnasiumUpdate() + } + } + } + } catch (e) { + currentBuild.result = "FAILED" + throw e + } finally { + notifyBuild(currentBuild.result, '#app-log-autotune') + } + } +} diff --git a/bin/test_run.sh b/bin/test_run.sh index 3524917e..772effb0 100755 --- a/bin/test_run.sh +++ b/bin/test_run.sh @@ -5,8 +5,12 @@ rm -Rf Gemfile.lock .bundle bundle install --path vendor/bundle --no-deployment --no-color export RAILS_ENV=test -bundle exec rake db:reset +bundle exec rake db:reset bundle exec rake test +# TODO: should we also do these? +# npm install +# npm test + rm -f ./log/*.log rm -rf ./working