2024-07-08 22:05:17 -07:00
|
|
|
pipeline {
|
2024-07-08 22:15:59 -07:00
|
|
|
agent {
|
|
|
|
label 'linux'
|
|
|
|
}
|
2024-07-08 23:38:58 -07:00
|
|
|
options {
|
|
|
|
buildDiscarder(
|
|
|
|
logRotator(
|
|
|
|
numToKeepStr: '5'
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
2024-07-08 22:05:17 -07:00
|
|
|
|
|
|
|
stages {
|
2024-07-09 21:24:07 -07:00
|
|
|
|
2024-07-08 22:05:17 -07:00
|
|
|
stage('Build') {
|
|
|
|
steps {
|
2024-07-09 21:24:07 -07:00
|
|
|
script {
|
|
|
|
// Use bash as the shell for these commands
|
|
|
|
sh '''
|
|
|
|
#!/bin/bash
|
|
|
|
unset WORKSPACE
|
2024-07-09 21:45:49 -07:00
|
|
|
unset WORKSPACE_TMP
|
|
|
|
dart pub get
|
2024-07-09 21:24:07 -07:00
|
|
|
dart doc
|
|
|
|
tar -cvf docs.tgz doc/api/*
|
2024-07-10 02:14:08 -07:00
|
|
|
rm -rf ServerCode
|
2024-07-09 21:24:07 -07:00
|
|
|
'''
|
|
|
|
}
|
2024-07-08 22:05:17 -07:00
|
|
|
}
|
|
|
|
}
|
2024-07-08 22:11:58 -07:00
|
|
|
|
|
|
|
stage('Deploy') {
|
2024-07-08 22:05:17 -07:00
|
|
|
steps {
|
2024-07-09 16:07:40 -07:00
|
|
|
sh 'flutter pub publish -f --skip-validation'
|
2024-07-09 00:11:27 -07:00
|
|
|
sh 'git clone git@github.com:ariascreations/ServerCode'
|
|
|
|
sh 'rsync -a --progress -h --delete doc/api/ ServerCode/api.zontreck.com/dartdocs/libac/'
|
|
|
|
dir('ServerCode') {
|
|
|
|
sh 'git add --all .'
|
|
|
|
sh 'git commit -m "[BOT] Publish LibAC DartDocs"'
|
|
|
|
sh 'git push --all'
|
|
|
|
}
|
2024-07-10 02:14:08 -07:00
|
|
|
sh 'rm -rf ServerCode'
|
2024-07-08 22:05:17 -07:00
|
|
|
}
|
|
|
|
}
|
2024-07-09 21:48:19 -07:00
|
|
|
|
|
|
|
stage('Delete Workspace') {
|
|
|
|
steps {
|
|
|
|
// Delete the workspace directory
|
|
|
|
deleteDir()
|
|
|
|
}
|
|
|
|
}
|
2024-07-08 22:05:17 -07:00
|
|
|
}
|
2024-07-08 22:11:58 -07:00
|
|
|
}
|