From cb0659f98df5553023bd2d50decb787d924cfb34 Mon Sep 17 00:00:00 2001 From: spalger Date: Thu, 30 Jun 2016 12:50:56 -0700 Subject: [PATCH 1/2] [ci] move ci setup tasks into source control Until now, the ci setup tasks were stored in the Jenkins job configuration. This moves the setup into source control so that jenkins can be told to execute `./test/scripts/jenkins_{JOB_TYPE}.sh` no matter what branch of kibana it is dealing with. --- test/scripts/jenkins_setup.sh | 33 +++++++++++++++++++++++++++++++++ test/scripts/jenkins_unit.sh | 7 +++++++ 2 files changed, 40 insertions(+) create mode 100755 test/scripts/jenkins_setup.sh create mode 100755 test/scripts/jenkins_unit.sh diff --git a/test/scripts/jenkins_setup.sh b/test/scripts/jenkins_setup.sh new file mode 100755 index 0000000000000..b450f22c43886 --- /dev/null +++ b/test/scripts/jenkins_setup.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +set -e + +###*****### +### CWD ### +###*****### +if [ -n "$WORKSPACE" ]; then + cd "$WORKSPACE" +else + echo 'Unable to find the $WORKSPACE environment variable, is this jenkins?' + exit 1 +fi + + +###*****### +### NVM ### +###*****### +export NVM_DIR="/var/lib/jenkins/.nvm" +NVM_SCRIPT="$NVM_DIR/nvm.sh" +if [ -s "$NVM_SCRIPT" ]; then + . "$NVM_SCRIPT" # load nvm +else + echo "Unable to find the nvm script at \"$NVM_SCRIPT\"" + exit 1 +fi + +nvm install "$(cat .node-version)" + +###*****### +### NPM ### +###*****### +npm install diff --git a/test/scripts/jenkins_unit.sh b/test/scripts/jenkins_unit.sh new file mode 100755 index 0000000000000..790771f8de032 --- /dev/null +++ b/test/scripts/jenkins_unit.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -e + +"$(dirname $0)/jenkins_setup.sh" + +"$(npm bin)/grunt" jenkins; From 995c4084107b65f56869eea27d94e52c9cb31ed9 Mon Sep 17 00:00:00 2001 From: spalger Date: Thu, 30 Jun 2016 15:41:47 -0700 Subject: [PATCH 2/2] [ci] add script for snapshot build job --- test/scripts/jenkins_build_snapshot.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 test/scripts/jenkins_build_snapshot.sh diff --git a/test/scripts/jenkins_build_snapshot.sh b/test/scripts/jenkins_build_snapshot.sh new file mode 100755 index 0000000000000..06adfe46a8e53 --- /dev/null +++ b/test/scripts/jenkins_build_snapshot.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -e + +"$(dirname $0)/jenkins_setup.sh" + +"$(npm bin)/grunt" build;