From 2c7a0b1c8bf5ead72d33446b966a829af751ebf2 Mon Sep 17 00:00:00 2001 From: Manuele Simi Date: Sat, 23 Jan 2021 22:13:19 -0500 Subject: [PATCH] Back to read the action from the env variable. --- Jenkinsfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 983a541..fa3984e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,9 +15,6 @@ println "Querying ${actionURL}" //save the action code def action_code = actionURL.toURL().getText() println "Action code: ${action_code}" -def actionFile = new File("${agent_root_folder}/actions.${env.BUILD_NUMBER}.sh") -actionFile.createNewFile() -actionFile << "${action_code}" //TODO: get the list of repos from Jenkins? //locate the repos file @@ -39,7 +36,7 @@ pipeline { AGENT_ROOT_FOLDER = "${agent_root_folder}" PIPELINE_BUILD_NUMBER = "${env.BUILD_NUMBER}" ACTION_REPORT = "${agent_root_folder}/actions.${env.BUILD_NUMBER}.csv" - ACTION_FILE="${agent_root_folder}/actions.${env.BUILD_NUMBER}.sh" + BASH_FRAGMENT="${action_code}" REPO_ROOT="${repo_root}" } @@ -165,7 +162,10 @@ def exec(actions, repo_url, repo_name) { git remote -v git config user.email "git.gcube@localhost" git config user.name "git.gcube" - source $ACTION_FILE + echo "${BASH_FRAGMENT}" > actions.sh + chmod a+x actions.sh + source actions.sh + rm actions.sh git push --force origin """) }