|
@@ -1,26 +1,24 @@
|
|
|
node {
|
|
node {
|
|
|
- // Utiliser la version spécifique de Node.js définie dans Jenkins
|
|
|
|
|
- tools {
|
|
|
|
|
- nodejs "NodeJS"
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- stage('Install dependencies') {
|
|
|
|
|
- sh 'npm install --legacy-peer-deps'
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- stage('Test') {
|
|
|
|
|
- dir("${env.WORKSPACE}/angular-client") {
|
|
|
|
|
- sh 'npm i @angular-devkit/build-angular'
|
|
|
|
|
-
|
|
|
|
|
- try {
|
|
|
|
|
- sh 'npm run test-ci'
|
|
|
|
|
- } catch(err) {
|
|
|
|
|
- sh 'echo TEST FAILED'
|
|
|
|
|
- junit 'target/surefire-reports/TESTS-TestSuite.xml/*.xml'
|
|
|
|
|
- throw err
|
|
|
|
|
|
|
+ // Set the desired Node.js version
|
|
|
|
|
+ withEnv(["PATH+NODEJS=/path/to/nodejs/bin"]) {
|
|
|
|
|
+ stage('Install dependencies') {
|
|
|
|
|
+ sh 'npm install --legacy-peer-deps'
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ stage('Test') {
|
|
|
|
|
+ dir("${env.WORKSPACE}/angular-client") {
|
|
|
|
|
+ sh 'npm i @angular-devkit/build-angular'
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ sh 'npm run test-ci'
|
|
|
|
|
+ } catch(err) {
|
|
|
|
|
+ sh 'echo TEST FAILED'
|
|
|
|
|
+ junit 'target/surefire-reports/TESTS-TestSuite.xml/*.xml'
|
|
|
|
|
+ throw err
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ // Other build steps, deployment, etc.
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- // Autres étapes de construction, déploiement, etc.
|
|
|
|
|
}
|
|
}
|