This file contains 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
{"lastUpload":"2019-03-10T11:37:10.363Z","extensionVersion":"v3.2.4"} |
This file contains 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
{"lastUpload":"2018-12-08T16:36:24.380Z","extensionVersion":"v3.2.2"} |
This file contains 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
{"lastUpload":"2018-11-30T23:29:17.742Z","extensionVersion":"v3.2.2"} |
This file contains 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
{"lastUpload":"2018-11-27T21:36:22.110Z","extensionVersion":"v3.2.2"} |
This file contains 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 hudson.model.* | |
import jenkins.model.* | |
import com.cloudbees.plugins.credentials.CredentialsScope | |
import com.cloudbees.plugins.credentials.domains.Domain | |
import com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl | |
def domain = Domain.global() | |
def store = Jenkins.instance.getExtensionList('com.cloudbees.plugins.credentials.SystemCredentialsProvider')[0].getStore() | |
def instance = System.getenv("JENKINS_INSTANCE_NAME").replaceAll('-','_') |
This file contains 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
scriptApproval{ | |
approvedSignatures=[ | |
'method groovy.util.ConfigSlurper parse java.lang.String', | |
'staticMethod java.lang.System getenv', | |
'method org.jenkinsci.plugins.scriptsecurity.scripts.ScriptApproval approveSignature java.lang.String', | |
'staticMethod org.jenkinsci.plugins.scriptsecurity.scripts.ScriptApproval get' | |
] | |
} |
This file contains 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 org.jenkinsci.plugins.scriptsecurity.scripts.* | |
ScriptApproval script = ScriptApproval.get() | |
ConfigObject conf = new ConfigSlurper().parse(new File(System.getenv("JENKINS_HOME") + '/jenkins_config/scriptApproval.txt').text) | |
conf.scriptApproval.approvedSignatures.each{ approvedSignature -> | |
println("checking for new signature ${approvedSignature}") | |
def found = script.approvedSignatures.find { it == approvedSignature } | |
if (!found){ | |
println("Approving signature ${approvedSignature}") | |
script.approveSignature(approvedSignature) | |
} |
This file contains 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 hudson.model.* | |
import jenkins.model.* | |
import org.csanchez.jenkins.plugins.kubernetes.* | |
import org.csanchez.jenkins.plugins.kubernetes.volumes.workspace.EmptyDirWorkspaceVolume | |
import org.csanchez.jenkins.plugins.kubernetes.volumes.HostPathVolume | |
//since kubernetes-1.0 | |
//import org.csanchez.jenkins.plugins.kubernetes.model.KeyValueEnvVar | |
import org.csanchez.jenkins.plugins.kubernetes.PodEnvVar | |
//change after testing | |
ConfigObject conf = new ConfigSlurper().parse(new File(System.getenv("JENKINS_HOME") + '/jenkins_config/kubernetes.txt').text) |
This file contains 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
kubernetes { | |
name = 'Kubernetes' | |
serverUrl = 'https://kingslanding.westeros.co.uk' | |
skipTlsVerify = true | |
namespace = 'kingslanding' | |
jenkinsUrl = 'http://kingslanding-dev-jenkins.kingslanding.svc.cluster.local' | |
credentialsId = 'VALYRIAN_STEEL_SECRET' | |
containerCapStr = '500' | |
retentionTimeout = 5 | |
connectTimeout = 0 |
This file contains 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
node { | |
stage('checkout') { | |
sh ''' | |
git clone ssh://git@your_scm_here/jenkins_config_as_code.git ${JENKINS_HOME}/jenkins_config | |
mv ${JENKINS_HOME}/jenkins_config/*.groovy ${JENKINS_HOME}/init.groovy.d/ | |
''' | |
} | |
stage('run consul template'){ | |
sh ''' | |
consul-template \ |
NewerOlder