Skip to content

Instantly share code, notes, and snippets.

View cccaternberg's full-sized avatar

Andreas Caternberg cccaternberg

View GitHub Profile
@cccaternberg
cccaternberg / test
Last active March 25, 2024 14:26
test
2024-03-25,10:53:31
2024-03-25,10:53:32
@cccaternberg
cccaternberg / hudson.model.DirectoryBrowserSupport.CSP
Last active March 4, 2022 08:39
hudson.model.DirectoryBrowserSupport.CSP
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
@cccaternberg
cccaternberg / Prtintcreds
Created August 26, 2019 08:38
Groovy-printallcredentials
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 ->
@cccaternberg
cccaternberg / Prtintcreds
Created August 26, 2019 08:38
Groovy-printallcredentials
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 ->
#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.
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
######################
# Create The Cluster #
######################
az login
az provider register -n Microsoft.Network
az provider register -n Microsoft.Storage
@cccaternberg
cccaternberg / DSLBitbucket.groovy
Created October 22, 2018 12:29
Bitbucket from Groovy
#!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
*/
@cccaternberg
cccaternberg / nexus_upload.sh
Created October 11, 2018 12:09 — forked from jbaranski/nexus_upload.sh
Artifact upload to nexus using curl
# 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
#create the cluster
##These include Jenkins a 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.
#jx create cluster gke --cluster-name='jx-acaternberg' --labels='created-by-acaternberg'
#jx create cluster gke --skip-login --default-admin-password=mySecretPassWord123 -n jx-acaternberg
jx create cluster gke
#create a spring-boot application