reformat jenkinsfile again x5
This commit is contained in:
parent
bdc69a5dc0
commit
bf53db3524
124
Jenkinsfile
vendored
124
Jenkinsfile
vendored
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user