Last active
June 7, 2021 14:24
-
-
Save imranity/dec6a655ba671fa5b3c3 to your computer and use it in GitHub Desktop.
Revisions
-
imranity revised this gist
Apr 21, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ This is pretty simple snippet to get API Token of a user , lets say "MYUser" in its pretty useful when you are working with 'jenkins-job-builder' to update jobs in jenkins, and you need to get the api token which JJB needs inorder to update jobs to .. run this code in either jenkins script console , or as i prefer, in form of init.groovy. so when jenkins master starts, i create a user for JJb. after that i get the token right away and pass it to my JJB jobs folder to file 'jenkins_jobs.ini' :)_ . ```groovy -
imranity renamed this gist
Mar 19, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
imranity revised this gist
Mar 19, 2015 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,8 @@ run this code in either jenkins script console , or as i prefer, in form of init so when jenkins amster starts, i create a user for JJb. after that i get the token right away and pass it to my JJB jobs folder to file 'jenkins_jobs.ini' :)_ . ```groovy /////////////////////////////////////////////////////////////////////// import jenkins.security.* //j.jenkins.setSecurityRealm(j.createDummySecurityRealm()); @@ -15,4 +16,5 @@ def token = t.getApiToken() //token.getClass() println "token is $token " //////////////////////////////////////////////////////////////////////// ``` -
imranity revised this gist
Mar 19, 2015 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,6 +5,7 @@ run this code in either jenkins script console , or as i prefer, in form of init so when jenkins amster starts, i create a user for JJb. after that i get the token right away and pass it to my JJB jobs folder to file 'jenkins_jobs.ini' :)_ . ``` /////////////////////////////////////////////////////////////////////// import jenkins.security.* //j.jenkins.setSecurityRealm(j.createDummySecurityRealm()); @@ -13,4 +14,5 @@ ApiTokenProperty t = u.getProperty(ApiTokenProperty.class) def token = t.getApiToken() //token.getClass() println "token is $token " //////////////////////////////////////////////////////////////////////// ``` -
imranity revised this gist
Mar 19, 2015 . 1 changed file with 7 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,10 @@ This is pretty simple snippet to get API Token of a user , lets say "MYUser" in jenkins. its pretty useful when you are working with 'jenkins-job-builder' to update jobs in jenkins, and you need to get the api token which JJB needs inorder to update jobs to .. run this code in either jenkins script console , or as i prefer, in form of init.groovy. so when jenkins amster starts, i create a user for JJb. after that i get the token right away and pass it to my JJB jobs folder to file 'jenkins_jobs.ini' :)_ . /////////////////////////////////////////////////////////////////////// import jenkins.security.* //j.jenkins.setSecurityRealm(j.createDummySecurityRealm()); -
imranity created this gist
Mar 19, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ This is pretty simple snippet to get API Token of a user , lets say "MYUser" in jenkins , its pretty useful when you are working with 'jenkins-job-builder' to update jobs in jenkins, and you need to get the api token which JJB needs inorder to update jobs to .. run this code in either jenkins script console , or as i prefer, in form of init.groovy , so when jenkins amster starts, i create a user for JJb, after that i get the token right away and pass it to my JJB jobs folder to file 'jenkins_jobs.ini' :)_ /////////////////////////////////////////////////////////////////////// import jenkins.security.* //j.jenkins.setSecurityRealm(j.createDummySecurityRealm()); User u = User.get("Myuser") ApiTokenProperty t = u.getProperty(ApiTokenProperty.class) def token = t.getApiToken() //token.getClass() println "token is $token " ////////////////////////////////////////////////////////////////////////