From 5280f174563583ccb47bac0c89b1eb9d9ba6b777 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 27 Jul 2021 11:43:23 +0000 Subject: [PATCH] Added Jenkinsfile --- Jenkinsfile | 107 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..e398b21 --- /dev/null +++ b/Jenkinsfile @@ -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/' + } + + } + } + + } + } + + } +} \ No newline at end of file