Merge branch 'test' into vapor/staging

This commit is contained in:
Dillon Ngo
2024-10-28 17:05:38 +08:00
3 changed files with 37 additions and 13 deletions
Vendored
+33 -9
View File
@@ -1,8 +1,10 @@
pipeline {
agent {
docker {
image 'dillonngo/docker-based-image:poc'
args "--group-add 992 -v /var/run/docker.sock:/var/run/docker.sock"
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"
registryUrl "https://303644228504.dkr.ecr.ap-southeast-1.amazonaws.com"
}
}
environment {
@@ -12,19 +14,16 @@ pipeline {
stage('Download source code from Git') {
steps {
script{
currentBuild.description = 'Step 1 of 6 Completed'
println("GIT GIT_BRANCH: " + GIT_BRANCH)
switch(GIT_BRANCH) {
case "vapor/production":
git(
url: 'https://gitlab.com/CIEFWorldwideSdnBhd/vapor-laravel-explore.git',
credentialsId: 'gitlab-jenkins-localhost',
branch: 'vapor/production'
)
break
case "vapor/staging":
case "vapor/development":
git(
url: 'https://gitlab.com/CIEFWorldwideSdnBhd/vapor-laravel-explore.git',
credentialsId: 'gitlab-jenkins-localhost',
branch: 'vapor/staging'
branch: GIT_BRANCH
)
break
case "origin/test":
@@ -35,6 +34,7 @@ pipeline {
)
break
}
currentBuild.description = 'Step 2 of 6 Completed'
}
}
}
@@ -42,12 +42,18 @@ pipeline {
stage('Install') {
steps {
sh 'composer update'
script{
currentBuild.description = 'Step 3 of 6 Completed'
}
}
}
stage('Tests') {
steps {
sh 'vendor/bin/phpunit tests/Unit'
script{
currentBuild.description = 'Step 4 of 6 Completed'
}
}
}
@@ -56,6 +62,7 @@ pipeline {
script{
String gitCommitMessage = getCommitMessage()
println("GIT CommitMessage: " + gitCommitMessage)
println("GIT GIT_BRANCH: " + GIT_BRANCH)
switch(GIT_BRANCH) {
case "vapor/production":
sh "vendor/bin/vapor deploy production --message='${gitCommitMessage}'"
@@ -63,14 +70,30 @@ pipeline {
case "vapor/staging":
sh "vendor/bin/vapor deploy staging --message='${gitCommitMessage}'"
break
case "vapor/development":
sh "vendor/bin/vapor deploy development --message='${gitCommitMessage}'"
break
case "origin/test":
sh "vendor/bin/vapor deploy development --message='${gitCommitMessage}'"
break
}
currentBuild.description = 'Step 5 of 6 Completed'
}
}
}
stage('Cleanup') {
steps {
script {
try {
sh 'docker image prune -a -f'
} catch (Exception e) {
echo "Error during cleanup: ${e.message}"
}
currentBuild.description = 'Step 6 of 6 Completed'
}
}
}
}
}
@@ -82,5 +105,6 @@ String getCommitMessage(){
commitMessage = entry.msg
}
}
commitMessage = commitMessage.replace("'", "`")
return commitMessage
}
+1 -1
View File
@@ -56,7 +56,7 @@
<div class="ml-12">
<div class="mt-2 text-gray-600 dark:text-gray-400 text-sm">
Laravel has wonderful, thorough documentation covering every aspect of the framework. Whether you are new to the framework or have previous experience with Laravel, we recommend reading all of the documentation from beginning to end.
A. Laravel has wonderful, thorough documentation covering every aspect of the framework. Whether you are new to the framework or have previous experience with Laravel, we recommend reading all of the documentation from beginning to end.
</div>
</div>
</div>
+3 -3
View File
@@ -5,7 +5,7 @@ environments:
domain: production.vapor-explore.izyim.com
memory: 1024
cli-memory: 512
database: vapor-laravel-poc-db
database: cief-amazon-rds-mysql
storage: vapor-laravel-explore-production
runtime: 'docker'
timeout: 180
@@ -20,7 +20,7 @@ environments:
domain: staging.vapor-explore.izyim.com
memory: 1024
cli-memory: 512
database: vapor-laravel-poc-db
database: cief-amazon-rds-mysql
storage: vapor-laravel-explore-staging
runtime: 'docker'
timeout: 180
@@ -35,7 +35,7 @@ environments:
domain: dev.vapor-explore.izyim.com
memory: 1024
cli-memory: 512
database: vapor-laravel-poc-db
database: cief-amazon-rds-mysql
storage: vapor-laravel-explore-development
runtime: 'docker'
timeout: 180