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 characters
import jenkins.model.Jenkins | |
import com.cloudbees.hudson.plugins.folder.Folder | |
import hudson.triggers.TimerTrigger | |
def listAllJobs(folder, indent = "") { | |
folder.getItems().each { item -> | |
if (item instanceof Folder) { | |
// Print folder name and recurse into subfolder | |
println "${indent}Folder: ${item.fullName}" | |
listAllJobs(item, indent + " ") | |
} else { |
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 characters
2024-03-25,10:53:31 | |
2024-03-25,10:53:32 |
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 characters
cd $JENKINS_HOME | |
mkdir -p init.groovy.d/ | |
#see https://www.jenkins.io/doc/book/managing/groovy-hook-scripts/ | |
#open file with vi | |
vi init.groovy.d//init.groovy | |
#add the follwing and save | |
#init.groovy |
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 characters
import com.cloudbees.plugins.credentials.CredentialsProvider | |
import com.cloudbees.plugins.credentials.Credentials | |
import com.cloudbees.plugins.credentials.domains.Domain | |
import jenkins.model.Jenkins | |
def indent = { String text, int indentationCount -> | |
def replacement = "\t" * indentationCount | |
text.replaceAll("(?m)^", replacement) | |
} | |
Jenkins.get().allItems().collectMany{ CredentialsProvider.lookupStores(it).toList()}.unique().forEach { store -> |
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 characters
import com.cloudbees.plugins.credentials.CredentialsProvider | |
import com.cloudbees.plugins.credentials.Credentials | |
import com.cloudbees.plugins.credentials.domains.Domain | |
import jenkins.model.Jenkins | |
def indent = { String text, int indentationCount -> | |
def replacement = "\t" * indentationCount | |
text.replaceAll("(?m)^", replacement) | |
} | |
Jenkins.get().allItems().collectMany{ CredentialsProvider.lookupStores(it).toList()}.unique().forEach { store -> |
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 characters
#create the cluster | |
jx create cluster eks -n $CLUSTER_NAME \ | |
--default-admin-password admin123! | |
These include # | |
-> Jenkins as CI/CD pipeline solution | |
-> Nexus - an artifact repository | |
-> Chartmuseum - a Helm Chart repository | |
-> Monocular which provides a Web UI for searching and discovering charts deployed into your cluster via Jenkins X. |
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 characters
see https://jfrog.com/knowledge-base/how-to-configure-artifactory-as-an-internal-jenkins-update-site/ | |
* Create a remote repo named Jenkins-update | |
* Create a local repo named jenkins-update-center | |
* Get the update-center.json from repo Jenkins-update to local and modify the URL from 'http://updates.jenkins-ci.org/' to my own URL 'https://artifacts.xxx.com/artifactory/Jenkins-update/' in update-center.json, then put update-center.json into local repo. | |
``` | |
#!/bin/sh | |
curl -L -o /tmp/update-center.json http://localhost:8081/artifactory/Jenkins-update-cache/update-center.json | |
sed -i 's#http://updates.jenkins-ci.org/#https://artifacts.xxx.com/artifactory/Jenkins-update/#g' /tmp/update-center.json |
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 characters
###################### | |
# Create The Cluster # | |
###################### | |
az login | |
az provider register -n Microsoft.Network | |
az provider register -n Microsoft.Storage |
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 characters
#!groovy | |
/** | |
API Base URL - by default it’s https://bitbucket.org/api | |
API Version - 1.0 or 2.0 | |
API Endpoint Path - includes the following | |
“repositories” - since we want to use one of the repositories API | |
Organization Name - aka team or account name | |
Repository Name - repository slug | |
Repositories API Endpoint - branches since we want to get list of branches | |
*/ |
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 characters
# nexus 2.x | |
# Assuming you run this command against the directory the jar sits in | |
# | |
# r - repository | |
# hasPom - whether you are supplying the pom or you want one generated. If generated g, a, v, p, and c are not needed | |
# e - extension | |
# g - group id | |
# a - artifact id | |
# v - version | |
# p - packaging |
NewerOlder