Added Jenkinsfile

This commit is contained in:
admin 2021-07-27 11:43:23 +00:00
parent 7738a807f6
commit 5280f17456
1 changed files with 107 additions and 0 deletions

107
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,107 @@
pipeline {
agent any
stages {
stage('Pull') {
steps {
git(url: 'http://git.fufle.net/Community/CureNet.git', branch: '${BRANCH_NAME}', credentialsId: '799188a2-c281-4e4c-b78f-c82132ea792b', poll: true)
}
}
stage('Install') {
parallel {
stage('Frontend') {
steps {
dir(path: 'frontend') {
sh 'npm ci'
}
}
}
stage('Backend') {
steps {
dir(path: 'backend') {
sh 'composer install'
}
}
}
}
}
stage('Configure') {
parallel {
stage('Frontend') {
steps {
dir(path: 'frontend') {
sh 'echo skip'
}
}
}
stage('Backend') {
steps {
dir(path: 'backend') {
sh 'composer dump-env dev'
}
}
}
}
}
stage('Test') {
parallel {
stage('Frontend') {
steps {
dir(path: 'frontend') {
sh 'echo skip'
}
}
}
stage('Backend') {
steps {
dir(path: 'backend') {
sh 'php vendor/bin/phpunit'
}
}
}
}
}
stage('Deploy') {
parallel {
stage('Frontend') {
steps {
dir(path: 'frontend') {
sh 'ssh web@fufle.net touch /web/fufle.net/curenet/dev/frontend/REMOVEME'
sh 'ssh web@fufle.net rm -rf /web/fufle.net/curenet/dev/frontend/*'
sh 'scp -r dist/* web@fufle.net:/web/fufle.net/curenet/dev/frontend/'
}
}
}
stage('Backend') {
steps {
dir(path: 'backend') {
sh 'ssh web@fufle.net touch /web/fufle.net/curenet/dev/backend/REMOVEME'
sh 'ssh web@fufle.net rm -rf /web/fufle.net/curenet/dev/backend/*'
sh 'scp -r ./ web@fufle.net:/web/fufle.net/curenet/dev/backend/'
}
}
}
}
}
}
}