You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by ju...@apache.org on 2018/10/08 21:19:32 UTC

[jspwiki-site] branch jbake updated: inject credentials into git push

This is an automated email from the ASF dual-hosted git repository.

juanpablo pushed a commit to branch jbake
in repository https://gitbox.apache.org/repos/asf/jspwiki-site.git


The following commit(s) were added to refs/heads/jbake by this push:
     new c175fe0  inject credentials into git push
c175fe0 is described below

commit c175fe04511da93986eaa99175e580d580b235ce
Author: Juan Pablo Santos Rodríguez <ju...@gmail.com>
AuthorDate: Mon Oct 8 23:18:58 2018 +0200

    inject credentials into git push
---
 Jenkinsfile | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 98fbd76..b093073 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -18,7 +18,7 @@
  */
 
 try {
-    def repo = 'https://gitbox.apache.org/repos/asf/jspwiki-site.git'
+    def repo = 'gitbox.apache.org/repos/asf/jspwiki-site.git'
     def creds = '9b041bd0-aea9-4498-a576-9eeb771411dd'
     def asfsite = 'asf-site'
     def jbake = 'jbake'
@@ -33,10 +33,10 @@ try {
         stage( "clone $jbake and $asfsite branches" ) {
 		    cleanWs()
             dir( jbake ) {
-                git branch: jbake, url: repo, credentialsId: creds
+                git branch: jbake, url: "https://$repo", credentialsId: creds
             }
             dir( asfsite ) {
-                git branch: asfsite, url: repo, credentialsId: creds
+                git branch: asfsite, url: "https://$repo", credentialsId: creds
             }
         }
 
@@ -61,9 +61,11 @@ try {
         stage( 'publish site' ) {
             dir( asfsite ) {
                 sh "cp -rf ../$jbake/target/content/* ./"
-                sh 'git add .'
-                sh 'git commit -m "Automatic Site Publish by Buildbot"'
-                sh 'git push origin asf-site'
+				withCredentials( [ usernamePassword( credentialsId: creds, passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME' ) ] ) {
+                    sh 'git add .'
+                    sh 'git commit -m "Automatic Site Publish by Buildbot"'
+                    sh "git push https://${GIT_USERNAME}:${GIT_PASSWORD}@$repo asf-site"
+				}
             }
         }
     }