[Pipeline] sh
[copy-of-sw] Running shell script
Executing shell script inside container [maven] of pod [kubernetes-b23305f2ea4d4f5ca6225ee0fe1d9db0-311b84f28bd9e]
Executing command: sh -c echo $$ > '/home/jenkins/workspace/copy-of-sw@tmp/durable-84010d23/pid'; jsc=durable-e271a92b5b252a3996e9c5847d57b90c; JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/copy-of-sw@tmp/durable-84010d23/script.sh' > '/home/jenkins/workspace/copy-of-sw@tmp/durable-84010d23/jenkins-log.txt' 2>&1; echo $? > '/home/jenkins/workspace/copy-of-sw@tmp/durable-84010d23/jenkins-result.txt'
$ cd /home/jenkins/workspace/copy-of-sw
sh -c echo $$ > '/home/jenkins/workspace/copy-of-sw@tmp/durable-84010d23/pid'; jsc=durable-e271a92b5b252a3996e9c5847d57b90c; JENKINS_SERVER_COOKIE=$jsc '/home/jenkins/workspace/copy-of-sw@tmp/durable-84010d23/script.sh' > '/home/jenkins/workspace/copy-of-sw@tmp/durable-84010d23/jenkins-log.txt' 2>&1; echo $? > '/home/jenkins/workspace/copy-of-sw@tmp/durable-84010d23/jenkins-result.txt'
exit
$ /bin/sh: 2: cannot create /home/jenkins/workspace/copy-of-sw@tmp/durable-84010d23/pid: Permission denied
/bin/sh: 2: cannot create /home/jenkins/workspace/copy-of-sw@tmp/durable-84010d23/jenkins-log.txt: Permission denied
/bin/sh: 2: cannot create /home/jenkins/workspace/copy-of-sw@tmp/durable-84010d23/jenkins-result.txt: Permission denied
$ command terminated with non-zero exit code: Error executing in Docker Container: 2[Pipeline] }
[Pipeline] // container
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // podTemplate
[Pipeline] End of Pipeline
ERROR: script returned exit code -2
Finished: FAILURE
name: jenkins-1-fmkhf
Namespace: default
Security Policy: jenkins
Node: 176.9.36.15/176.9.36.15
Start Time: Mon, 06 Feb 2017 10:22:47 +0100
Labels: deployment=jenkins-1
deploymentconfig=jenkins
group=io.fabric8.devops.apps
project=jenkins
provider=fabric8
version=2.2.311
Status: Running
IP: 172.17.0.5
Controllers: ReplicationController/jenkins-1
Init Containers:
init:
Container ID: docker://fba4e604ace68b779201c95fb650b15b051895ff56e7a937d2fe079765c9476d
Image: busybox
Image ID: docker-pullable://docker.io/busybox@sha256:817a12c32a39bbe394944ba49de563e085f1d3c5266eb8e9723256bc4448680e
Port:
Command:
chmod
777
/var/jenkins_home/workspace
/var/jenkins_home/jobs
State: Terminated
Reason: Completed
Exit Code: 0
Started: Mon, 06 Feb 2017 10:22:57 +0100
Finished: Mon, 06 Feb 2017 10:22:57 +0100
Ready: True
Restart Count: 0
Volume Mounts:
/var/jenkins_home/jobs from jenkins-jobs (rw)
/var/jenkins_home/workspace from jenkins-workspace (rw)
/var/run/secrets/kubernetes.io/serviceaccount from jenkins-token-t7v0j (ro)
Environment Variables: <none>
Containers:
jenkins:
Container ID: docker://2d11d0ac717a8460c303d97ee6c6a80f3c828b2e268c3f18bb878935c31bb028
Image: fabric8/jenkins-docker:2.2.311
Image ID: docker-pullable://docker.io/fabric8/jenkins-docker@sha256:d2da5a18524d06ec9e310efa4c11d96d6cc2f77309a13f8077dfe08ba762a71e
Ports: 50000/TCP, 8080/TCP
Limits:
cpu: 0
memory: 0
Requests:
cpu: 0
memory: 0
State: Running
Started: Mon, 06 Feb 2017 10:23:02 +0100
Ready: True
Restart Count: 0
Liveness: http-get http://:8080/blue/ delay=120s timeout=10s period=10s #success=1 #failure=3
Readiness: http-get http://:8080/blue/ delay=20s timeout=10s period=10s #success=1 #failure=3
Volume Mounts:
/var/jenkins_home/jobs from jenkins-jobs (rw)
/var/jenkins_home/workspace from jenkins-workspace (rw)
/var/run/secrets/kubernetes.io/serviceaccount from jenkins-token-t7v0j (ro)
Environment Variables:
PROJECT_VERSION: <set to the key 'project-version' of config map 'jenkins'>
PIPELINE_ELASTICSEARCH_PROTOCOL: <set to the key 'pipeline-elasticsearch-protocol' of config map 'jenkins'>
JENKINS_GOGS_PASSWORD: <set to the key 'jenkins-gogs-password' of config map 'jenkins'>
JENKINS_GOGS_USER: <set to the key 'jenkins-gogs-user' of config map 'jenkins'>
JENKINS_GOGS_EMAIL: <set to the key 'jenkins-gogs-email' of config map 'jenkins'>
PIPELINE_ELASTICSEARCH_HOST: <set to the key 'pipeline-elasticsearch-host' of config map 'jenkins'>
KUBERNETES_NAMESPACE: default (v1:metadata.namespace)
KUBERNETES_MASTER: https://kubernetes.default
Conditions:
Type Status
Initialized True
Ready True
PodScheduled True
Volumes:
jenkins-jobs:
Type: PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
ClaimName: jenkins-jobs
ReadOnly: false
jenkins-workspace:
Type: PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
ClaimName: jenkins-workspace
ReadOnly: false
jenkins-token-t7v0j:
Type: Secret (a volume populated by a Secret)
SecretName: jenkins-token-t7v0j
QoS Class: BestEffort
Tolerations: <none>
Events:
FirstSeen LastSeen Count From SubobjectPath Type Reason Message
--------- -------- ----- ---- ------------- -------- ------ -------
9m 9m 1 {default-scheduler } Normal Scheduled Successfully assigned jenkins-1-fmkhf to 176.9.36.15
9m 9m 1 {kubelet 176.9.36.15} spec.initContainers{init} Normal Pulled Container image "busybox" already present on machine
9m 9m 1 {kubelet 176.9.36.15} spec.initContainers{init} Normal Created Created container with docker id fba4e604ace6; Security:[seccomp=unconfined]
9m 9m 1 {kubelet 176.9.36.15} spec.initContainers{init} Normal Started Started container with docker id fba4e604ace6
9m 9m 1 {kubelet 176.9.36.15} spec.containers{jenkins} Normal Pulled Container image "fabric8/jenkins-docker:2.2.311" already present on machine
9m 9m 1 {kubelet 176.9.36.15} spec.containers{jenkins} Normal Created Created container with docker id 2d11d0ac717a; Security:[seccomp=unconfined]
9m 9m 1 {kubelet 176.9.36.15} spec.containers{jenkins} Normal Started Started container with docker id 2d11d0ac717a
8m 8m 2 {kubelet 176.9.36.15} spec.containers{jenkins} Warning Unhealthy Readiness probe failed: HTTP probe failed with statuscode: 503
$ oc describe scc jenkins
Name: jenkins
Priority: 99
Access:
Users: system:serviceaccount:default:admin,system:serviceaccount:default:jenkins,admin
Groups: system:cluster-admins,system:nodes
Settings:
Allow Privileged: true
Default Add Capabilities: <none>
Required Drop Capabilities: <none>
Allowed Capabilities: <none>
Allowed Volume Types: *
Allow Host Network: true
Allow Host Ports: true
Allow Host PID: false
Allow Host IPC: false
Read Only Root Filesystem: false
Run As User Strategy: RunAsAny
UID: <none>
UID Range Min: <none>
UID Range Max: <none>
SELinux Context Strategy: RunAsAny
User: <none>
Role: <none>
Type: <none>
Level: <none>
FSGroup Strategy: RunAsAny
Ranges: <none>
Supplemental Groups Strategy: RunAsAny
Ranges: <none>
#!/usr/bin/groovy
@Library('github.com/fabric8io/fabric8-pipeline-library@master')
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()
def buildLabel = "mylabel.${env.JOB_NAME}.${env.BUILD_NUMBER}".replace('-', '_').replace('/', '_')
podTemplate(label: buildLabel,
containers: [containerTemplate(alwaysPullImage: false, args: 'cat', command: '/bin/sh -c',
envVars: [
containerEnvVar(key: 'DOCKER_CONFIG', value: '/home/jenkins/.docker/')],
image: 'jhipster/jhipster', name: 'maven', privileged: true, resourceLimitCpu: '', resourceLimitMemory: '', resourceRequestCpu: '', resourceRequestMemory: '', ttyEnabled: true, workingDir: '/home/jenkins')],
volumes: [hostPathVolume(hostPath: '/var/run/docker.sock', mountPath: '/var/run/docker.sock'), secretVolume(mountPath: '/root/.m2', secretName: 'jenkins-maven-settings'), secretVolume(mountPath: '/home/jenkins/.docker', secretName: 'jenkins-docker-cfg')],
serviceAccount: 'jenkins') {
node(buildLabel) {
container(name: 'maven') {
def envProd = 'shiftwork-production'
checkout scm
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)
}
}
}