gluon/contrib/ci/Jenkinsfile

49 lines
1.3 KiB
Groovy

def lualint() {
sh 'luacheck package scripts targets'
}
def shelllint() {
sh 'find -not \( -path './*.git/*' -prune \) -not \( -path './package/*' -prune \) -not \( -path './scripts/*' -prune \) -type f -exec bash -c 'if echo $1 | grep -qE ".*\.sh$" || head -n1 $1 | grep -qE "^#.*(sh|bash|dash|ksh)$"; then shellcheck -f gcc $1; fi' _ {} \;'
sh 'find package -type f -exec bash -c 'if echo $1 | grep -qE ".*\.sh$" || head -n1 $1 | grep -qE "^#.*(sh|bash|dash|ksh)$"; then shellcheck -x -f gcc -s sh -eSC2039,SC1091,SC2155,SC2034 $1; fi' _ {} \;'
sh 'find scripts -type f -exec bash -c 'if echo $1 | grep -qE ".*\.sh$" || head -n1 $1 | grep -qE "^#.*(sh|bash|dash|ksh)$"; then shellcheck -f gcc -x -e SC2154,SC1090,SC2181,SC2155,SC2148,SC2034,SC2148 $1; fi' _ {} \;'
}
run_lint_set = [
"task1": {
lualint()
},
"task2": {
shelllint()
}
]
pipeline {
agent { label 'gluon-docker' }
environment {
GLUON_SITEDIR = "contrib/ci/minimal-site"
GLUON_TARGET = "x86-64"
BUILD_LOG = "1"
}
stages {
stage('lint') {
steps {
script {
parallel(run_lint_set)
}
}
}
stage('docs') {
steps {
sh 'make -C docs html'
}
}
stage('build') {
steps {
sh 'make update'
sh 'test -d /dl_cache && ln -s /dl_cache openwrt/dl || true'
sh 'make -j$(nproc) V=s'
}
}
}
}