Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

Commit

Permalink
maven repo
Browse files Browse the repository at this point in the history
  • Loading branch information
tfennelly committed Sep 23, 2016
1 parent 883f1a1 commit 031cc20
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
9 changes: 5 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,23 @@ node {
// Expose the port on which the ATH Jenkins instance runs (12345), allowing the
// Firefox browser (running in the selenium container) to make requests back
// in etc.
athImg.inside("--expose=12345") {
athImg.inside("--expose=12345 -v m2repo:/bouser/.m2repo") {
withEnv(['GIT_COMMITTER_EMAIL=me@hatescake.com', 'GIT_COMMITTER_NAME=Hates', 'GIT_AUTHOR_NAME=Cake', 'GIT_AUTHOR_EMAIL=hates@cake.com']) {
try {
writeFile file: 'settings.xml', text: "<settings><localRepository>/bouser/.m2repo</localRepository></settings>"
// Build blueocean and the ATH
stage 'build'
dir('blueocean-plugin') {
git url: 'https://github.com/jenkinsci/blueocean-plugin.git'
// Need test-compile because the rest-impl has a test-jar that we
// need to make sure gets compiled and installed for other modules.
sh "cd blueocean-plugin && mvn clean test-compile install -DskipTests"
sh "cd blueocean-plugin && mvn -s ../settings.xml clean test-compile install -DskipTests"
}
sh "mvn clean install -DskipTests"
sh "mvn -s settings.xml clean install -DskipTests"

// Run the ATH
stage 'run'
sh "./run.sh -a=./blueocean-plugin/blueocean/ --host=\"${hostip}\" --port=12345"
sh "./run.sh -a=./blueocean-plugin/blueocean/ --host=\"${hostip}\" --port=12345 --settings settings.xml "
} catch (err) {
currentBuild.result = "FAILURE"
} finally {
Expand Down
9 changes: 8 additions & 1 deletion run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
JENKINS_VERSION=2.7.3
SELENIUM_VERSION=2.53

MAVEN_SETTINGS=""
LOCAL_SNAPSHOTS=false
RUN_SELENIUM=false
ATH_SERVER_HOST=""
Expand All @@ -48,6 +49,9 @@ case $i in
-s|--snaps|--snapshots)
LOCAL_SNAPSHOTS=true
;;
--settings=*)
MAVEN_SETTINGS="${i#*=}"
;;
-h=*|--host=*)
ATH_SERVER_HOST="${i#*=}"
;;
Expand Down Expand Up @@ -154,14 +158,17 @@ if [ "${AGGREGATOR_DIR}" != "" ]; then
AGGREGATOR_ENV="PLUGINS_DIR=${AGGREGATOR_DIR}/target/plugins"
fi

if [ "${MAVEN_SETTINGS}" != "" ]; then
MAVEN_SETTINGS="-s ${MAVEN_SETTINGS}"
fi
if [ "${ATH_SERVER_HOST}" != "" ]; then
ATH_SERVER_HOST="blueoceanHost=${ATH_SERVER_HOST}"
fi
if [ "${ATH_SERVER_PORT}" != "" ]; then
ATH_SERVER_PORT="httpPort=${ATH_SERVER_PORT}"
fi

EXECUTION="env JENKINS_JAVA_OPTS=\"${JENKINS_JAVA_OPTS}\" ${ATH_SERVER_HOST} ${ATH_SERVER_PORT} BROWSER=phantomjs LOCAL_SNAPSHOTS=${LOCAL_SNAPSHOTS} ${PLUGINS} ${AGGREGATOR_ENV} PATH=./node:./node/npm/bin:./node_modules/.bin:${PATH} JENKINS_WAR=./bin/jenkins-${JENKINS_VERSION}.war mvn test ${PROFILES} ${TEST_TO_RUN}"
EXECUTION="env JENKINS_JAVA_OPTS=\"${JENKINS_JAVA_OPTS}\" ${ATH_SERVER_HOST} ${ATH_SERVER_PORT} BROWSER=phantomjs LOCAL_SNAPSHOTS=${LOCAL_SNAPSHOTS} ${PLUGINS} ${AGGREGATOR_ENV} PATH=./node:./node/npm/bin:./node_modules/.bin:${PATH} JENKINS_WAR=./bin/jenkins-${JENKINS_VERSION}.war mvn ${MAVEN_SETTINGS} test ${PROFILES} ${TEST_TO_RUN}"

echo ""
echo "> ${EXECUTION}"
Expand Down

0 comments on commit 031cc20

Please sign in to comment.