From ecd2b0255ce3559d77e9a9c66d1e3060db381ee6 Mon Sep 17 00:00:00 2001 From: Ruben Abad Date: Mon, 29 Jan 2024 14:45:53 +0100 Subject: [PATCH] using credentials to push to documentation repo --- Jenkinsfile | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3f42c127a..bb6653e2f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -170,12 +170,14 @@ pipeline checkout scmGit(branches: [[name: '*/master']], extensions: [checkoutOption(120), cloneOption(noTags:false, reference:'', shallow: false, timeout:120)], userRemoteConfigs: [[credentialsId: 'github_token_as_pwd_2', url: 'https://github.com/carla-simulator/carla-simulator.github.io.git']]) unstash name: 'carla_docs' - sh ''' - tar -xvzf carla_doc.tar.gz - git add Doxygen - git commit -m "Updated c++ docs" || true - git push - ''' + withCredentials([gitUsernamePassword(credentialsId: 'github_token_as_pwd_2', gitToolName: 'git-tool')]) { + sh ''' + tar -xvzf carla_doc.tar.gz + git add Doxygen + git commit -m "Updated c++ docs" || true + git push + ''' + } } post { @@ -203,13 +205,14 @@ pipeline { checkout scmGit(branches: [[name: '*/ruben/jenkins_migration']], extensions: [checkoutOption(120), cloneOption(noTags:false, reference:'', shallow: false, timeout:120)], userRemoteConfigs: [[credentialsId: 'github_token_as_pwd_2', url: 'https://github.com/carla-simulator/carla-simulator.github.io.git']]) unstash name: 'carla_docs' - - sh ''' - tar -xvzf carla_doc.tar.gz - git add Doxygen - git commit -m "Updated c++ docs" || true - git push - ''' + withCredentials([gitUsernamePassword(credentialsId: 'github_token_as_pwd_2', gitToolName: 'git-tool')]) { + sh ''' + tar -xvzf carla_doc.tar.gz + git add Doxygen + git commit -m "Updated c++ docs" || true + git push + ''' + } } post {