Fix git refspec and FORCE_TEST flag
@@ -23,29 +23,51 @@ properties([buildDiscarder(logRotator(artifactDaysToKeepStr: '90',
[$class: 'JobRestrictionProperty']])
stage("Compare changes") {
+ if ( ! params.FORCE_TEST ) {
node(globalvars.AGENTS_LABELS["nonsgx"]) {
cleanWs()
checkout([
$class: 'GitSCM',
- branches: scm.branches + [[name: '*/master']],
+ branches: [
+ [
+ name: "origin/master"
+ ],
+ [
+ name: "testremote/${BRANCH_NAME}"
+ ]
+ ],
doGenerateSubmoduleConfigurations: false,
- extensions: [[$class: 'SubmoduleOption',
+ extensions: [
+ [
+ $class: 'SubmoduleOption',
disableSubmodules: true,
recursiveSubmodules: false,
- trackingSubmodules: false]],
+ trackingSubmodules: false
+ ]
+ ],
submoduleCfg: [],
- userRemoteConfigs: scm.userRemoteConfigs
+ userRemoteConfigs: [
+ [
+ url: "https://github.com/openenclave/openenclave.git",
+ name: "origin",
+ refspec: "+refs/heads/master:refs/remotes/origin/master",
+
+ ],
+ [
+ url: "https://github.com/${REPOSITORY_NAME}.git",
+ name: "testremote",
+ refspec: "+refs/heads/${BRANCH_NAME}:refs/remotes/testremote/${BRANCH_NAME}"
+ ]
+ ]
])
// Check if git diff vs origin/master contains changes outside of ignored directories
gitChanges = sh (
script: """
- git diff --name-only HEAD origin/master | grep --invert-match --extended-regexp \'${IGNORED_DIRS}\' || true
+ git diff --name-only testremote/${BRANCH_NAME} origin/master | grep --invert-match --extended-regexp \'${IGNORED_DIRS}\' --no-messages
""",
- returnStdout: true
+ returnStdout: true,
).trim()
}
-}
-
// Skip build with a success if gitChanges is defined and empty (no changes outside of ignored directories).
if (gitChanges != null && gitChanges == '') {
currentBuild.result = 'SUCCESS'
@@ -53,6 +75,8 @@ if (gitChanges != null && gitChanges == '') {
} else {
println("Detected the follow file changes: " + gitChanges)
}
+ }
+}
try {
common.emailJobStatus('STARTED')
