Commit b5b8f020 authored by Markus Frosch's avatar Markus Frosch 📣
Browse files

Implement GitLab builds

parent 7fdb7c1d
Pipeline #3742 failed with stage
in 13 minutes and 55 seconds
## Editors
.*.sw[op]
*~
## Code
/icinga2/
\ No newline at end of file
......@@ -3,30 +3,27 @@ stages:
variables:
#BITS: 32 or 64
CMAKE_BUILD_TYPE: RelWithDebInfo
CMAKE_GENERATOR: "Visual Studio 15 2017 Win${BITS}"
BOOST_ROOT: 'C:\local\boost_1_69_0-Win${BITS}'
BOOST_LIBRARYDIR: 'C:\local\boost_1_69_0-Win${BITS}\lib${BITS}-msvc-14.1'
BISON_BINARY: 'C:\ProgramData\chocolatey\lib\winflexbison3\tools\win_bison.exe'
FLEX_BINARY: 'C:\ProgramData\chocolatey\lib\winflexbison3\tools\win_flex.exe'
OPENSSL_ROOT_DIR: 'C:\local\OpenSSL_1_1_1b-Win${BITS}'
# for more vars see build.ps1
#CMAKE_BUILD_TYPE: RelWithDebInfo
CMAKE_BUILD_TYPE: Debug
UPSTREAM_GIT_BRANCH: tools/windows
.build: &build
stage: build
tags:
- win
before_script:
- Get-Item env:BOOST_LIBRARYDIR
- windows
script:
- icinga-build-package
- powershell.exe .\source.ps1
- powershell.exe .\build.ps1
cache:
key: "${CI_COMMIT_REF_NAME}-${CI_JOB_NAME}"
paths:
- Build/
# artifacts:
# paths:
# - build/*
# expire_in: 1 week
- icinga2\
artifacts:
paths:
- icinga2\Build\Icinga*.msi
- icinga2\Build\*.nupkg
expire_in: 1 week
Win32:
<<: *build
......
Set-PSDebug -Trace 1
if (-not (Test-Path env:BITS)) {
$env:BITS = 64
}
if (-not (Test-Path env:CMAKE_BUILD_TYPE)) {
$env:CMAKE_BUILD_TYPE = "RelWithDebInfo"
}
# Settings for the Icinga build environment on Windows
if ($env:BITS -eq 64) {
$env:CMAKE_GENERATOR = "Visual Studio 15 2017 Win64"
} else {
$env:CMAKE_GENERATOR = "Visual Studio 15 2017"
}
$env:BOOST_ROOT = "C:\local\boost_1_69_0-Win${env:BITS}"
$env:BOOST_LIBRARYDIR = "C:\local\boost_1_69_0-Win${env:BITS}\lib${env:BITS}-msvc-14.1"
$env:BISON_BINARY = 'C:\ProgramData\chocolatey\lib\winflexbison3\tools\win_bison.exe'
$env:FLEX_BINARY = 'C:\ProgramData\chocolatey\lib\winflexbison3\tools\win_flex.exe'
$env:OPENSSL_ROOT_DIR = "C:\local\OpenSSL_1_1_1b-Win${env:BITS}"
cd .\icinga2
& .\tools\win32\load-vsenv.ps1
& powershell.exe .\tools\win32\configure.ps1
if ($LastExitCode -ne 0) { throw "Error during configure" }
Remove-Item Build\Icinga*.msi
Remove-Item -Recurse "C:\Program Files\Icinga2\*"
& powershell.exe .\tools\win32\build.ps1
if ($LastExitCode -ne 0) { throw "Error during build" }
& powershell.exe .\tools\win32\test.ps1
if ($LastExitCode -ne 0) { throw "Error during test" }
# Cloning icinga2 source code to workdir
Set-PSDebug -Trace 1
$workdir = ".\icinga2"
if (-not (Test-Path env:UPSTREAM_GIT_URL)) {
$env:UPSTREAM_GIT_URL = 'https://github.com/Icinga/icinga2.git'
}
if (-not (Test-Path env:UPSTREAM_GIT_BRANCH)) {
$env:UPSTREAM_GIT_BRANCH = 'master'
}
if (-not (Test-Path $workdir)) {
& git clone -b "${env:UPSTREAM_GIT_BRANCH}" "${env:UPSTREAM_GIT_URL}" "${workdir}"
if ($LASTEXITCODE -ne 0) { throw "git clone failed!" }
}
cd "${workdir}"
$currentOrigin = & git config remote.origin.url
if ($currentOrigin -ne $env:UPSTREAM_GIT_URL) {
& git remote set-url origin $env:UPSTREAM_GIT_URL
if ($LASTEXITCODE -ne 0) { throw "git remote set-url failed!" }
}
git fetch origin -p
git checkout -f "${env:UPSTREAM_GIT_BRANCH}"
git reset --hard "origin/${env:UPSTREAM_GIT_BRANCH}"
git clean -fxd
git status
cd ..\
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment