Fixed indentation and removed usage of 'scripts' inside the steps
We have seen situations where code in the script failed due to some
error, and no message was displayed in any of the logs
@@ -19,15 +19,14 @@ pipeline {
stage('Deploy for subsystem') {
steps {
- script {
- docker.withRegistry('https://docker.io/', 'dockerio_cred') {
+ withCredentials([usernamePassword(credentialsId: 'dockerio_cred', passwordVariable: 'PASS', usernameVariable: 'USER')]) {
+ sh '''docker login docker.io -u $USER -p $PASS'''
+ }
sh '''export PATH=$PATH:/usr/local/go/bin; make jenkins-deploy-for-subsystem'''
sleep 60
sh '''# Dump pod statuses;kubectl get pods -A'''
}
}
- }
- }
stage('Subsystem-test') {
steps {
@@ -52,9 +51,9 @@ pipeline {
}
sh '''docker tag ${SERVICE} quay.io/ocpmetal/assisted-service:latest'''
- sh '''docker tag ${SERVICE} quay.io/ocpmetal/assisted-service:$(git rev-parse --verify HEAD)'''
+ sh '''docker tag ${SERVICE} quay.io/ocpmetal/assisted-service:${GIT_COMMIT}'''
sh '''docker push quay.io/ocpmetal/assisted-service:latest'''
- sh '''docker push quay.io/ocpmetal/assisted-service:$(git rev-parse --verify HEAD)'''
+ sh '''docker push quay.io/ocpmetal/assisted-service:${GIT_COMMIT}'''
}
}
}
