Last active
April 19, 2017 20:25
-
-
Save cdenneen/2b239de8efebdb81245c3eb29708477e to your computer and use it in GitHub Desktop.
Docker issues
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 { | |
deleteDir() | |
stage 'Checkout' | |
git branch: 'production', url: 'https://github.com/cdenneen/control-repo.git' | |
stash "${env.JOB_NAME}" | |
stage 'Test' | |
gitCommit = sh(returnStdout: true, script: 'git rev-parse HEAD').trim() | |
// short SHA, possibly better for chat notifications, etc. | |
shortCommit = gitCommit.take(6) | |
sh "echo $shortCommit" | |
def matrix = [:] | |
def rubyVersion = ['2.3.4', '2.1.10'] | |
for (int x = 0; x < rubyVersion.size(); x++) { | |
def puppetVersion = ['4.7.1', '4.8.1', '4.9.4'] | |
for (int i = 0; i < puppetVersion.size(); i++) { | |
RUBY_VERSION = rubyVersion[x] | |
PUPPET_GEM_VERSION = puppetVersion[i] | |
// matrix["version_r${rubyVersion[x]}_p${puppetVersion[i]}"] = { | |
// ansiColor('xterm'){ | |
withRvm("ruby-${RUBY_VERSION}") { | |
withEnv(["PUPPET_GEM_VERSION=${PUPPET_GEM_VERSION}","LANG=en_US.UTF-8"]) { | |
stage("ruby-${RUBY_VERSION} and puppet-${PUPPET_GEM_VERSION}") { | |
echo "$RUBY_VERSION + $PUPPET_GEM_VERSION" | |
} | |
stage("spec r${RUBY_VERSION}p${PUPPET_GEM_VERSION}") { | |
sh "set +x; source ${RVM_HOME}/scripts/rvm; rvm use ${RUBY_VERSION}@executor-${env.EXECUTOR_NUMBER}; gem install bundler --no-ri --no-rdoc" | |
sh "set +x; source ${RVM_HOME}/scripts/rvm; rvm use ${RUBY_VERSION}@executor-${env.EXECUTOR_NUMBER}; rm Gemfile.lock; bundle install" | |
} | |
stage('Do Puppet Code Validation') { | |
sh "set +x; source ${RVM_HOME}/scripts/rvm; rvm use ${RUBY_VERSION}@executor-${env.EXECUTOR_NUMBER}; bundle exec rake validate" | |
} | |
} | |
} | |
// } | |
// } | |
} | |
} | |
// parallel matrix | |
} | |
def withRvm(version, cl) { | |
withRvm(version, "executor-${env.EXECUTOR_NUMBER}") { | |
cl() | |
} | |
} | |
def withRvm(version, gemset, cl) { | |
RVM_HOME='$HOME/.rvm' | |
paths = [ | |
"$RVM_HOME/gems/$version@$gemset/bin", | |
"$RVM_HOME/gems/$version@global/bin", | |
"$RVM_HOME/rubies/$version/bin", | |
"$RVM_HOME/bin", | |
"${env.PATH}" | |
] | |
def path = paths.join(':') | |
// withEnv(["PATH=${env.PATH}:$RVM_HOME", "RVM_HOME=$RVM_HOME"]) { | |
withEnv(["PATH=$path:$RVM_HOME", "RVM_HOME=$RVM_HOME", "BASH_ENV=$RVM_HOME/scripts/rvm"]) { | |
sh "set +x; source $RVM_HOME/scripts/rvm; rvm use --create --install $version@$gemset" | |
} | |
withEnv([ | |
"PATH=$path", | |
"GEM_HOME=$RVM_HOME/gems/$version@$gemset", | |
"GEM_PATH=$RVM_HOME/gems/$version@$gemset:$RVM_HOME/gems/$version@global", | |
"MY_RUBY_HOME=$RVM_HOME/rubies/$version", | |
"IRBRC=$RVM_HOME/rubies/$version/.irbrc", | |
"BASH_ENV=$RVM_HOME/scripts/rvm", | |
"RUBY_VERSION=$version" | |
]) { | |
'gem install bundler' | |
cl() | |
} | |
} |
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
+ printenv | |
BUILD_URL=http://localhost:18080/job/p2/7/ | |
rvm_bin_path=/var/jenkins_home/.rvm/bin | |
HOSTNAME=e0e0f8cbb8a3 | |
RVM_HOME=$HOME/.rvm | |
HUDSON_SERVER_COOKIE=cc87fa94aeb58fb7 | |
UNIX_STACKUTILS=/home/centos/ap/jenkins/workspace/util/UploadUtilitiesUnix/Ruby/stack_utilsv2.rb | |
BUILD_TAG=jenkins-p2-7 | |
COPY_REFERENCE_FILE_LOG=/var/jenkins_home/copy_reference_file.log | |
JOB_URL=http://localhost:18080/job/p2/ | |
WORKSPACE=/var/jenkins_home/workspace/p2 | |
UNIX_UTILS=/home/centos/ap/jenkins/workspace/util/UploadUtilitiesUnix/Ruby | |
RUN_CHANGES_DISPLAY_URL=http://localhost:18080/job/p2/7/display/redirect?page=changes | |
_system_type=Linux | |
CA_CERTIFICATES_JAVA_VERSION=20161107~bpo8+1 | |
rvm_path=/var/jenkins_home/.rvm | |
rvm_prefix=/var/jenkins_home | |
JENKINS_HOME=/var/jenkins_home | |
PATH=$HOME/.rvm/gems/ruby-2.3.4@executor-0/bin:$HOME/.rvm/gems/ruby-2.3.4@global/bin:$HOME/.rvm/rubies/ruby-2.3.4/bin:$HOME/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$HOME/.rvm:/var/jenkins_home/.rvm/bin | |
JENKINS_UC=https://updates.jenkins.io | |
RUN_DISPLAY_URL=http://localhost:18080/job/p2/7/display/redirect | |
PWD=/var/jenkins_home/workspace/p2 | |
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 | |
JENKINS_SLAVE_AGENT_PORT=50000 | |
HUDSON_URL=http://localhost:18080/ | |
LANG=C.UTF-8 | |
JOB_NAME=p2 | |
JAVA_VERSION=8u121 | |
_system_arch=x86_64 | |
BUILD_DISPLAY_NAME=#7 | |
JENKINS_URL=http://localhost:18080/ | |
BUILD_ID=7 | |
_system_version=8 | |
TINI_SHA=6c41ec7d33e857d4779f14d9c74924cab0c7973485d2972419a3b7c7620ff5fd | |
JOB_BASE_NAME=p2 | |
rvm_version=1.29.1 (latest) | |
JAVA_DEBIAN_VERSION=8u121-b13-1~bpo8+1 | |
HOME=/var/jenkins_home | |
SHLVL=1 | |
TINI_VERSION=0.14.0 | |
no_proxy=*.local, 169.254/16 | |
EXECUTOR_NUMBER=0 | |
JENKINS_SERVER_COOKIE=durable-8f1ef48565516fd9cea89b4b53686bbb | |
BASH_ENV=$HOME/.rvm/scripts/rvm | |
NODE_LABELS=master puppet unixaws | |
GEM_PATH=file:/var/jenkins_home/plugins/ruby-runtime/WEB-INF/lib/stapler-jruby-1.209.jar!/gem | |
HUDSON_HOME=/var/jenkins_home | |
NODE_NAME=master | |
JOB_DISPLAY_URL=http://localhost:18080/job/p2/display/redirect | |
BUILD_NUMBER=7 | |
HUDSON_COOKIE=b0c69194-a079-4341-8b36-c2f57a2ebd32 | |
JENKINS_VERSION=2.54 | |
_system_name=Debian | |
_=/usr/bin/printenv |
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 { | |
deleteDir() | |
stage 'Checkout' | |
git branch: 'production', url: 'https://github.com/cdenneen/control-repo.git' | |
stash "${env.JOB_NAME}" | |
stage 'Test' | |
gitCommit = sh(returnStdout: true, script: 'git rev-parse HEAD').trim() | |
// short SHA, possibly better for chat notifications, etc. | |
shortCommit = gitCommit.take(6) | |
sh "echo $shortCommit" | |
def matrix = [:] | |
def rubyVersion = ['2.3.4', '2.1.10'] | |
for (int x = 0; x < rubyVersion.size(); x++) { | |
def puppetVersion = ['4.7.1', '4.8.1', '4.9.4'] | |
for (int i = 0; i < puppetVersion.size(); i++) { | |
RUBY_VERSION = rubyVersion[x] | |
PUPPET_GEM_VERSION = puppetVersion[i] | |
// matrix["version_r${rubyVersion[x]}_p${puppetVersion[i]}"] = { | |
// ansiColor('xterm'){ | |
withRvm("ruby-${RUBY_VERSION}") { | |
withEnv(["PUPPET_GEM_VERSION=${PUPPET_GEM_VERSION}","LANG=en_US.UTF-8"]) { | |
stage("ruby-${RUBY_VERSION} and puppet-${PUPPET_GEM_VERSION}") { | |
echo "$RUBY_VERSION + $PUPPET_GEM_VERSION" | |
} | |
stage("spec r${RUBY_VERSION}p${PUPPET_GEM_VERSION}") { | |
sh "gem install bundler --no-ri --no-rdoc" | |
sh "rm Gemfile.lock; bundle install" | |
} | |
stage('Do Puppet Code Validation') { | |
sh "bundle exec rake validate" | |
} | |
} | |
} | |
// } | |
// } | |
} | |
} | |
// parallel matrix | |
} | |
def withRvm(version, cl) { | |
withRvm(version, "executor-${env.EXECUTOR_NUMBER}") { | |
cl() | |
} | |
} | |
def withRvm(version, gemset, cl) { | |
RVM_HOME='$HOME/.rvm' | |
paths = [ | |
"$RVM_HOME/gems/$version@$gemset/bin", | |
"$RVM_HOME/gems/$version@global/bin", | |
"$RVM_HOME/rubies/$version/bin", | |
"$RVM_HOME/bin", | |
"${env.PATH}" | |
] | |
def path = paths.join(':') | |
// withEnv(["PATH=${env.PATH}:$RVM_HOME", "RVM_HOME=$RVM_HOME"]) { | |
withEnv(["PATH=$path:$RVM_HOME", "RVM_HOME=$RVM_HOME"]) { | |
sh "set +x; source $RVM_HOME/scripts/rvm; rvm use --create --install $version@$gemset" | |
} | |
withEnv([ | |
"PATH=$path", | |
"GEM_HOME=$RVM_HOME/gems/$version@$gemset", | |
"GEM_PATH=$RVM_HOME/gems/$version@$gemset:$RVM_HOME/gems/$version@global", | |
"MY_RUBY_HOME=$RVM_HOME/rubies/$version", | |
"IRBRC=$RVM_HOME/rubies/$version/.irbrc", | |
"RUBY_VERSION=$version" | |
]) { | |
'gem install bundler' | |
cl() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment