diff --git a/Jenkinsfile b/Jenkinsfile index 65d5d5e7..ed52bd70 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,30 +11,18 @@ pipeline { docker { args '--group-add 992 -v /var/run/docker.sock:/var/run/docker.sock' image '303644228504.dkr.ecr.ap-southeast-1.amazonaws.com/jenkins-pipeline-agent:latest' - registryCredentialsId "" + registryCredentialsId "ecr:ap-southeast-1:aws-ec2-instance-iam-role" registryUrl "https://303644228504.dkr.ecr.ap-southeast-1.amazonaws.com" } } environment { HOME = '.' - DOCKER_API_VERSION = '1.41' } stages { - stage('Login to ECR') { - steps { - sh ''' - aws ecr get-login-password --region ap-southeast-1 | \ - docker login --username AWS --password-stdin 303644228504.dkr.ecr.ap-southeast-1.amazonaws.com - ''' - script{ - currentBuild.description = 'Step 1 of 7 Completed' - } - } - } stage('Download source code from Git') { steps { script{ - currentBuild.description = 'Step 2 of 6 Completed' + currentBuild.description = 'Step 1 of 6 Completed' def pusherKeyCredId def pusherCluster switch(GIT_BRANCH) { @@ -80,7 +68,7 @@ pipeline { println "Pusher cluster : ${env.MIX_PUSHER_APP_CLUSTER}" println "Pusher key set : ${env.MIX_PUSHER_APP_KEY}" } - currentBuild.description = 'Step 3 of 7 Completed' + currentBuild.description = 'Step 2 of 6 Completed' } } } @@ -89,7 +77,7 @@ pipeline { steps { sh 'composer update' script{ - currentBuild.description = 'Step 4 of 7 Completed' + currentBuild.description = 'Step 3 of 6 Completed' } } } @@ -98,7 +86,7 @@ pipeline { steps { sh 'vendor/bin/phpunit tests/Unit' script{ - currentBuild.description = 'Step 5 of 7 Completed' + currentBuild.description = 'Step 4 of 6 Completed' } } } @@ -123,7 +111,7 @@ pipeline { sh "vendor/bin/vapor deploy development --message='${gitCommitMessage}'" break } - currentBuild.description = 'Step 6 of 7 Completed' + currentBuild.description = 'Step 5 of 6 Completed' } } } @@ -136,7 +124,7 @@ pipeline { } catch (Exception e) { echo "Error during cleanup: ${e.message}" } - currentBuild.description = 'Step 7 of 7 Completed' + currentBuild.description = 'Step 6 of 6 Completed' } } }