49 lines
1.3 KiB
Groovy
49 lines
1.3 KiB
Groovy
pipeline {
|
|
agent {
|
|
label 'linux'
|
|
}
|
|
options {
|
|
buildDiscarder(
|
|
logRotator(
|
|
numToKeepStr: '5'
|
|
)
|
|
)
|
|
}
|
|
|
|
stages {
|
|
|
|
stage('Build') {
|
|
steps {
|
|
script {
|
|
// Use bash as the shell for these commands
|
|
sh '''
|
|
#!/bin/bash
|
|
unset WORKSPACE
|
|
unset WORKSPACE_TMP
|
|
dart pub get
|
|
dart doc
|
|
tar -cvf docs.tgz doc/api/*
|
|
'''
|
|
}
|
|
}
|
|
}
|
|
|
|
stage('Deploy') {
|
|
steps {
|
|
sh 'flutter pub publish -f --skip-validation'
|
|
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'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
post {
|
|
always {
|
|
archiveArtifacts artifacts: 'docs.tgz', onlyIfSuccessful: true
|
|
}
|
|
}
|
|
}
|