mirror of
https://github.com/lxsang/luafcgi.git
synced 2025-02-23 12:22:49 +01:00
support cross compile in jenkinsfile
Some checks failed
gitea-sync/luafcgi/pipeline/head There was a failure building this commit
Some checks failed
gitea-sync/luafcgi/pipeline/head There was a failure building this commit
This commit is contained in:
parent
9ddf6467b4
commit
07aa4f4b79
51
Jenkinsfile
vendored
51
Jenkinsfile
vendored
@ -5,10 +5,27 @@ def build_luad() {
|
|||||||
export CARGO_HOME=/opt/rust/cargo
|
export CARGO_HOME=/opt/rust/cargo
|
||||||
. /opt/rust/cargo/env
|
. /opt/rust/cargo/env
|
||||||
cd $WORKSPACE
|
cd $WORKSPACE
|
||||||
|
TARGET=
|
||||||
|
case "$arch" in
|
||||||
|
amd64)
|
||||||
|
TARGET="x86_64-unknown-linux-gnu"
|
||||||
|
;;
|
||||||
|
arm64)
|
||||||
|
TARGET="aarch64-unknown-linux-gnu"
|
||||||
|
;;
|
||||||
|
arm)
|
||||||
|
TARGET="armv7-unknown-linux-gnueabihf"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "unknown target for architecture $arch"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
rustup target add $TARGET
|
||||||
mkdir -p build/$arch/opt/www/bin
|
mkdir -p build/$arch/opt/www/bin
|
||||||
DESTDIR=$WORKSPACE/build/$arch/opt/www/bin
|
DESTDIR=$WORKSPACE/build/$arch/opt/www/bin
|
||||||
cargo build --release
|
cargo build --target=$TARGET --release
|
||||||
cp target/release/luad $DESTDIR
|
cp target/$TARGET/release/luad $DESTDIR
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,16 +56,6 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Build AMD64') {
|
stage('Build AMD64') {
|
||||||
agent {
|
|
||||||
docker {
|
|
||||||
image 'xsangle/ci-tools:bionic-amd64'
|
|
||||||
// Run the container on the node specified at the
|
|
||||||
// top-level of the Pipeline, in the same workspace,
|
|
||||||
// rather than on a new node entirely:
|
|
||||||
reuseNode true
|
|
||||||
registryUrl 'http://workstation:5000/'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
env.arch = 'amd64'
|
env.arch = 'amd64'
|
||||||
@ -57,16 +64,6 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Build ARM64') {
|
stage('Build ARM64') {
|
||||||
agent {
|
|
||||||
docker {
|
|
||||||
image 'xsangle/ci-tools:bionic-arm64'
|
|
||||||
// Run the container on the node specified at the
|
|
||||||
// top-level of the Pipeline, in the same workspace,
|
|
||||||
// rather than on a new node entirely:
|
|
||||||
reuseNode true
|
|
||||||
registryUrl 'http://workstation:5000/'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
env.arch = 'arm64'
|
env.arch = 'arm64'
|
||||||
@ -75,16 +72,6 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Build ARM') {
|
stage('Build ARM') {
|
||||||
agent {
|
|
||||||
docker {
|
|
||||||
image 'xsangle/ci-tools:bionic-arm'
|
|
||||||
// Run the container on the node specified at the
|
|
||||||
// top-level of the Pipeline, in the same workspace,
|
|
||||||
// rather than on a new node entirely:
|
|
||||||
reuseNode true
|
|
||||||
registryUrl 'http://workstation:5000/'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
env.arch = 'arm'
|
env.arch = 'arm'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user