Catch the stdout of the Action.

This commit is contained in:
Manuele Simi 2021-01-31 17:13:31 -05:00
parent 0ed3f62ebc
commit 7bd5d0808a
1 changed files with 11 additions and 11 deletions

4
Jenkinsfile vendored
View File

@ -158,7 +158,7 @@ def exec(actions, repo_url, repo_name) {
withCredentials([usernamePassword(credentialsId: '88b54962-1c0e-49cb-8155-22276860f346', passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) { withCredentials([usernamePassword(credentialsId: '88b54962-1c0e-49cb-8155-22276860f346', passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) {
def complete_url = "${repo_url}.git" def complete_url = "${repo_url}.git"
def repository = complete_url.replaceFirst(".+://", "https://${GIT_USERNAME}:${GIT_PASSWORD}@") def repository = complete_url.replaceFirst(".+://", "https://${GIT_USERNAME}:${GIT_PASSWORD}@")
sh(""" output = sh(script: """
git remote set-url origin $repository git remote set-url origin $repository
git remote -v git remote -v
git config user.email "git.gcube@localhost" git config user.email "git.gcube@localhost"
@ -168,7 +168,7 @@ def exec(actions, repo_url, repo_name) {
source actions.sh source actions.sh
rm actions.sh rm actions.sh
git push --force origin HEAD:master || true git push --force origin HEAD:master || true
""") """), returnStdout: true)?.trim()
} }
} }
} }