Projet_JAVA_P2P_STRI2A/Jenkinsfile
Louis 33f1829cdc
All checks were successful
flavien's git/Projet_JAVA_P2P_STRI2A/pipeline/pr-master This commit looks good
Update Jenkinsfile to add tracker.jar generation
2020-03-22 09:38:56 +01:00

36 lines
1.4 KiB
Groovy

pipeline {
agent any
stages {
stage('build') {
steps {
sh 'javac -cp "./src" -d "./bin" $(find . -iname "*.java" -type f) -Xlint:deprecation -encoding UTF8'
sh 'echo "BUILDING CLIENT"'
sh 'echo Main-Class: clientP2P/ClientP2P > MANIFEST.MF'
sh 'jar -cvmf MANIFEST.MF client.jar $(find bin/ -maxdepth 1 -mindepth 1 -printf "-C bin %f\n")'
sh 'echo "BUILDING SERVER"'
sh 'echo Main-Class: serverP2P/ServerP2P > MANIFEST.MF'
sh 'jar -cvmf MANIFEST.MF server.jar $(find bin/ -maxdepth 1 -mindepth 1 -printf "-C bin %f\n")'
sh 'echo "BUILDING TRACKER"'
sh 'echo Main-Class: tracker/Tracker > MANIFEST.MF'
sh 'jar -cvmf MANIFEST.MF tracker.jar $(find bin/ -maxdepth 1 -mindepth 1 -printf "-C bin %f\n")'
sh 'echo "CREATING sources.tar.gz"'
sh 'tar -zcvf sources.tar.gz src/'
}
}
stage('run') {
steps {
sh 'ls'
}
}
}
post {
success {
archiveArtifacts artifacts: 'client.jar', fingerprint: true
archiveArtifacts artifacts: 'server.jar', fingerprint: true
archiveArtifacts artifacts: 'tracker.jar', fingerprint: true
archiveArtifacts artifacts: 'sources.tar.gz', fingerprint: true
}
}
}