8000 Feature/jenkins pipeline (#3293) · MohammedDeveloper/arangodb@8b975c6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8b975c6

Browse files
authored
Feature/jenkins pipeline (arangodb#3293)
1 parent e7e3852 commit 8b975c6

6 files changed

+117
-30
lines changed

Installation/Pipeline/Jenkinsfile.groovy

Lines changed: 38 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,6 @@ def checkEnabledEdition(edition, text) {
210210
}
211211

212212
def checkEnabledMaintainer(maintainer, os, text) {
213-
if (os == 'windows' && maintainer != 'maintainer') {
214-
echo "Not ${text} ${maintainer} because ${maintainer} is not enabled under Windows"
215-
return false
216-
}
217-
218213
if (maintainer == 'maintainer' && ! useMaintainer) {
219214
echo "Not ${text} ${maintainer} because ${maintainer} is not enabled"
220215
return false
@@ -421,18 +416,27 @@ def checkCommitMessages() {
421416
if (env.BRANCH_NAME == "devel" || env.BRANCH_NAME == "3.2") {
422417
echo "build of main branch"
423418

424-
useLinux = true
425-
useMac = true
426-
useWindows = true
427-
428-
useCommunity = true
429-
useEnterprise = true
430-
431-
useMaintainer = true
432-
useUser = true
419+
restrictions = [
420+
// OS EDITION MAINTAINER
421+
"build-linux-community-maintainer" : true,
422+
"build-linux-enterprise-maintainer" : true,
423+
"build-linux-community-user" : true,
424+
"build-linux-enterprise-user" : true,
425+
"build-mac-community-user" : true,
426+
"build-mac-enterprise-user" : true,
427+
"build-windows-community-user" : true,
428+
"build-windows-enterprise-user" : true,
433429

434-
// runResilience = false
435-
runTests = true
430+
// OS EDITION MAINTAINER MODE ENGINE
431+
"test-linux-community-maintainer-singleserver-mmfiles" : true,
432+
"test-linux-community-maintainer-singleserver-rocksdb" : true,
433+
"test-linux-enterprise-user-cluster-mmfiles" : true,
434+
"test-linux-enterprise-user-cluster-rocksdb" : true,
435+
"test-mac-community-user-singleserver-rocksdb" : true,
436+
"test-mac-enterprise-user-cluster-rocksdb" : true,
437+
"test-windows-community-user-singleserver-rocksdb" : true,
438+
"test-windows-mac-enterprise-user-cluster-rocksdb" : true,
439+
]
436440
}
437441
else if (env.BRANCH_NAME =~ /^PR-/) {
438442
echo "build of PR"
@@ -441,9 +445,7 @@ def checkCommitMessages() {
441445
// OS EDITION MAINTAINER
442446
"build-linux-community-maintainer" : true,
443447
"build-linux-enterprise-maintainer" : true,
444-
"build-mac-community-maintainer" : true,
445448
"build-mac-enterprise-user" : true,
446-
"build-windows-community-maintainer" : true,
447449
"build-windows-enterprise-maintainer" : true,
448450

449451
// OS EDITION MAINTAINER MODE ENGINE
@@ -633,6 +635,12 @@ def getTests(os, edition, maintainer, mode, engine) {
633635
["shell_replication", "shell_replication", ""],
634636
rspecify(os, "http_replication")
635637
]
638+
639+
if (maintainer == "maintainer" && os == "linux") {
640+
test += [
641+
["recovery", "recovery", ""]
642+
]
643+
}
636644
}
637645

638646
return tests
@@ -747,7 +755,7 @@ def executeTests(os, edition, maintainer, mode, engine, portInit, archDir, arch,
747755
echo "caught error, copying log to ${logFileFailed}: ${msg}"
748756

749757
fileOperations([
750-
fileCreateOperation(fileContent: 'TEST FAILED: ${msg}', fileName: "${archDir}-FAIL.txt")
758+
fileCreateOperation(fileContent: "TEST FAILED: ${msg}", fileName: "${archDir}-FAIL.txt")
751759
])
752760

753761
if (os == 'linux' || os == 'mac') {
@@ -1028,27 +1036,29 @@ def buildEdition(os, edition, maintainer) {
10281036
}
10291037
}
10301038
else if (os == 'windows') {
1031-
def tmpDir = "${arch}/tmp"
1039+
// def tmpDir = "${arch}/tmp"
10321040

1033-
fileOperations([
1034-
folderCreateOperation(tmpDir)
1035-
])
1041+
// fileOperations([
1042+
// folderCreateOperation(tmpDir)
1043+
// ])
10361044

10371045
// withEnv(["TMPDIR=${tmpDir}", "TEMPDIR=${tmpDir}", "TMP=${tmpDir}",
10381046
// "_MSPDBSRV_ENDPOINT_=${edition}-${env.BUILD_TAG}", "GYP_USE_SEPARATE_MSPDBSRV=1"]) {
1039-
powershell ". .\\Installation\\Pipeline\\windows\\build_${os}_${edition}.ps1"
1047+
// powershell ". .\\Installation\\Pipeline\\windows\\build_${os}_${edition}.ps1"
10401048
// }
10411049

1042-
fileOperations([
1043-
folderDeleteOperation(tmpDir)
1044-
])
1050+
// fileOperations([
1051+
// folderDeleteOperation(tmpDir)
1052+
// ])
1053+
1054+
powershell ". .\\Installation\\Pipeline\\windows\\build_${os}_${edition}_${maintainer}.ps1"
10451055
}
10461056
}
10471057
catch (exc) {
10481058
def msg = exc.toString()
10491059

10501060
fileOperations([
1051-
fileCreateOperation(fileContent: 'BUILD FAILED: ${msg}', fileName: "${archDir}-FAIL.txt")
1061+
fileCreateOperation(fileContent: "BUILD FAILED: ${msg}", fileName: "${archDir}-FAIL.txt")
10521062
])
10531063

10541064
if (os == 'linux' || os == 'mac') {

Installation/Pipeline/build_OS_EDITION_MAINTAINER.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fi
2222
MAINTAINER=""
2323

2424
if [ "$maintainer" == maintainer ]; then
25-
MAINTAINER="-DUSE_MAINTAINER_MODE=On"
25+
MAINTAINER="-DUSE_MAINTAINER_MODE=On -DUSE_FAILURE_TESTS=On"
2626
type="${type}_maintainer"
2727
elif [ "$maintainer" == user ]; then
2828
MAINTAINER="-DUSE_MAINTAINER_MODE=Off"
@@ -66,7 +66,6 @@ echo "PWD: `pwd`" | tee -a $logdir/build.log
6666
cmake \
6767
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
6868
-DUSE_CATCH_TESTS=On \
69-
-DUSE_FAILURE_TESTS=On \
7069
-DDEBUG_SYNC_REPLICATION=On \
7170
$MAINTAINER \
7271
$ENTERPRISE \
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
$logdir="windows-community-maintainer/01-build"
2+
3+
$ErrorActionPreference="Stop"
4+
$vcpath=$(Get-ItemProperty HKLM:\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VC7)."14.0"
5+
$buildOptions = "-DUSE_MAINTAINER_MODE=Off -DUSE_ENTERPRISE=Off -DUSE_CATCH_TESTS=On -DUSE_FAILURE_TESTS=On -DDEBUG_SYNC_REPLICATION=On -DCMAKE_BUILD_TYPE=RelWithDebInfo -DSKIP_PACKAGING=On" 10000
6+
7+
Remove-Item -Force -Recurse ${logdir} -ErrorAction SilentlyContinue
8+
New-Item -Force -ItemType Directory ${logdir} -ErrorAction SilentlyContinue
9+
10+
if (Get-Command docker -errorAction SilentlyContinue) {
11+
$buildOptions += " -DOPENSSL_INCLUDE_DIR=`"`$env:OPENSSL_INCLUDE_DIR`" -DLIB_EAY_RELEASE=`"`$env:LIB_EAY_RELEASE`" -DSSL_EAY_RELEASE=`"`$env:SSL_EAY_RELEASE`" -DLIB_EAY_RELEASE_DLL=`"`$env:LIB_EAY_RELEASE_DLL`" -DSSL_EAY_RELEASE_DLL=`"`$env:SSL_EAY_RELEASE_DLL"
12+
$volume = "$env:WORKSPACE"
13+
$volume += ":C:\arangodb"
14+
$build = @'
15+
$ErrorActionPreference="Stop"
16+
New-Item -ItemType Directory -Force -Path c:\arangodb\build
17+
cd c:\arangodb\build
18+
cmake .. -G "Visual Studio 14 2015 Win64" ${buildOptions}
19+
cmake --build . --config RelWithDebInfo
20+
exit $LastExitCode
21+
'@
22+
$build > buildscript.ps1
23+
24+
docker run --rm -v $volume m0ppers/build-container powershell C:\arangodb\buildscript.ps1 | Set-Content -PassThru ${logdir}\build.log
25+
} else {
26+
$env:GYP_MSVS_OVERRIDE_PATH="${vcpath}\bin"
27+
$env:CC="${vcpath}\bin\cl.exe"
28+
$env:CXX="${vcpath}\bin\cl.exe"
29+
30+
$env
31+
32+
New-Item -ItemType Directory -Force -Path build
33+
cd build
34+
35+
Invoke-Expression "cmake .. -G `"Visual Studio 15 2017 Win64`" ${buildOptions} | Set-Content -PassThru ..\${logdir}\build.log"
36+
cmake --build . --config RelWithDebInfo | Add-Content -PassThru ..\${logdir}\build.log
37+
38+
cd ..
39+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
$logdir="windows-enterprise-maintainer/01-build"
2+
3+
$ErrorActionPreference="Stop"
4+
$vcpath=$(Get-ItemProperty HKLM:\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VC7)."14.0"
5+
$buildOptions = "-DUSE_MAINTAINER_MODE=Off -DUSE_ENTERPRISE=On -DUSE_CATCH_TESTS=On -DUSE_FAILURE_TESTS=On -DDEBUG_SYNC_REPLICATION=On -DCMAKE_BUILD_TYPE=RelWithDebInfo -DSKIP_PACKAGING=On"
6+
7+
Remove-Item -Force -Recurse ${logdir} -ErrorAction SilentlyContinue
8+
New-Item -Force -ItemType Directory ${logdir} -ErrorAction SilentlyContinue
9+
10+
if (Get-Command docker -errorAction SilentlyContinue) {
11+
$buildOptions += " -DOPENSSL_INCLUDE_DIR=`"`$env:OPENSSL_INCLUDE_DIR`" -DLIB_EAY_RELEASE=`"`$env:LIB_EAY_RELEASE`" -DSSL_EAY_RELEASE=`"`$env:SSL_EAY_RELEASE`" -DLIB_EAY_RELEASE_DLL=`"`$env:LIB_EAY_RELEASE_DLL`" -DSSL_EAY_RELEASE_DLL=`"`$env:SSL_EAY_RELEASE_DLL"
12+
$volume = "$env:WORKSPACE"
13+
$volume += ":C:\arangodb"
14+
$build = @'
15+
$ErrorActionPreference="Stop"
16+
New-Item -ItemType Directory -Force -Path c:\arangodb\build
17+
cd c:\arangodb\build
18+
cmake .. -G "Visual Studio 14 2015 Win64" ${buildOptions}
19+
cmake --build . --config RelWithDebInfo
20+
exit $LastExitCode
21+
'@
22+
$build > buildscript.ps1
23+
24+
docker run --rm -v $volume m0ppers/build-container powershell C:\arangodb\buildscript.ps1 | Set-Content -PassThru ${logdir}\build.log
25+
} else {
26+
$env:GYP_MSVS_OVERRIDE_PATH="${vcpath}\bin"
27+
$env:CC="${vcpath}\bin\cl.exe"
28+
$env:CXX="${vcpath}\bin\cl.exe"
29+
30+
$env
31+
32+
New-Item -ItemType Directory -Force -Path build
33+
cd build
34+
35+
Invoke-Expression "cmake .. -G `"Visual Studio 15 2017 Win64`" ${buildOptions} | Set-Content -PassThru ..\${logdir}\build.log"
36+
cmake --build . --config RelWithDebInfo | Add-Content -PassThru ..\${logdir}\build.log
37+
38+
cd ..
39+
}

0 commit comments

Comments
 (0)
0