mirror of
https://github.com/YatopiaMC/Yatopia.git
synced 2024-11-22 10:35:42 +01:00
Changes to Jenkinsfile (#451)
* Maybe this works? Changed/Added: + Archive artifacts in its own build stage? + Gradlew clean + Delete the work dir in Paper + Always clean Ws after build? * chmod dir??? i don't see this necessary but maybe? * do not clean when build publish? * Remove jenkins workspace? Maybe this fixes somethings? * turned off git gc Co-authored-by: krolik-exe <69214078+krolik-exe@users.noreply.github.com>
This commit is contained in:
parent
923775033a
commit
920fdd1703
21
Jenkinsfile
vendored
21
Jenkinsfile
vendored
@ -5,10 +5,13 @@ pipeline {
|
||||
stage('Cleanup') {
|
||||
steps {
|
||||
scmSkip(deleteBuild: true, skipPattern:'.*\\[CI-SKIP\\].*')
|
||||
sh 'git config --global gc.auto 0'
|
||||
sh 'rm -rf ./target'
|
||||
sh 'rm -rf ./Paper/Paper-API ./Paper/Paper-Server ./Paper/work/Spigot/Spigot-API ./Paper/work/Spigot/Spigot-Server'
|
||||
sh 'rm -rf ./Paper/Paper-API ./Paper/Paper-Server ./Paper/work'
|
||||
sh 'rm -rf ./Yatopia-API ./Yatopia-Server'
|
||||
sh 'chmod +x ./gradlew'
|
||||
sh 'find /home/jenkins/workspace/YatopiaMC_Yatopia_ver_1.16.5 -type d -exec chmod 755 {} \;'
|
||||
sh 'chmod +x ./gradlew
|
||||
sh './gradlew clean'
|
||||
}
|
||||
}
|
||||
stage('Init project & submodules') {
|
||||
@ -51,7 +54,7 @@ pipeline {
|
||||
) {
|
||||
withCredentials([usernamePassword(credentialsId: 'jenkins-deploy', usernameVariable: 'ORG_GRADLE_PROJECT_mavenUsername', passwordVariable: 'ORG_GRADLE_PROJECT_mavenPassword')]) {
|
||||
sh '''
|
||||
./gradlew clean build publish
|
||||
./gradlew build publish
|
||||
mkdir -p "./target"
|
||||
basedir=$(pwd)
|
||||
paperworkdir="$basedir/Paper/work"
|
||||
@ -69,12 +72,16 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
success {
|
||||
archiveArtifacts "target/*.jar"
|
||||
|
||||
stage('Archive Jars') {
|
||||
steps {
|
||||
archiveArtifacts(artifacts: 'target/*.jar', fingerprint: true)
|
||||
}
|
||||
failure {
|
||||
}
|
||||
post {
|
||||
always {
|
||||
cleanWs()
|
||||
sh 'rm -rf /home/jenkins/workspace/YatopiaMC_Yatopia_ver_1.16.5'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user