Generate build script per branch
All checks were successful
antos-devel/pipeline/head This commit looks good

This commit is contained in:
Dany LE 2022-09-16 13:18:56 +02:00 committed by GitHub
parent c377a80d0d
commit cbb8948dbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

45
Jenkinsfile vendored
View File

@ -27,39 +27,28 @@ pipeline{
} }
stages stages
{ {
stage('Prebuild build') {
steps {
sh'''
export -p | tee env.source
'''
sshCommand remote: remote, command: '''
set -e
export WORKSPACE=$(realpath "./jenkins/workspace/antos")
cd $WORKSPACE
npm install terser
npm install uglifycss
npm install typescript
npm install @types/jquery
'''
}
}
stage('Build release') { stage('Build release') {
steps { steps {
sshCommand remote: remote, command: ''' sh'''
set -e export -p | tee build.source
export WORKSPACE=$(realpath "./jenkins/workspace/antos") cat <<"EOF" >>build.source
cd $WORKSPACE cd $WORKSPACE
source env.source npm install terser
buildir="build/$GIT_BRANCH" npm install uglifycss
[ -d "$buildir" ] && rm -rf "$buildir" npm install typescript
export BUILDDIR="$WORKSPACE/$buildir/opt/www/htdocs/os" npm install @types/jquery
make release
cp -rf d.ts "$WORKSPACE/$buildir" buildir="build"
''' [ -d "$buildir" ] && rm -rf "$buildir"
export BUILDDIR="$WORKSPACE/$buildir/opt/www/htdocs/os"
make release
EOF
'''
sshScript remote: remote, script: "build.source"
script { script {
// only useful for any master branch // only useful for any master branch
//if (env.BRANCH_NAME =~ /^master/) { //if (env.BRANCH_NAME =~ /^master/) {
archiveArtifacts artifacts: 'build/', fingerprint: true archiveArtifacts artifacts: 'd.ts/, build/', fingerprint: true
//} //}
} }
} }