- Code snippets used in the webinar "Continuous Delivery for Cloud Native applications" presented by @cyrille-leclerc and @bboe-pivotal on Dec, 2nd 2015
- Slides: http://www.slideshare.net/cloudbees/continuous-delivery-for-cloud-native-applications-with-cloudbees-jenkins-platform-and-pivotal-cloud-foundry
- Youtube recording: https://youtu.be/FcBR9sBj-1g
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
#!groovy | |
# https://github.com/cyrille-leclerc/game-of-life/blob/jenkinsfile/Jenkinsfile | |
docker.image('cloudbees/java-build-tools:0.0.6').inside { | |
checkout scm | |
def mavenSettingsFile = "${pwd()}/.m2/settings.xml" | |
stage 'Build Web App' | |
wrap([$class: 'ConfigFileBuildWrapper', |
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
#!groovy | |
docker.image('cloudbees/java-build-tools:0.0.6').inside { | |
checkout scm | |
def mavenSettingsFile = "${pwd()}/.m2/settings.xml" | |
stage 'Build' | |
wrap([$class: 'ConfigFileBuildWrapper', |
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
#!groovy | |
docker.image('cloudbees/java-build-tools:0.0.5').inside { | |
checkout scm | |
def mavenSettingsFile = "${pwd()}/.m2/settings.xml" | |
stage 'Build Web App' | |
wrap([$class: 'ConfigFileBuildWrapper', | |
managedFiles: [[fileId: 'maven-settings-for-gameoflife', targetLocation: "${mavenSettingsFile}"]]]) { |
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
#!groovy | |
docker.image('cloudbees/java-build-tools:0.0.6').inside { | |
checkout([$class: 'GitSCM', | |
branches: [[name: '*/master']], | |
extensions: [ | |
/* [$class: 'UserIdentity', email: 'cleclerc@cloudbees.com', name: 'Jenkins as a Service'], */ | |
[$class: 'WipeWorkspace'], | |
[$class: 'LocalBranch', localBranch: 'master']], | |
userRemoteConfigs: [[credentialsId: 'github-credentials', url: 'https://github.com/cyrille-leclerc/my-spring-boot-app.git']]]) |
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
docker.image('cloudbees/java-build-tools:0.0.6').inside { | |
sshagent(['github-ssh-credentials']) { | |
sh """ | |
git version | |
git config --local user.email \\"cleclerc@cloudbees.com\\" | |
git config --local user.name \\"Cyrille Le Clerc\\" | |
git clone git@github.com:cyrille-leclerc/a-test-repo.git | |
date &> now.txt |
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
docker.image ('cloudbees/java-build-tools:0.0.7.1').inside { | |
// node { | |
sh 'whoami' | |
sh 'ls -al ~/.ssh/ || true' | |
sshagent(['aws-cleclerc-ssh-key-ubuntu-cleclerc']) { | |
sh 'echo SSH_AUTH_SOCK=$SSH_AUTH_SOCK' | |
sh 'ls -al $SSH_AUTH_SOCK || true' | |
sh "ssh -vvv -o StrictHostKeyChecking=no ubuntu@docker-agent.beesshop.org uname -a" | |
} | |
} |
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
{ | |
"firstName":"Cyrille", | |
"lastName":"Le Clerc", | |
"email": "cleclerc+aws@gmail.com", | |
"company": "France", | |
"source": "AWS", | |
"sourceTrial": "other (cje)", | |
"country": "France", | |
"requestTime": "Tue Mar 1 19:56:58 CET 2016", | |
"instanceId": "123456789" |
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
--- | |
Name: OpenShift Installer Configuration | |
Vendor: OpenShift Origin Community | |
Description: This is the configuration file for the OpenShift Installer. | |
Version: 0.0.1 | |
Deployment: | |
Hosts: | |
- host: openshift-enterprise.example.com | |
roles: | |
- nameserver |
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
aws --profile adminuser ec2 run-instances \ | |
--image-id ami-d55f79bf \ | |
--instance-type m3.medium \ | |
--count 1 \ | |
--key-name alliances-team \ | |
--security-group-ids sg-cd5696a0 |