aboutsummaryrefslogtreecommitdiff
path: root/Jenkinsfile
diff options
context:
space:
mode:
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"
+ }
+ }
+ }
+ }
}
}