Back to read the action from the env variable.

This commit is contained in:
Manuele Simi 2021-01-23 22:13:19 -05:00
parent feb3ed64bd
commit 2c7a0b1c8b
1 changed files with 5 additions and 5 deletions

10
Jenkinsfile vendored
View File

@ -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
""")
}