improve: optimize pipeline + clean C based project before build
Some checks reported errors
gitea-sync/antos/pipeline/head Something is wrong with the build of this commit

This commit is contained in:
DanyLE 2024-03-10 09:11:02 +01:00
parent 7ce96d1c31
commit 84e7a1a1a2
2 changed files with 37 additions and 18 deletions

32
Jenkinsfile vendored
View File

@ -1,4 +1,4 @@
def build_rust_and_frontend() { def build_rust_mod() {
sh '''#!/bin/bash sh '''#!/bin/bash
set -e set -e
set -x set -x
@ -52,7 +52,7 @@ def build_server_and_backend() {
PLATFORM=$arch \ PLATFORM=$arch \
FRONTEND_IGNORE=true \ FRONTEND_IGNORE=true \
LUAFCGI_IGNORE=true \ LUAFCGI_IGNORE=true \
make make clean_c all
''' '''
} }
@ -112,7 +112,23 @@ pipeline {
''' '''
} }
} }
stage('Build RUST + FRONTEND AMD64') { stage('Build Frontend (TS)') {
agent {
node { label'workstation' }
}
steps {
sh'''
mkdir -p build/frontend/
DESTDIR=$(realpath build/frontend/) make frontend
for arch in arm arm64 amd64; do
mkdir build/$arch
cp -rf build/frontend/* build/$arch/
done
rm -rf build/frontend
'''
}
}
stage('Build RUST MODULE AMD64') {
agent { agent {
node { label'workstation' } node { label'workstation' }
} }
@ -120,10 +136,10 @@ pipeline {
script { script {
env.arch = 'amd64' env.arch = 'amd64'
} }
build_rust_and_frontend() build_rust_mod()
} }
} }
stage('Build RUST + FRONTEND ARM64') { stage('Build RUST MODULE ARM64') {
agent { agent {
node { label'workstation' } node { label'workstation' }
} }
@ -131,10 +147,10 @@ pipeline {
script { script {
env.arch = 'arm64' env.arch = 'arm64'
} }
build_rust_and_frontend() build_rust_mod()
} }
} }
stage('Build RUST + FRONTEND ARM') { stage('Build RUST MODULE ARM') {
agent { agent {
node { label'workstation' } node { label'workstation' }
} }
@ -142,7 +158,7 @@ pipeline {
script { script {
env.arch = 'arm' env.arch = 'arm'
} }
build_rust_and_frontend() build_rust_mod()
} }
} }

View File

@ -86,16 +86,19 @@ else
@echo "Ignore building $@" @echo "Ignore building $@"
endif endif
clean: clean_c:
@echo "Clean all target" @echo "Clean all C based modules"
make -C antd/ant-http clean -make -C antd/ant-http clean
make -C antd/antd-fcgi-plugin clean -make -C antd/antd-fcgi-plugin clean
make -C antd/antd-tunnel-plugin clean -make -C antd/antd-tunnel-plugin clean
make -C antd/antd-wvnc-plugin clean -make -C antd/antd-wvnc-plugin clean
make -C antd/antd-tunnel-publishers clean -make -C antd/antd-tunnel-publishers clean
make -C antd/luasec clean -make -C antd/luasec clean
make -C antd/luasocket clean -make -C antd/luasocket clean
make -C antd/silk clean -make -C antd/silk clean
clean: clean_c
@echo "Clean Rust project and output DIR"
RUSTUP_HOME=$(RUSTUP_HOME) CARGO_HOME=$(CARGO_HOME) \ RUSTUP_HOME=$(RUSTUP_HOME) CARGO_HOME=$(CARGO_HOME) \
. $(CARGO_HOME)/env && cargo clean \ . $(CARGO_HOME)/env && cargo clean \
--manifest-path=$(ROOT_DIR)/antd/luafcgi/Cargo.toml \ --manifest-path=$(ROOT_DIR)/antd/luafcgi/Cargo.toml \