From 81e3310eef0a61db87ebabaa7e1b513118744377 Mon Sep 17 00:00:00 2001 From: Jesse James Isler Date: Thu, 9 Jun 2022 11:09:49 +0200 Subject: [PATCH] Work damnit! --- Jenkinsfile | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3f1e5c9..fc83c42 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,22 +1,37 @@ pipeline { - agent any + agent none stages { stage('Install') { + agent { + docker { + image 'node:lts-bullseye-slim' + args '-p 3000:3000' + } + } steps { sh 'npm install' + stash includes: 'node_modules/', name: 'node_modules' } } stage('Test') { + agent { + docker { + image 'node:lts-bullseye-slim' + args '-p 3000:3000' + } + } parallel { stage('Static code analysis') { steps { + unstash 'node_modules' sh 'npm run-script lint' } } stage('Unit tests') { steps { + unstash 'node_modules' sh 'npm run-script test' } } @@ -25,6 +40,7 @@ pipeline { stage('Build') { steps { + unstash 'node_modules' sh 'npm run-script build' stash includes: 'dist/', name: 'dist' }