52 lines
1.2 KiB
Groovy
52 lines
1.2 KiB
Groovy
pipeline {
|
|
agent any
|
|
|
|
options {
|
|
timestamps()
|
|
buildDiscarder(logRotator(numToKeepStr: '10'))
|
|
}
|
|
|
|
stages {
|
|
stage('Build Linux') {
|
|
steps {
|
|
sh '''
|
|
mkdir -p build/linux
|
|
g++ main.cpp -o build/linux/test_app
|
|
'''
|
|
}
|
|
}
|
|
|
|
stage('Build Windows') {
|
|
steps {
|
|
sh '''
|
|
mkdir -p build/windows
|
|
x86_64-w64-mingw32-g++ main.cpp -o build/windows/test_app.exe
|
|
'''
|
|
}
|
|
}
|
|
|
|
stage('Run Linux') {
|
|
steps {
|
|
sh '''
|
|
./build/linux/test_app
|
|
'''
|
|
}
|
|
}
|
|
|
|
stage('Package') {
|
|
steps {
|
|
sh '''
|
|
cd build
|
|
tar -czf linux-build.tar.gz linux
|
|
zip -r windows-build.zip windows
|
|
'''
|
|
}
|
|
}
|
|
|
|
stage('Archive') {
|
|
steps {
|
|
archiveArtifacts artifacts: 'build/linux-build.tar.gz, build/windows-build.zip', fingerprint: true
|
|
}
|
|
}
|
|
}
|
|
} |