stage 'promotion'
def userInput = input(
id: 'userInput', message: 'Let\'s promote?', parameters: [
[$class: 'TextParameterDefinition', defaultValue: 'uat', description: 'Environment', name: 'env'],
[$class: 'TextParameterDefinition', defaultValue: 'uat1', description: 'Target', name: 'target']
])
echo ("Env: "+userInput['env'])
echo ("Target: "+userInput['target'])
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 | |
| import groovy.json.JsonOutput | |
| import groovy.json.JsonSlurper | |
| /* | |
| Please make sure to add the following environment variables: | |
| HEROKU_PREVIEW=<your heroku preview app> | |
| HEROKU_PREPRODUCTION=<your heroku pre-production app> | |
| HEROKU_PRODUCTION=<your heroku production app> |
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
| #!/usr/bin/env groovy | |
| // https://github.com/freebsd/freebsd-ci/blob/master/scripts/build/build-test.groovy | |
| // http://stackoverflow.com/a/40294220 | |
| // https://JENKINS_HOST/scriptApproval/ - for script approval | |
| import java.util.Date | |
| def isMaster = env.BRANCH_NAME == 'master' | |
| def isDevelop = env.BRANCH_NAME == 'develop' |
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
| node { | |
| stage('Jira-Create-Task') { | |
| withEnv(['JIRA_SITE=local']) { | |
| def testIssue = [fields: [ project: [key: 'AUG2'], | |
| summary: 'New JIRA Created from Jenkins.', | |
| description: 'New JIRA Created from Jenkins.', | |
| issuetype: [name: 'Task']]] |
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
| podTemplate(label: 'mypod', containers: [ | |
| containerTemplate(name: 'docker', image: 'docker', ttyEnabled: true, command: 'cat'), | |
| containerTemplate(name: 'kubectl', image: 'lachlanevenson/k8s-kubectl:v1.8.0', command: 'cat', ttyEnabled: true), | |
| containerTemplate(name: 'helm', image: 'lachlanevenson/k8s-helm:latest', command: 'cat', ttyEnabled: true) | |
| ], | |
| volumes: [ | |
| hostPathVolume(mountPath: '/var/run/docker.sock', hostPath: '/var/run/docker.sock'), | |
| ]) { | |
| node('mypod') { |
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
| #!/bin/bash | |
| sslFingerprint=$(echo \ | |
| | openssl s_client -showcerts -connect $some_jenkins_server_fqdn_name:443 2> /dev/null \ | |
| | openssl x509 -noout -sha256 -fingerprint | awk -F'=' '{print $NF}') | |
| # Note that you can strip the colons for a shorter fingerprint: | |
| echo $sslFingerprint | tr -d ':' | |
| # But you do not need to strip them. |
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
| #!/bin/bash | |
| # Encrypts and decrypts short strings with the user's default SSH key pair. | |
| # USAGE: | |
| # encrypt file: cat some_short_file.txt | encrypt_str | |
| # encrypt variable: echo "$some_variable" | encrypt_str | |
| # decrypt file: cat something.encrypted | decrypt_str | |
| # decrypt variable: echo "$string" | decrypt_str | |
| # |
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
| #!/bin/bash | |
| REAL_GIT=${REAL_GIT-/usr/bin/git} | |
| TICKET_PREFIX=TICKET-PREFIX- # Like JIRA-, REDMINE-, CLEARQUEST- or something. | |
| TICKET_REGEX="${TICKET_PREFIX}[0-9][0-9]*" | |
| main() { | |
| local command=$1 | |
| shift | |
| if [[ commit == $command ]] || [[ ticket == $command ]] ; then | |
| get_ticket |
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
| node { | |
| checkout scm | |
| //checkout jenkinsfunctions to subdir and load | |
| checkout([$class: 'GitSCM', | |
| branches: [[name: '*/master']], | |
| doGenerateSubmoduleConfigurations: false, | |
| extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'groovyfunctions']], | |
| submoduleCfg: [], |
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
| #!/usr/bin/env groovy | |
| CLEAN = true | |
| DEBUG = 2 | |
| OVERALL_TIMEOUT = 1 // minutes | |
| email_to = 'person2@someOrg.net, person3@gmail.com, ' | |
| git_creds = 'general-deploy-key-1' | |
| git_url = 'git@gitlab.some.domain.tld:someNamespace/someProject.git' | |
| branch = '' | |
| default_branch = 'master' // Ignored if Jenkinsfile is pulled from SCM - in favor of that Jenkinsfile's SCM branch. |
NewerOlder