mirror of
https://github.com/lxsang/antos-frontend.git
synced 2024-12-27 09:48:21 +01:00
Generate build script per branch
All checks were successful
antos-devel/pipeline/head This commit looks good
All checks were successful
antos-devel/pipeline/head This commit looks good
This commit is contained in:
parent
c377a80d0d
commit
cbb8948dbf
27
Jenkinsfile
vendored
27
Jenkinsfile
vendored
@ -27,39 +27,28 @@ pipeline{
|
|||||||
}
|
}
|
||||||
stages
|
stages
|
||||||
{
|
{
|
||||||
stage('Prebuild build') {
|
stage('Build release') {
|
||||||
steps {
|
steps {
|
||||||
sh'''
|
sh'''
|
||||||
export -p | tee env.source
|
export -p | tee build.source
|
||||||
'''
|
cat <<"EOF" >>build.source
|
||||||
sshCommand remote: remote, command: '''
|
|
||||||
set -e
|
|
||||||
export WORKSPACE=$(realpath "./jenkins/workspace/antos")
|
|
||||||
cd $WORKSPACE
|
cd $WORKSPACE
|
||||||
npm install terser
|
npm install terser
|
||||||
npm install uglifycss
|
npm install uglifycss
|
||||||
npm install typescript
|
npm install typescript
|
||||||
npm install @types/jquery
|
npm install @types/jquery
|
||||||
'''
|
|
||||||
}
|
buildir="build"
|
||||||
}
|
|
||||||
stage('Build release') {
|
|
||||||
steps {
|
|
||||||
sshCommand remote: remote, command: '''
|
|
||||||
set -e
|
|
||||||
export WORKSPACE=$(realpath "./jenkins/workspace/antos")
|
|
||||||
cd $WORKSPACE
|
|
||||||
source env.source
|
|
||||||
buildir="build/$GIT_BRANCH"
|
|
||||||
[ -d "$buildir" ] && rm -rf "$buildir"
|
[ -d "$buildir" ] && rm -rf "$buildir"
|
||||||
export BUILDDIR="$WORKSPACE/$buildir/opt/www/htdocs/os"
|
export BUILDDIR="$WORKSPACE/$buildir/opt/www/htdocs/os"
|
||||||
make release
|
make release
|
||||||
cp -rf d.ts "$WORKSPACE/$buildir"
|
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
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user