pull/144/head
commit
8016196b9a
@ -1,30 +1,41 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent {
|
agent {
|
||||||
node {
|
node {
|
||||||
label 'willa'
|
label 'willa'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
stages {
|
||||||
}
|
stage('build') {
|
||||||
stages {
|
when {
|
||||||
stage('build') {
|
branch 'master'
|
||||||
steps {
|
}
|
||||||
sh 'cd /home/administrator/apps/$IMAGE_NAME/;docker build -t registry.willaspace.com/willaspace/$IMAGE_NAME:latest .'
|
steps {
|
||||||
sh 'cd /home/administrator/apps/$IMAGE_NAME/;sudo ./BuildDocker'
|
sh 'cd /home/administrator/apps/${IMAGE_NAME}/;docker build -t registry.willaspace.com/willaspace/${IMAGE_NAME}:latest .'
|
||||||
}
|
sh 'cd /home/administrator/apps/${IMAGE_NAME}/;sudo ./BuildDocker'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('deploy to production') {
|
||||||
|
when {
|
||||||
|
branch 'master'
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
sh 'cd /home/administrator/apps/${IMAGE_NAME}/ ; docker-compose up -d'
|
||||||
|
sh 'docker exec willaengine bash -c "COMPOSER=composer-prod.json composer update"'
|
||||||
|
sh 'docker exec willaengine service cron start'
|
||||||
|
sh 'docker exec willaengine php artisan config:cache'
|
||||||
|
sh 'docker exec willaengine php artisan route:cache'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('deploy to staging') {
|
||||||
|
when {
|
||||||
|
branch 'dev'
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
sh 'echo ${IMAGE_NAME}-staging comming soon ...'
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
environment {
|
||||||
stage('deploy') {
|
IMAGE_NAME = 'willaengine'
|
||||||
steps {
|
|
||||||
sh 'cd /home/administrator/apps/$IMAGE_NAME/ ; docker-compose up -d'
|
|
||||||
sh 'docker exec willaengine bash -c "COMPOSER=composer-prod.json composer update"'
|
|
||||||
sh 'docker exec willaengine service cron start'
|
|
||||||
sh 'docker exec willaengine php artisan config:cache'
|
|
||||||
sh 'docker exec willaengine php artisan route:cache'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
environment {
|
|
||||||
IMAGE_NAME = 'willaengine'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in new issue