mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/vapor-laravel-explore.git
synced 2026-08-19 04:24:03 +00:00
Merge branch 'test' into vapor/staging
This commit is contained in:
Vendored
+33
-9
@@ -1,8 +1,10 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent {
|
agent {
|
||||||
docker {
|
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 {
|
environment {
|
||||||
@@ -12,19 +14,16 @@ pipeline {
|
|||||||
stage('Download source code from Git') {
|
stage('Download source code from Git') {
|
||||||
steps {
|
steps {
|
||||||
script{
|
script{
|
||||||
|
currentBuild.description = 'Step 1 of 6 Completed'
|
||||||
|
println("GIT GIT_BRANCH: " + GIT_BRANCH)
|
||||||
switch(GIT_BRANCH) {
|
switch(GIT_BRANCH) {
|
||||||
case "vapor/production":
|
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/staging":
|
||||||
|
case "vapor/development":
|
||||||
git(
|
git(
|
||||||
url: 'https://gitlab.com/CIEFWorldwideSdnBhd/vapor-laravel-explore.git',
|
url: 'https://gitlab.com/CIEFWorldwideSdnBhd/vapor-laravel-explore.git',
|
||||||
credentialsId: 'gitlab-jenkins-localhost',
|
credentialsId: 'gitlab-jenkins-localhost',
|
||||||
branch: 'vapor/staging'
|
branch: GIT_BRANCH
|
||||||
)
|
)
|
||||||
break
|
break
|
||||||
case "origin/test":
|
case "origin/test":
|
||||||
@@ -35,6 +34,7 @@ pipeline {
|
|||||||
)
|
)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
currentBuild.description = 'Step 2 of 6 Completed'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -42,12 +42,18 @@ pipeline {
|
|||||||
stage('Install') {
|
stage('Install') {
|
||||||
steps {
|
steps {
|
||||||
sh 'composer update'
|
sh 'composer update'
|
||||||
|
script{
|
||||||
|
currentBuild.description = 'Step 3 of 6 Completed'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Tests') {
|
stage('Tests') {
|
||||||
steps {
|
steps {
|
||||||
sh 'vendor/bin/phpunit tests/Unit'
|
sh 'vendor/bin/phpunit tests/Unit'
|
||||||
|
script{
|
||||||
|
currentBuild.description = 'Step 4 of 6 Completed'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,6 +62,7 @@ pipeline {
|
|||||||
script{
|
script{
|
||||||
String gitCommitMessage = getCommitMessage()
|
String gitCommitMessage = getCommitMessage()
|
||||||
println("GIT CommitMessage: " + gitCommitMessage)
|
println("GIT CommitMessage: " + gitCommitMessage)
|
||||||
|
println("GIT GIT_BRANCH: " + GIT_BRANCH)
|
||||||
switch(GIT_BRANCH) {
|
switch(GIT_BRANCH) {
|
||||||
case "vapor/production":
|
case "vapor/production":
|
||||||
sh "vendor/bin/vapor deploy production --message='${gitCommitMessage}'"
|
sh "vendor/bin/vapor deploy production --message='${gitCommitMessage}'"
|
||||||
@@ -63,14 +70,30 @@ pipeline {
|
|||||||
case "vapor/staging":
|
case "vapor/staging":
|
||||||
sh "vendor/bin/vapor deploy staging --message='${gitCommitMessage}'"
|
sh "vendor/bin/vapor deploy staging --message='${gitCommitMessage}'"
|
||||||
break
|
break
|
||||||
|
case "vapor/development":
|
||||||
|
sh "vendor/bin/vapor deploy development --message='${gitCommitMessage}'"
|
||||||
|
break
|
||||||
case "origin/test":
|
case "origin/test":
|
||||||
sh "vendor/bin/vapor deploy development --message='${gitCommitMessage}'"
|
sh "vendor/bin/vapor deploy development --message='${gitCommitMessage}'"
|
||||||
break
|
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 = entry.msg
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
commitMessage = commitMessage.replace("'", "`")
|
||||||
return commitMessage
|
return commitMessage
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
|
|
||||||
<div class="ml-12">
|
<div class="ml-12">
|
||||||
<div class="mt-2 text-gray-600 dark:text-gray-400 text-sm">
|
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ environments:
|
|||||||
domain: production.vapor-explore.izyim.com
|
domain: production.vapor-explore.izyim.com
|
||||||
memory: 1024
|
memory: 1024
|
||||||
cli-memory: 512
|
cli-memory: 512
|
||||||
database: vapor-laravel-poc-db
|
database: cief-amazon-rds-mysql
|
||||||
storage: vapor-laravel-explore-production
|
storage: vapor-laravel-explore-production
|
||||||
runtime: 'docker'
|
runtime: 'docker'
|
||||||
timeout: 180
|
timeout: 180
|
||||||
@@ -20,7 +20,7 @@ environments:
|
|||||||
domain: staging.vapor-explore.izyim.com
|
domain: staging.vapor-explore.izyim.com
|
||||||
memory: 1024
|
memory: 1024
|
||||||
cli-memory: 512
|
cli-memory: 512
|
||||||
database: vapor-laravel-poc-db
|
database: cief-amazon-rds-mysql
|
||||||
storage: vapor-laravel-explore-staging
|
storage: vapor-laravel-explore-staging
|
||||||
runtime: 'docker'
|
runtime: 'docker'
|
||||||
timeout: 180
|
timeout: 180
|
||||||
@@ -35,7 +35,7 @@ environments:
|
|||||||
domain: dev.vapor-explore.izyim.com
|
domain: dev.vapor-explore.izyim.com
|
||||||
memory: 1024
|
memory: 1024
|
||||||
cli-memory: 512
|
cli-memory: 512
|
||||||
database: vapor-laravel-poc-db
|
database: cief-amazon-rds-mysql
|
||||||
storage: vapor-laravel-explore-development
|
storage: vapor-laravel-explore-development
|
||||||
runtime: 'docker'
|
runtime: 'docker'
|
||||||
timeout: 180
|
timeout: 180
|
||||||
|
|||||||
Reference in New Issue
Block a user