1
0
mirror of https://github.com/lxsang/ant-http synced 2024-07-01 12:59:47 +02:00

Update Jenkinsfile

This commit is contained in:
Dany LE 2022-08-02 16:39:40 +02:00 committed by GitHub
parent 81e73669e6
commit b766884997
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

100
Jenkinsfile vendored
View File

@ -1,11 +1,23 @@
def remote = [:] def build_antd()
remote.name = 'workstation' {
remote.host = 'workstation' sh '''
remote.user = 'dany' set -e
remote.identityFile = '/var/jenkins_home/.ssh/id_rsa' export WORKSPACE=$(realpath "./jenkins/workspace/ant-http")
remote.allowAnyHosts = true cd $WORKSPACE
remote.agent = false [ -d build ] && rm -rf build
remote.logLevel = 'INFO' mkdir -p build/$arch/etc/systemd/system/
mkdir -p build/$arch/opt/www
[ -f Makefile ] && make clean
libtoolize
aclocal
autoconf
automake --add-missing
./configure --prefix=/usr
make
DESTDIR=$WORKSPACE/build/$arch make install
cp $WORKSPACE/build/usr/etc/antd-config.ini build/$arch/opt/www/config.ini.example
'''
}
pipeline{ pipeline{
agent { node{ label'master' }} agent { node{ label'master' }}
@ -27,29 +39,61 @@ pipeline{
} }
stages stages
{ {
stage('Build') { stage('Build AMD64') {
agent {
docker {
image ' xsangle/ci-tools:latest-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
}
}
steps { steps {
sshCommand remote: remote, command: ''' script{
set -e env.arch = "amd64"
export WORKSPACE=$(realpath "./jenkins/workspace/ant-http") }
cd $WORKSPACE // call
[ -d build ] && rm -rf build }
mkdir -p build/etc/systemd/system/ }
mkdir -p build/opt/www stage('Build ARM64') {
libtoolize agent {
aclocal docker {
autoconf image ' xsangle/ci-tools:latest-arm64'
automake --add-missing // Run the container on the node specified at the
./configure --prefix=/usr // top-level of the Pipeline, in the same workspace,
make // rather than on a new node entirely:
DESTDIR=$WORKSPACE/build make install reuseNode true
cp $WORKSPACE/build/usr/etc/antd-config.ini build/opt/www/config.ini.example }
''' }
steps {
script{
env.arch = "arm64"
}
// call
}
}
stage('Build ARM') {
agent {
docker {
image ' xsangle/ci-tools:latest-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
}
}
steps {
script{
env.arch = "arm"
}
// call
}
}
stage("Archive") {
steps{
script { script {
// only useful for any master branch
//if (env.BRANCH_NAME =~ /^master/) {
archiveArtifacts artifacts: 'build/', fingerprint: true, onlyIfSuccessful: true archiveArtifacts artifacts: 'build/', fingerprint: true, onlyIfSuccessful: true
//}
} }
} }
} }