Terst
This commit is contained in:
Vendored
+15
-60
@@ -1,75 +1,30 @@
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
options {
|
||||
timestamps()
|
||||
buildDiscarder(logRotator(numToKeepStr: '10'))
|
||||
}
|
||||
agent none
|
||||
|
||||
stages {
|
||||
stage('Build Docker Image') {
|
||||
steps {
|
||||
sh '''
|
||||
docker build \
|
||||
-t cpp-mingw-vcpkg:latest \
|
||||
-f docker/cpp-mingw-vcpkg/Dockerfile .
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build Linux') {
|
||||
agent { label 'linux' }
|
||||
steps {
|
||||
sh '''
|
||||
docker run --rm \
|
||||
-v "$PWD:/workspace" \
|
||||
-w /workspace \
|
||||
cpp-mingw-vcpkg:latest \
|
||||
bash -c "
|
||||
rm -rf build/linux &&
|
||||
cmake -S . -B build/linux -G Ninja \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_TOOLCHAIN_FILE=/opt/vcpkg/scripts/buildsystems/vcpkg.cmake &&
|
||||
cmake -S . -B build/linux -G Ninja -DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build build/linux
|
||||
"
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build Windows MinGW') {
|
||||
stage('Check Windows Agent') {
|
||||
agent { label 'windows' }
|
||||
steps {
|
||||
sh '''
|
||||
docker run --rm \
|
||||
-v "$PWD:/workspace" \
|
||||
-w /workspace \
|
||||
cpp-mingw-vcpkg:latest \
|
||||
bash -c "
|
||||
rm -rf build/windows &&
|
||||
cmake -S . -B build/windows -G Ninja \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_TOOLCHAIN_FILE=/opt/vcpkg/scripts/buildsystems/vcpkg.cmake \
|
||||
-DVCPKG_TARGET_TRIPLET=x64-mingw-static \
|
||||
-DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc \
|
||||
-DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ &&
|
||||
cmake --build build/windows
|
||||
"
|
||||
bat '''
|
||||
echo Windows agent works
|
||||
hostname
|
||||
where cl
|
||||
where cmake
|
||||
where ninja
|
||||
where git
|
||||
java -version
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
stage('Package') {
|
||||
steps {
|
||||
sh '''
|
||||
mkdir -p artifacts
|
||||
tar -czf artifacts/linux-build.tar.gz -C build linux
|
||||
zip -r artifacts/windows-build.zip build/windows
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
stage('Archive') {
|
||||
steps {
|
||||
archiveArtifacts artifacts: 'artifacts/*', fingerprint: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,24 +1,14 @@
|
||||
FROM ubuntu:24.04
|
||||
FROM mcr.microsoft.com/windows/servercore:ltsc2022
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV VCPKG_ROOT=/opt/vcpkg
|
||||
ENV PATH="${VCPKG_ROOT}:${PATH}"
|
||||
SHELL ["cmd", "/S", "/C"]
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
build-essential \
|
||||
mingw-w64 \
|
||||
cmake \
|
||||
ninja-build \
|
||||
git \
|
||||
curl \
|
||||
zip \
|
||||
unzip \
|
||||
tar \
|
||||
pkg-config \
|
||||
ca-certificates \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
RUN powershell -Command `
|
||||
Invoke-WebRequest https://aka.ms/vs/17/release/vs_buildtools.exe -OutFile C:\vs_buildtools.exe; `
|
||||
Start-Process C:\vs_buildtools.exe -ArgumentList '--quiet --wait --norestart --nocache --installPath C:\BuildTools --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.VC.CMake.Project' -Wait; `
|
||||
Remove-Item C:\vs_buildtools.exe
|
||||
|
||||
RUN git clone https://github.com/microsoft/vcpkg.git ${VCPKG_ROOT} \
|
||||
&& ${VCPKG_ROOT}/bootstrap-vcpkg.sh
|
||||
RUN powershell -Command `
|
||||
git clone https://github.com/microsoft/vcpkg C:\vcpkg; `
|
||||
C:\vcpkg\bootstrap-vcpkg.bat
|
||||
|
||||
WORKDIR /workspace
|
||||
WORKDIR C:\workspace
|
||||
Reference in New Issue
Block a user