Last active
May 5, 2017 13:38
-
-
Save cdenneen/58757cd9ece3042d8cf4a9e81e5ebfe8 to your computer and use it in GitHub Desktop.
Pipeline testing
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 { | |
deleteDir() | |
stage 'Checkout' | |
git branch: 'production', url: 'https://github.com/cdenneen/control-repo.git' | |
// def stashName = "${env.JOB_NAME}_${env.BUILD_NUMBER}" | |
// stash stashName | |
// 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 puppetVersion = ['4.7.1', '4.8.1', '4.9.4'] | |
for (int i = 0; i < puppetVersion.size(); i++) { | |
def index = i //if we tried to use i below, it would equal last array count in each job execution | |
// puppetVersion["puppet-${puppetVersion[i]}"] = { | |
PUPPET_GEM_VERSION = puppetVersion[index] | |
ansiColor('xterm'){ | |
withEnv(["PUPPET_GEM_VERSION=${PUPPET_GEM_VERSION}","LANG=en_US.UTF-8"]) { | |
stage("Puppet Testing") { | |
puppetTesting{ | |
sh "gem install bundler --no-ri --no-rdoc" | |
sh "bundle install --without system_tests" | |
sh "bundle exec rake validate" | |
} | |
} | |
} | |
} | |
// } | |
} | |
// parallel puppetVersion | |
} | |
def puppetTesting(Closure body) { | |
podTemplate(label: 'puppet', containers:[ | |
containerTemplate(name: 'ruby21', image: 'ruby:2.1-alpine', ttyEnabled: true, command: 'cat'), | |
containerTemplate(name: 'ruby22', image: 'ruby:2.2-alpine', ttyEnabled: true, command: 'cat'), | |
containerTemplate(name: 'ruby23', image: 'ruby:2.3-alpine', ttyEnabled: true, command: 'cat') | |
]){ | |
node('puppet') { | |
container('ruby21'){ | |
body() | |
} | |
container('ruby22'){ | |
body() | |
} | |
container('ruby23'){ | |
body() | |
} | |
} | |
} | |
} |
Rev3 errors as
Started by user Jenkins
[Pipeline] node
Running on default-jenkins-slave-1833a78858d4 in /home/jenkins/workspace/newtest
[Pipeline] {
[Pipeline] deleteDir
[Pipeline] stage (Checkout)
Using the ‘stage’ step without a block argument is deprecated
Entering stage Checkout
Proceeding
[Pipeline] git
Cloning the remote Git repository
Cloning repository https://github.com/cdenneen/control-repo.git
> git init /home/jenkins/workspace/newtest # timeout=10
Fetching upstream changes from https://github.com/cdenneen/control-repo.git
> git --version # timeout=10
> git fetch --tags --progress https://github.com/cdenneen/control-repo.git +refs/heads/*:refs/remotes/origin/*
> git config remote.origin.url https://github.com/cdenneen/control-repo.git # timeout=10
> git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
> git config remote.origin.url https://github.com/cdenneen/control-repo.git # timeout=10
Fetching upstream changes from https://github.com/cdenneen/control-repo.git
> git fetch --tags --progress https://github.com/cdenneen/control-repo.git +refs/heads/*:refs/remotes/origin/*
> git rev-parse refs/remotes/origin/production^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/production^{commit} # timeout=10
Checking out Revision 2d0a4090863c173818fa546732d29b05108845be (refs/remotes/origin/production)
> git config core.sparsecheckout # timeout=10
> git checkout -f 2d0a4090863c173818fa546732d29b05108845be
> git branch -a -v --no-abbrev # timeout=10
> git checkout -b production 2d0a4090863c173818fa546732d29b05108845be
> git rev-list 2d0a4090863c173818fa546732d29b05108845be # timeout=10
[Pipeline] sh
[newtest] Running shell script
+ git rev-parse HEAD
[Pipeline] sh
[newtest] Running shell script
+ echo 2d0a40
2d0a40
[Pipeline] ansiColor
[Pipeline] {
[Pipeline] withEnv
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Puppet Testing)
[Pipeline] podTemplate
[Pipeline] {
[Pipeline] node
Running on kubernetes-128e9c0078b74ba3afe395ebc3e79149-1835ffcdfe4f in /home/jenkins/workspace/newtest
[Pipeline] {
[Pipeline] container
[Pipeline] {
[Pipeline] sh
[newtest] Running shell script
Executing shell script inside container [ruby21] of pod [kubernetes-128e9c0078b74ba3afe395ebc3e79149-1835ffcdfe4f]
[Pipeline] }
[Pipeline] // container
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // podTemplate
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // ansiColor
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
java.io.IOException: Pipe not connected
at java.io.PipedOutputStream.write(PipedOutputStream.java:140)
at java.io.OutputStream.write(OutputStream.java:75)
at org.csanchez.jenkins.plugins.kubernetes.pipeline.ContainerExecDecorator$1.launch(ContainerExecDecorator.java:125)
at hudson.Launcher$ProcStarter.start(Launcher.java:384)
at org.jenkinsci.plugins.durabletask.BourneShellScript.launchWithCookie(BourneShellScript.java:157)
at org.jenkinsci.plugins.durabletask.FileMonitoringTask.launch(FileMonitoringTask.java:63)
at org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.start(DurableTaskStep.java:167)
at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:184)
at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:126)
at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:108)
at groovy.lang.GroovyObject$invokeMethod.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:151)
at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:21)
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:115)
at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:149)
at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:146)
at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:123)
at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:123)
at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:123)
at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:123)
at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:123)
at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:16)
at WorkflowScript.run(WorkflowScript:21)
at WorkflowScript.puppetTesting(WorkflowScript:41)
at ___cps.transform___(Native Method)
at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:57)
at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109)
at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82)
at sun.reflect.GeneratedMethodAccessor316.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
at com.cloudbees.groovy.cps.Next.step(Next.java:74)
at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:154)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:33)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:30)
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:30)
at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:165)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:330)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:82)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:242)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:230)
at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Finished: FAILURE
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Current output using version #2 here: