Issues with the start-build:
ERROR: Error running start-build on at least one item: [buildconfig/myapp-docker];
{reference={}, err=Uploading file "target/PaymentsWS-0.1.0.war" as binary input for the build ...
Error from server (BadRequest): unable to wait for build myapp-docker-1 to run: timed out waiting for the condition, verb=start-build, cmd=oc start-build buildconfig/myapp-docker --from-file=target/PaymentsWS-0.1.0.war --wait -o=name --server=https://172.30.0.1:443 --namespace=myapp1 --token=XXXXX , out=, status=1}
Issues with the start-build: ERROR: Error running start-build on at least one item: [buildconfig/myapp-docker]; {reference={}, err=Uploading file "target/PaymentsWS-0.1.0.war" as binary input for the build ... Error from server (BadRequest): unable to wait for build myapp-docker-1 to run: timed out waiting for the condition, verb=start-build, cmd=oc start-build buildconfig/myapp-docker --from-file=target/PaymentsWS-0.1.0.war --wait -o=name --server=https://172.30.0.1:443 --namespace=myapp1 --token=XXXXX , out=, status=1}
oc version: oc v3.7.1+ab0f056 kubernetes v1.7.6+a08f5eeb62 features: Basic-Auth
Here is the Jenkins file:
pipeline { environment{ def appName = "myapp" def project = "myapp" } agent { label 'maven' } stages { stage('Build App') { steps { checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, \ extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'jenkins-ssh-key', \ url: 'ssh://git@hidden/PaymentsWS.git']]]) sh "mvn -s eclipse/MavenSettings/settings.xml clean package" } } stage('Create Image Builder') { when { expression { openshift.withCluster() { return !openshift.selector("bc", "${appName}-docker").exists(); } } } steps { script { openshift.withCluster() { openshift.newBuild("--name=${appName}-docker", "--image-stream=redhat-openjdk18-openshift:1.1", "--binary") } } } } stage("Build Image") { steps { script { openshift.withCluster() { openshift.selector("bc", "${appName}-docker").startBuild("--from-file=target/PaymentsWS-0.1.0.war", "--wait") } } } } stage("Deploy") { steps { script { openshift.withCluster() {
openshiftDeploy deploymentConfig: appName, namespace: project } } } } } }