From 885a6ef32f4f0ad995c05bac8f0f5c0f7fa1400f Mon Sep 17 00:00:00 2001 From: first_admin Date: Sun, 1 Sep 2024 21:47:58 +0000 Subject: [PATCH] Update Jenkinsfile --- Jenkinsfile | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d5fafa0..0d13360 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,7 +2,7 @@ pipeline { agent { label 'agent1' } stages { - stage('Install Dependencies') { + stage('Weryfikacja podpisów cyfrowych') { steps { script { def dependencies = sh(script: "jq -r '.dependencies | keys[]' package.json", returnStdout: true).split('\n') @@ -24,13 +24,6 @@ pipeline { sh "wget https://registry.npmjs.org/${dep}/-/\$(jq -r '.dependencies[\"${dep}\"]' package.json)/${dep}.tgz.asc" sh "gpg --verify ${dep}.tgz.asc ${dep}-*.tgz" } - - sh """ - FILENAME=\$(ls ${dep}-*.tgz) - SHA256_SUM=\$(sha256sum \$FILENAME | awk '{ print \$1 }') - echo \"\${SHA256_SUM} \$FILENAME\" > ${dep}.sha256 - sha256sum -c ${dep}.sha256 - """ } if (unsignedPackages.size() > 0) { @@ -42,6 +35,29 @@ pipeline { } } + stage('Weryfikacja sum kontrolnych') { + steps { + script { + def dependencies = sh(script: "jq -r '.dependencies | keys[]' package.json", returnStdout: true).split('\n') + + for (dep in dependencies) { + sh """ + FILENAME=\$(ls ${dep}-*.tgz) + SHA256_SUM=\$(sha256sum \$FILENAME | awk '{ print \$1 }') + echo \"\${SHA256_SUM} \$FILENAME\" > ${dep}.sha256 + sha256sum -c ${dep}.sha256 + """ + } + } + } + } + + stage('Instalacja zależności') { + steps { + sh 'npm install' + } + } + stage('Test') { steps { sh 'npm test'