#!/usr/bin/groovy
def failIfNoTests = ""try { failIfNoTests = ITEST_FAIL_IF_NO_TEST} catch (Throwable e) { failIfNoTests = "false"}
def itestPattern = ""try { itestPattern = ITEST_PATTERN} catch (Throwable e) { itestPattern = "*KT"}
def versionPrefix = ""try { versionPrefix = VERSION_PREFIX} catch (Throwable e) { versionPrefix = "1.0"}
def canaryVersion = "${versionPrefix}.${env.BUILD_NUMBER}"//def utils = new io.fabric8.Utils()
node { def envProd = 'shiftwork-production'
checkout scm
kubernetes.pod('buildpod') .withNewContainer() .withImage('jhipster/jhipster') .withPrivileged(true) //.withHostPathMount('/var/run/docker.sock','/var/run/docker.sock') //.withEnvVar('DOCKER_CONFIG','/home/jenkins/.docker/') //.withSecret('jenkins-docker-cfg','/home/jenkins/.docker') //.withSecret('jenkins-maven-settings','/root/.m2') //.withServiceAccount('jenkins') .inside { stage 'Canary Release' mavenCanaryRelease{ version = canaryVersion }
stage 'Integration Test' mavenIntegrationTest{ environment = 'Testing' failIfNoTests = localFailIfNoTests itestPattern = localItestPattern }
stage 'Rolling Upgrade Production' def rc = readFile 'target/classes/kubernetes.json' kubernetesApply(file: rc, environment: envProd)
}}
[Pipeline] withPod
[Pipeline] {
[Pipeline] stage (Canary Release)
Using the ‘stage’ step without a block argument is deprecated
Entering stage Canary Release
Proceeding
[Pipeline] sh
[copy of sw] Running shell script
$ sh -c echo $$ > '/home/jenkins/workspace/copy of sw@tmp/durable-65cd6640/pid'; jsc=durable-5f8d30ed8e3c29be00825e1f021569f8; JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/copy of sw@tmp/durable-65cd6640/script.sh' > '/home/jenkins/workspace/copy of sw@tmp/durable-65cd6640/jenkins-log.txt' 2>&1; echo $? > '/home/jenkins/workspace/copy of sw@tmp/durable-65cd6640/jenkins-result.txt'
exit
/bin/sh: 1: cannot create /home/jenkins/workspace/copy of sw@tmp/durable-65cd6640/pid: Directory nonexistent
/bin/sh: 1: cannot create /home/jenkins/workspace/copy of sw@tmp/durable-65cd6640/jenkins-log.txt: Directory nonexistent
/bin/sh: 1: cannot create /home/jenkins/workspace/copy of sw@tmp/durable-65cd6640/jenkins-result.txt: Directory nonexistent
$ command terminated with non-zero exit code: Error executing in Docker Container: 2[Pipeline] }
[Pipeline] // withPod
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code -2
Finished: FAILURE
Events: FirstSeen LastSeen Count From SubobjectPath Type Reason Message --------- -------- ----- ---- ------------- -------- ------ ------- 10m 10m 1 {default-scheduler } Normal Scheduled Successfully assigned buildpod-34a7d18b-a756-4ce8-a851-cf3221884432 to 176.9.36.15 10m 10m 1 {kubelet 176.9.36.15} spec.containers{buildcnt} Normal Pulling pulling image "jhipster/jhipster" 10m 10m 1 {kubelet 176.9.36.15} spec.containers{buildcnt} Normal Pulled Successfully pulled image "jhipster/jhipster" 10m 10m 1 {kubelet 176.9.36.15} spec.containers{buildcnt} Normal Created Created container with docker id 8dc9f93dbc43; Security:[seccomp=unconfined] 10m 10m 1 {kubelet 176.9.36.15} spec.containers{buildcnt} Warning Failed Failed to start container with docker id 8dc9f93dbc43 with error: Error response from daemon: {"message":"invalid header field value \"oci runtime error: container_linux.go:247: starting container process caused \\\"chdir to cwd (\\\\\\\"/home/jenkins/workspace/copy-of-sw\\\\\\\") set in config.json failed: no such file or directory\\\"\\n\""} 10m 10m 1 {kubelet 176.9.36.15} Warning FailedSync Error syncing pod, skipping: failed to "StartContainer" for "buildcnt" with RunContainerError: "runContainer: Error response from daemon: {\"message\":\"invalid header field value \\\"oci runtime error: container_linux.go:247: starting container process caused \\\\\\\"chdir to cwd (\\\\\\\\\\\\\\\"/home/jenkins/workspace/copy-of-sw\\\\\\\\\\\\\\\") set in config.json failed: no such file or directory\\\\\\\"\\\\n\\\"\"}"