Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Shipton2019-09-12 13:42:17 -0400
committerGitHub2019-09-12 13:42:17 -0400
commit8a9e95ca15c5eba030adec8ac53785e2f1b1950c (patch)
treeb52951aa74f020cb33630a7e3ae7c868fc88b445
parent81b05d5286f0f310d7ff8b99d4e7a7172ae8aa8c (diff)
parentd44867dd6c66f94a1a4171082c6b3a73003964d2 (diff)
downloadopenj9-8a9e95ca15c5eba030adec8ac53785e2f1b1950c.tar.gz
openj9-8a9e95ca15c5eba030adec8ac53785e2f1b1950c.tar.xz
openj9-8a9e95ca15c5eba030adec8ac53785e2f1b1950c.zip
Merge pull request #174 from AdamBrousseau/run_on_workerHEADmaster
Update Jenkins jobs to run on worker
-rw-r--r--jenkinsMirror9
-rw-r--r--jenkinsPullRequests12
2 files changed, 14 insertions, 7 deletions
diff --git a/jenkinsMirror b/jenkinsMirror
index 6295ea2..83cfa03 100644
--- a/jenkinsMirror
+++ b/jenkinsMirror
@@ -19,14 +19,15 @@
*
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
*******************************************************************************/
-
+
GITHUB_REPO = 'https://github.com/eclipse/openj9-website.git'
ECLIPSE_REPO = 'ssh://genie.openj9@git.eclipse.org:29418/www.eclipse.org/openj9.git'
BRANCH = 'master'
+SSH_CREDENTIAL_ID = 'git.eclipse.org-bot-ssh'
timeout(time: 3, unit: 'HOURS') {
timestamps {
- node('master') {
+ node('worker') {
try {
stage('Clone') {
git branch: BRANCH, url: GITHUB_REPO, poll:false, changelog: true
@@ -38,7 +39,9 @@ timeout(time: 3, unit: 'HOURS') {
currentBuild.description = "${LAST_COMMIT}"
}
stage('Push') {
- sh "git push upstream ${BRANCH}"
+ sshagent(credentials:["${SSH_CREDENTIAL_ID}"]) {
+ sh "git push upstream ${BRANCH}"
+ }
}
} catch(e) {
slackSend channel: '#jenkins', color: 'danger', message: "Failed: ${env.JOB_NAME} #${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"
diff --git a/jenkinsPullRequests b/jenkinsPullRequests
index 6973901..b20744a 100644
--- a/jenkinsPullRequests
+++ b/jenkinsPullRequests
@@ -25,10 +25,11 @@ ECLIPSE_REPO = 'ssh://genie.openj9@git.eclipse.org:29418/www.eclipse.org/openj9.
BRANCH = 'staging'
GITHUB_DIR = 'github_repo'
ECLIPSE_DIR = 'staging_repo'
+SSH_CREDENTIAL_ID = 'git.eclipse.org-bot-ssh'
timeout(time: 3, unit: 'HOURS') {
timestamps {
- node('master') {
+ node('worker') {
try {
stage('Clone') {
// Clone PullRequest into GITHUB_DIR
@@ -48,7 +49,8 @@ timeout(time: 3, unit: 'HOURS') {
extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: ECLIPSE_DIR],
[$class: 'CheckoutOption'], [$class: 'LocalBranch', localBranch: BRANCH]],
submoduleCfg: [],
- userRemoteConfigs: [[url: ECLIPSE_REPO]]]
+ userRemoteConfigs: [[credentialsId: SSH_CREDENTIAL_ID,
+ url: ECLIPSE_REPO]]]
}
stage('Stage') {
@@ -64,9 +66,11 @@ timeout(time: 3, unit: 'HOURS') {
sh "cp -r ${WORKSPACE}/${GITHUB_DIR}/* ."
sh "cp -r ${WORKSPACE}/${GITHUB_DIR}/.gitignore ."
sh 'git status'
- sh 'git add .'
+ sh 'git add .'
sh 'git commit -m "Generated from commit: ${sha1}"'
- sh "git push origin ${BRANCH}"
+ sshagent(credentials:["${SSH_CREDENTIAL_ID}"]) {
+ sh "git push origin ${BRANCH}"
+ }
sh "git diff origin/${BRANCH}..origin/master"
}
}

Back to the top