diff --git a/buildenv/jenkins/JenkinsfileBase b/buildenv/jenkins/JenkinsfileBase index 35bc2ff270..a330c2b7e4 100644 --- a/buildenv/jenkins/JenkinsfileBase +++ b/buildenv/jenkins/JenkinsfileBase @@ -141,6 +141,15 @@ def setupEnv() { } else { sh 'printenv' } + if ( params.USE_GIT_SSH ) { + def gitGlobalConfig = fileExists('~/.gitconfig') ? sh(script:"git config --global -l", returnStdout:true) : '' + if (!gitGlobalConfig || !gitGlobalConfig.contains('url.git@github.com:.insteadof')) { + sh "git config --global url.'git@github.com:'.insteadOf 'https://github.com/'" + } + if (!gitGlobalConfig.contains('url.git@gitlab.com:.insteadof')) { + sh "git config --global url.'git@gitlab.com:'.insteadOf 'https://gitlab.com/'" + } + } } def setupParallelEnv() { @@ -805,6 +814,15 @@ def testBuild() { sh "find /tmp -name '*core*' -print 2>/dev/null -exec rm -f {} \\; || true" } } + if ( params.USE_GIT_SSH ) { + def gitGlobalConfig = sh(script:"git config --global -l", returnStdout:true) + if (gitGlobalConfig.contains('url.git@github.com:.insteadof')) { + sh "git config --global --unset url.'git@github.com:'.insteadOf" + } + if (gitGlobalConfig.contains('url.git@gitlab.com:.insteadof')) { + sh "git config --global --unset url.'git@gitlab.com:'.insteadOf" + } + } } } } diff --git a/buildenv/jenkins/testJobTemplate b/buildenv/jenkins/testJobTemplate index 22e61cd057..c586ff934f 100644 --- a/buildenv/jenkins/testJobTemplate +++ b/buildenv/jenkins/testJobTemplate @@ -62,6 +62,7 @@ if (!binding.hasVariable('USER_CREDENTIALS_ID')) USER_CREDENTIALS_ID = "" if (!binding.hasVariable('GENERATE_JOBS')) GENERATE_JOBS = false if (!binding.hasVariable('CLOUD_PROVIDER')) CLOUD_PROVIDER = "" if (!binding.hasVariable('RERUN_ITERATIONS')) RERUN_ITERATIONS = "0" +if (!binding.hasVariable('USE_GIT_SSH')) USE_GIT_SSH = false if (!binding.hasVariable('BUILDS_TO_KEEP')) { BUILDS_TO_KEEP = 10 @@ -372,7 +373,7 @@ ARCH_OS_LIST.each { ARCH_OS -> sectionHeader('Additional test parameters if you want to append or replace options, or repeat the test for more than 1 iteration.') sectionHeaderStyle(sectionHeaderHelpTextStyleCss) } - choiceParam('TEST_FLAG', ['', 'JITAAS', 'AOT', 'FIPS'], "Optional. Only set for feature testing. (i.e., JITAAS, AOT, FIPS, etc)") + choiceParam('TEST_FLAG', ['', 'JITAAS', 'AOT', 'FIPS', 'Dragonwell_Standard'], "Optional. Only set for feature testing. (i.e., JITAAS, AOT, FIPS, etc)") stringParam('EXTRA_OPTIONS', "", "Use this to append options to the test command") stringParam('JVM_OPTIONS', "", "Use this to replace the test original command line options") stringParam('APPLICATION_OPTIONS', "", "Use this to append options to the test application") @@ -437,6 +438,7 @@ ARCH_OS_LIST.each { ARCH_OS -> stringParam('SLACK_CHANNEL', SLACK_CHANNEL, "Slack channel. e.g., #rt-jenkins") booleanParam('PERSONAL_BUILD', false, "Is this a personal build?") booleanParam('USE_TESTENV_PROPERTIES', USE_TESTENV_PROPERTIES.toBoolean(), "use properties defined in the testenv.properties") + booleanParam('USE_GIT_SSH', USE_GIT_SSH.toBoolean(), "Use ssh protocol? True, if clone all repo by ssh.") stringParam('RERUN_ITERATIONS', RERUN_ITERATIONS, "Optional. Number of times to repeat execution of failed test target(s).") } cpsScm {