Repo root as parameter.

This commit is contained in:
Manuele Simi 2021-01-16 22:25:45 -05:00
parent e0d5dcdb0b
commit 3edd25bf20
1 changed files with 6 additions and 1 deletions

7
Jenkinsfile vendored
View File

@ -36,11 +36,15 @@ pipeline {
PIPELINE_BUILD_NUMBER = "${env.BUILD_NUMBER}" PIPELINE_BUILD_NUMBER = "${env.BUILD_NUMBER}"
ACTION_REPORT = "${agent_root_folder}/actions.${env.BUILD_NUMBER}.csv" ACTION_REPORT = "${agent_root_folder}/actions.${env.BUILD_NUMBER}.csv"
BASH_FRAGMENT="${action_code}" BASH_FRAGMENT="${action_code}"
REPO_ROOT="${repo_root}"
} }
parameters { parameters {
string(name: 'repo_root',
defaultValue: 'https://code-repo.d4science.org/gCube/',
description: 'The root URL of the repositories')
string(name: 'repo_list', string(name: 'repo_list',
defaultValue: 'default_list.txt', defaultValue: 'default_list.txt',
description: 'The file with the list of repositories to update') description: 'The file with the list of repositories to update')
@ -48,6 +52,7 @@ pipeline {
defaultValue: '', defaultValue: '',
description: 'The file with the Bash fragment to execute.') description: 'The file with the Bash fragment to execute.')
} }
stages { stages {
@ -111,7 +116,7 @@ pipeline {
* NOTE: 'credentialsId' be manually configured in Jenkins to access all the repos * NOTE: 'credentialsId' be manually configured in Jenkins to access all the repos
*/ */
def checkout_and_exec(repo_name, actions) { def checkout_and_exec(repo_name, actions) {
def repo_url = "https://code-repo.d4science.org/manuele.simi/{$repo_name}" def repo_url = "${repo_root}/{$repo_name}"
echo "Checkout SHA from reference $commit" echo "Checkout SHA from reference $commit"
sh(script: "rm -r ${repo_name} || true", returnStdout: true)?.trim() sh(script: "rm -r ${repo_name} || true", returnStdout: true)?.trim()
checkout([ checkout([