aboutsummaryrefslogtreecommitdiff
path: root/Jenkinsfile
diff options
context:
space:
mode:
authorMax Nanis2025-06-26 18:50:04 +0700
committerMax Nanis2025-06-26 18:50:04 +0700
commitbfdc2a289c9d872c67bfdb829883ed0739506445 (patch)
treee6c94588590e97b81013a109a3bcbf77019681e1 /Jenkinsfile
parentb644bd50c690b1d3e5213b8c377576bc53956f52 (diff)
downloadpanel-ui-bfdc2a289c9d872c67bfdb829883ed0739506445.tar.gz
panel-ui-bfdc2a289c9d872c67bfdb829883ed0739506445.zip
jenkinsfile build and check size if master
Diffstat (limited to 'Jenkinsfile')
-rw-r--r--Jenkinsfile21
1 files changed, 21 insertions, 0 deletions
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"
+ }
+ }
+ }
+ }
}
}