You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
pipeline {
|
|
|
|
agent {
|
|
|
|
node {
|
|
|
|
label 'willa'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stages {
|
|
|
|
stage('build') {
|
|
|
|
when {
|
|
|
|
branch 'master'
|
|
|
|
}
|
|
|
|
steps {
|
|
|
|
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 {
|
|
|
|
IMAGE_NAME = 'willaengine'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|