From bfdc2a289c9d872c67bfdb829883ed0739506445 Mon Sep 17 00:00:00 2001 From: Max Nanis Date: Thu, 26 Jun 2025 18:50:04 +0700 Subject: jenkinsfile build and check size if master --- Jenkinsfile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 913cc4d..91a8ebf 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -38,6 +38,27 @@ pipeline { } } } + + stage('npm.build') { + when { + expression { env.BRANCH_NAME == 'master' } + } + steps { + sh "/usr/local/bin/npm run build" + + script { + def filePath = "dist/grl-panel.js" + def minSize = 500 * 1024 + def size = sh(script: "stat -c%s ${filePath}", returnStdout: true).trim().toInteger() + + if (size < minSize) { + error "Build ${filePath} is too small: ${size} bytes" + } else { + echo "Build size is acceptable: ${size} bytes" + } + } + } + } } } -- cgit v1.2.3