reformat jenkinsfile again x6

This commit is contained in:
Drake Marino 2024-06-06 18:49:18 -05:00
parent bf53db3524
commit 96b608d0c1

54
Jenkinsfile vendored
View File

@ -3,7 +3,8 @@ pipeline {
stages { stages {
stage('Flutter Cleanup/Update') { stage('Flutter Cleanup/Update') {
steps { steps {
sh '''flutter upgrade --force sh '''cd fbla_ui
flutter upgrade --force
flutter pub upgrade flutter pub upgrade
flutter --version flutter --version
flutter doctor flutter doctor
@ -14,39 +15,39 @@ pipeline {
parallel { parallel {
stage('Build API') { stage('Build API') {
steps { steps {
sh '''docker image prune -f sh '''cd fbla-api
docker image prune -f
docker build --no-cache -t fbla-api . docker build --no-cache -t fbla-api .
docker-compose down docker-compose down
docker-compose up -d''' docker-compose up -d'''
} }
} }
stage('UI Web Build') { stage('UI Web Build') {
steps { steps {
sh 'flutter build web --release --base-href /fbla/' sh '''cd fbla_ui
flutter build web --release --base-href /fbla/'''
} }
} }
stage('UI Linux Build') { stage('UI Linux Build') {
steps { steps {
sh 'flutter build linux --release' sh '''cd fbla_ui
flutter build linux --release'''
} }
} }
stage('UI APK Build') { stage('UI APK Build') {
steps { steps {
sh 'flutter build apk --release' sh '''cd fbla_ui
flutter build apk --release'''
} }
} }
} }
} }
stage('Deploy and Save') { stage('Deploy and Save') {
parallel { parallel {
stage('Run API Tests') { stage('Run API Tests') {
steps { steps {
sh '''dart pub install sh '''cd fbla_ui
dart pub get
dart run ./test/fbla_api_test.dart''' dart run ./test/fbla_api_test.dart'''
} }
} }
@ -54,10 +55,10 @@ pipeline {
steps { steps {
script { script {
def remote = [ def remote = [
name: 'HostServer', name : 'HostServer',
host: '192.168.0.216', host : '192.168.0.216',
user: '${env.JOBLINK_LOCAL_USER}', user : '${env.JOBLINK_LOCAL_USER}',
password: '${env.JOBLINK_LOCAL_PASSWD}', password : '${env.JOBLINK_LOCAL_PASSWD}',
allowAnyHosts: true, allowAnyHosts: true,
] ]
sshRemove(path: '/home/${env.JOBLINK_LOCAL_USER}/fbla-webserver/webfiles/fbla', remote: remote) sshRemove(path: '/home/${env.JOBLINK_LOCAL_USER}/fbla-webserver/webfiles/fbla', remote: remote)
@ -66,18 +67,17 @@ pipeline {
} }
} }
} }
stage('Save Other Builds') { stage('Save Other Builds') {
steps { steps {
script { script {
def remote = [ def remote = [
name: 'HostServer', name : 'HostServer',
host: '192.168.0.216', host : '192.168.0.216',
user: '${env.JOBLINK_LOCAL_USER}', user : '${env.JOBLINK_LOCAL_USER}',
password: '${env.JOBLINK_LOCAL_PASSWD}', password : '${env.JOBLINK_LOCAL_PASSWD}',
allowAnyHosts: true, allowAnyHosts: true,
] ]
if(env.BRANCH_NAME == 'main') { if (env.BRANCH_NAME == 'main') {
sshRemove(path: '/home/${env.JOBLINK_LOCAL_USER}/builds/main/linux', remote: remote) sshRemove(path: '/home/${env.JOBLINK_LOCAL_USER}/builds/main/linux', remote: remote)
sshCommand remote: remote, command: "mkdir /home/${env.JOBLINK_LOCAL_USER}/builds/main/linux" sshCommand remote: remote, command: "mkdir /home/${env.JOBLINK_LOCAL_USER}/builds/main/linux"
sshPut(from: 'build/linux/x64/release', into: '/home/${env.JOBLINK_LOCAL_USER}/builds/main/linux', remote: remote) sshPut(from: 'build/linux/x64/release', into: '/home/${env.JOBLINK_LOCAL_USER}/builds/main/linux', remote: remote)
@ -112,12 +112,12 @@ pipeline {
steps { steps {
script { script {
def remote = [ def remote = [
name: 'MarinoDev', name : 'MarinoDev',
host: 'marinodev.com', host : 'marinodev.com',
port: 21098, port : 21098,
user: '${env.JOBLINK_REMOTE_USER}', user : '${env.JOBLINK_REMOTE_USER}',
identityFile: '/var/jenkins_home/marinoDevPrivateKey', identityFile : '/var/jenkins_home/marinoDevPrivateKey',
passphrase: '${env.JOBLINK_REMOTE_PASSWD}', passphrase : '${env.JOBLINK_REMOTE_PASSWD}',
allowAnyHosts: true, allowAnyHosts: true,
] ]
sshRemove(path: '/home/${env.JOBLINK_REMOTE_USER}/public_html/fbla', remote: remote) sshRemove(path: '/home/${env.JOBLINK_REMOTE_USER}/public_html/fbla', remote: remote)