From bf53db352405ea113484483035440377b900510c Mon Sep 17 00:00:00 2001 From: drake Date: Thu, 6 Jun 2024 18:32:51 -0500 Subject: [PATCH] reformat jenkinsfile again x5 --- Jenkinsfile | 124 ++++++++++++++++++++++++---------------------------- 1 file changed, 56 insertions(+), 68 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index afac067..dc7c596 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,52 +12,45 @@ pipeline { } stage('Build API & UI') { parallel { - stage('API Build Process') { - stages { - stage('Start API') { - steps { - sh '''docker image prune -f - docker build --no-cache -t fbla-api . - docker-compose down - docker-compose up -d''' - } - } + stage('Build API') { + steps { + sh '''docker image prune -f + docker build --no-cache -t fbla-api . + docker-compose down + docker-compose up -d''' + } + } - stage('Run Tests') { - steps { - sh '''dart pub install - dart run ./test/fbla_api_test.dart''' - } - } - } - } - stage('UI Build Process') { - stages { - stage('Build') { - parallel { - stage('Web Build') { - steps { - sh 'flutter build web --release --base-href /fbla/' - } - } + stage('UI Web Build') { + steps { + sh 'flutter build web --release --base-href /fbla/' + } + } - stage('Build Linux') { - steps { - sh 'flutter build linux --release' - } - } + stage('UI Linux Build') { + steps { + sh 'flutter build linux --release' + } + } + + stage('UI APK Build') { + steps { + sh 'flutter build apk --release' + } + } + } + } - stage('Build APK') { - steps { - sh 'flutter build apk --release' - } - } - } - } stage('Deploy and Save') { parallel { - stage('Deploy Web Local') { + stage('Run API Tests') { + steps { + sh '''dart pub install + dart run ./test/fbla_api_test.dart''' + } + } + stage('Deploy Local Web UI') { steps { script { def remote = [ @@ -110,35 +103,30 @@ pipeline { } } } + stage('Deploy Remote Web UI') { + when { + expression { + env.BRANCH_NAME == 'main' + } + } + steps { + script { + def remote = [ + name: 'MarinoDev', + host: 'marinodev.com', + port: 21098, + user: '${env.JOBLINK_REMOTE_USER}', + identityFile: '/var/jenkins_home/marinoDevPrivateKey', + passphrase: '${env.JOBLINK_REMOTE_PASSWD}', + allowAnyHosts: true, + ] + sshRemove(path: '/home/${env.JOBLINK_REMOTE_USER}/public_html/fbla', remote: remote) + sshPut(from: '/var/jenkins_home/workspace/fbla-ui_main/build/web/', into: '/home/${env.JOBLINK_REMOTE_USER}/public_html/', remote: remote) + sshCommand remote: remote, command: "mv /home/${env.JOBLINK_REMOTE_USER}/public_html/web /home/${env.JOBLINK_REMOTE_USER}/public_html/fbla" + } + } + } } - } - - stage('Deploy Remote') { - when { - expression { - env.BRANCH_NAME == 'main' - } - } - steps { - script { - def remote = [ - name: 'MarinoDev', - host: 'marinodev.com', - port: 21098, - user: '${env.JOBLINK_REMOTE_USER}', - identityFile: '/var/jenkins_home/marinoDevPrivateKey', - passphrase: '${env.JOBLINK_REMOTE_PASSWD}', - allowAnyHosts: true, - ] - sshRemove(path: '/home/${env.JOBLINK_REMOTE_USER}/public_html/fbla', remote: remote) - sshPut(from: '/var/jenkins_home/workspace/fbla-ui_main/build/web/', into: '/home/${env.JOBLINK_REMOTE_USER}/public_html/', remote: remote) - sshCommand remote: remote, command: "mv /home/${env.JOBLINK_REMOTE_USER}/public_html/web /home/${env.JOBLINK_REMOTE_USER}/public_html/fbla" - } - } - } - } - } - } } } } \ No newline at end of file