From 0a651d6ccfc9f789e54fe9161f30ccf67219f21e Mon Sep 17 00:00:00 2001 From: Louis Royer Date: Tue, 10 Mar 2020 17:34:07 +0100 Subject: [PATCH] Update --- jenkinsfile | 52 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/jenkinsfile b/jenkinsfile index 0ff76ab..0642cb0 100644 --- a/jenkinsfile +++ b/jenkinsfile @@ -1,23 +1,31 @@ -pipeline { - agent any + pipeline { + agent any - stages { - stage('build') { - steps { - sh 'javac -cp "./src" -d "./bin" $(find . -iname "*.java" -type f) -Xlint:deprecation' - } - } - stage('run') { - steps { - sh 'ls' - } - } - } - post { - success { - archiveArtifacts artifacts: 'client.jar', fingerprint: true - archiveArtifacts artifacts: 'server.jar', fingerprint: true - archiveArtifacts artifacts: 'sources.tar.gz', fingerprint: false - } - } -} + stages { + stage('build') { + steps { + sh 'mkdir bin' + sh 'javac -cp "./src" -d "./bin" $(find . -iname "*.java" -type f) -Xlint:deprecation' + sh 'echo "BUILDING CLIENT"' + sh 'echo Main-Class: clientP2P/ClientP2P > MANIFEST.MF' + sh 'jar -cvmf MANIFEST.MF client.jar $(find . \( -iname "*.class" -and ! -iwholename "*/clientP2P/*.class" \) -type f)' + sh 'echo "BUILDING SERVER"' + sh 'echo Main-Class: javaProjet2020/Server > MANIFEST.MF' + sh 'jar -cvmf MANIFEST.MF server.jar $(find . \( -iname "*.class" -and ! -iwholename "*/serverP2P/*.class" \) -type f)' + 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: 'sources.tar.gz', fingerprint: true + } + } + }