1688 PO Automation Project

This commit is contained in:
Dillon Ngo
2026-01-18 03:37:45 +08:00
parent 8bde7c8993
commit 0924b2ba87
Vendored
+18 -7
View File
@@ -11,7 +11,7 @@ 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 "ecr:ap-southeast-1:aws-ec2-instance-iam-role"
registryCredentialsId ""
registryUrl "https://303644228504.dkr.ecr.ap-southeast-1.amazonaws.com"
}
}
@@ -19,10 +19,21 @@ pipeline {
HOME = '.'
}
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 1 of 6 Completed'
currentBuild.description = 'Step 2 of 6 Completed'
def pusherKeyCredId
def pusherCluster
switch(GIT_BRANCH) {
@@ -68,7 +79,7 @@ pipeline {
println "Pusher cluster : ${env.MIX_PUSHER_APP_CLUSTER}"
println "Pusher key set : ${env.MIX_PUSHER_APP_KEY}"
}
currentBuild.description = 'Step 2 of 6 Completed'
currentBuild.description = 'Step 3 of 7 Completed'
}
}
}
@@ -77,7 +88,7 @@ pipeline {
steps {
sh 'composer update'
script{
currentBuild.description = 'Step 3 of 6 Completed'
currentBuild.description = 'Step 4 of 7 Completed'
}
}
}
@@ -86,7 +97,7 @@ pipeline {
steps {
sh 'vendor/bin/phpunit tests/Unit'
script{
currentBuild.description = 'Step 4 of 6 Completed'
currentBuild.description = 'Step 5 of 7 Completed'
}
}
}
@@ -111,7 +122,7 @@ pipeline {
sh "vendor/bin/vapor deploy development --message='${gitCommitMessage}'"
break
}
currentBuild.description = 'Step 5 of 6 Completed'
currentBuild.description = 'Step 6 of 7 Completed'
}
}
}
@@ -124,7 +135,7 @@ pipeline {
} catch (Exception e) {
echo "Error during cleanup: ${e.message}"
}
currentBuild.description = 'Step 6 of 6 Completed'
currentBuild.description = 'Step 7 of 7 Completed'
}
}
}