reformat jenkinsfile again x5

This commit is contained in:
Drake Marino 2024-06-06 18:32:51 -05:00
parent bdc69a5dc0
commit bf53db3524

124
Jenkinsfile vendored
View File

@ -12,52 +12,45 @@ pipeline {
} }
stage('Build API & UI') { stage('Build API & UI') {
parallel { parallel {
stage('API Build Process') { stage('Build API') {
stages { steps {
stage('Start API') { sh '''docker image prune -f
steps { docker build --no-cache -t fbla-api .
sh '''docker image prune -f docker-compose down
docker build --no-cache -t fbla-api . docker-compose up -d'''
docker-compose down }
docker-compose up -d''' }
}
}
stage('Run Tests') { stage('UI Web Build') {
steps { steps {
sh '''dart pub install sh 'flutter build web --release --base-href /fbla/'
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('Build Linux') { stage('UI Linux Build') {
steps { steps {
sh 'flutter build linux --release' 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') { stage('Deploy and Save') {
parallel { 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 { steps {
script { script {
def remote = [ 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"
}
}
}
}
}
}
} }
} }
} }