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
from abc import ABCMeta | |
import copy | |
import re | |
class Parser: | |
PATTERN = "(\d{2})::(\d{2}):(\d{2})" | |
def parse(self, time): |
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
from HTMLParser import HTMLParser | |
import sys | |
class Record: | |
def __init__(self, a, p): | |
self.a = a | |
self.p = p | |
def __str__(self): | |
return "a: " + self.a+" p:"+self.p |
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
common_credentials { | |
jenkins_service_user = [ | |
username: 'jenkins_service_user', | |
password: '{{with $secret := secret "secret/jenkins/jenkins_service_user" }}{{ $secret.Data.value }}{{end}}', | |
description :'for automated jenkins jobs' | |
] | |
slack = [ | |
username: '{{with $secret := secret "secret/slack/user" }}{{ $secret.Data.value }}{{end}}', | |
password: '{{with $secret := secret "secret/slack/pass" }}{{ $secret.Data.value }}{{end}}', |
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
common_credentials { | |
exclude{ | |
tyrion-jenkins | |
} | |
data{ | |
jenkins_service_user = [ | |
username: 'jenkins_service_user', | |
password: '{{with $secret := secret "secret/jenkins/jenkins_service_user" }}{{ $secret.Data.value }}{{end}}', | |
description :'for automated jenkins jobs' | |
] |
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
#!/usr/bin/env bash | |
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/ | |
consul-template \ | |
-consul-addr "$CONSUL_ADDR" \ | |
-vault-addr "$VAULT_ADDR" \ | |
-config "jenkins_config.hcl" \ | |
-once |
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
max_stale = "10m" | |
retry = "5s" | |
log_level = "warn" | |
vault { | |
renew_token = true | |
ssl { | |
enabled = true | |
verify = false | |
} |
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 \ |
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
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
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) | |
} |
OlderNewer