Skip to content

Commit

Permalink
First iteration of Jenkins overhaul
Browse files Browse the repository at this point in the history
  • Loading branch information
Karm committed Jul 5, 2023
1 parent 3b40a21 commit 7858d96
Show file tree
Hide file tree
Showing 18 changed files with 80 additions and 477 deletions.
43 changes: 1 addition & 42 deletions jenkins/jobs/builds/Constants.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,7 @@ class Constants {
./jenkins/jobs/scripts/mandrel_linux_build.sh
'''

static final String LINUX_GRAAL_VM_BRANCH_BUILD_CMD = '''
pushd mandrel
git config --global user.email "[email protected]"
git config --global user.name "Karm"
git remote add upstream ${GRAALVM_REPO}
git fetch upstream ${GRAALVM_BRANCH}
git config --global merge.ours.driver true
echo -e \'\\n**/suite.py merge=ours\\n\' >> .gitattributes
git add .gitattributes
git commit -m x
git merge -s recursive -Xdiff-algorithm=patience --no-edit upstream/${GRAALVM_BRANCH}
echo MANDREL_DESCRIBE="$(git describe --always --long)"
popd
''' + LINUX_BUILD_CMD

static final String WINDOWS_BUILD_CMD = '''
setx MX_PYTHON C:\\Python310\\python.exe
set MX_PYTHON=C:\\Python310\\python.exe
set JAVA_HOME=%WORKSPACE%\\JDK
powershell -Command "Remove-Item -ErrorAction Ignore -Recurse \\"$Env:JAVA_HOME\\";"
set downloadCmd=^
Expand All @@ -69,14 +51,7 @@ class Constants {
if not exist "%JAVA_HOME%\\bin\\java.exe" (
echo "Cannot find downloaded JDK. Quitting..."
)
if NOT "%BRANCH_OR_TAG%"=="%BRANCH_OR_TAG:23=%" (
echo "USE VS 2022"
set "PATH=C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\Build;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\Tools;%PATH%"
)
if NOT "%BRANCH_OR_TAG%"=="%BRANCH_OR_TAG:master=%" (
echo "USE VS 2022"
set "PATH=C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\Build;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\Tools;%PATH%"
)
set "PATH=C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\Build;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\Tools;%PATH%"
pushd mandrel
for /F "tokens=*" %%i in (\'"git describe --always --long"\') do set M_DESCRIBE=%%i
powershell -Command "$c=(Select-String -Path \'%JAVA_HOME%\\release\' -Pattern \'^^SOURCE\').Line -replace \'SOURCE=.*:([a-z0-9]*).*\', \'$1\';Write-Host MANDREL_DESCRIBE=%M_DESCRIBE% JDK git: $c"
Expand All @@ -85,20 +60,4 @@ class Constants {
jenkins\\jobs\\scripts\\mandrel_windows_build.bat
'''

static final String WINDOWS_GRAAL_VM_BRANCH_BUILD_CMD = '''
pushd mandrel
git remote add upstream %GRAALVM_REPO%
git fetch upstream %GRAALVM_BRANCH%
git config --global merge.ours.driver true
@echo off
echo(>>.gitattributes
echo **/suite.py merge=ours>>.gitattributes
@echo on
type .gitattributes
git add .gitattributes
git commit -m x
git merge -s recursive -Xdiff-algorithm=patience --no-edit upstream/%GRAALVM_BRANCH%
popd
''' + WINDOWS_BUILD_CMD
}
131 changes: 0 additions & 131 deletions jenkins/jobs/builds/mandrel_21_3_linux_build_matrix.groovy

This file was deleted.

130 changes: 0 additions & 130 deletions jenkins/jobs/builds/mandrel_21_3_windows_build_matrix.groovy

This file was deleted.

8 changes: 6 additions & 2 deletions jenkins/jobs/builds/mandrel_23_0_linux_build_matrix.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ matrixJob('mandrel-23-0-linux-build-matrix') {
labelExpression('LABEL', ['el8_aarch64', 'el8'])
text('JDK_VERSION',
'17',
'20'
'20',
'21'
)
text('JDK_RELEASE',
'ea',
Expand All @@ -19,6 +20,9 @@ matrixJob('mandrel-23-0-linux-build-matrix') {
logRotator {
numToKeep(10)
}
combinationFilter(
'!(JDK_VERSION=="21" && JDK_RELEASE=="ga")'
)
parameters {
choiceParam('REPOSITORY', Constants.REPOSITORY, 'Mandrel repo')
choiceParam(
Expand All @@ -45,7 +49,7 @@ matrixJob('mandrel-23-0-linux-build-matrix') {
)
stringParam(
'PACKAGING_REPOSITORY_BRANCH_OR_TAG',
'master',
'23.0',
'e.g. master if you use heads or some tag if you use tags.'
)
stringParam(
Expand Down
8 changes: 6 additions & 2 deletions jenkins/jobs/builds/mandrel_23_0_windows_build_matrix.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ matrixJob('mandrel-23-0-windows-build-matrix') {
labelExpression('LABEL', ['w2k19'])
text('JDK_VERSION',
'17',
'20'
'20',
'21'
)
text('JDK_RELEASE',
'ea',
Expand All @@ -19,6 +20,9 @@ matrixJob('mandrel-23-0-windows-build-matrix') {
logRotator {
numToKeep(10)
}
combinationFilter(
'!(JDK_VERSION=="21" && JDK_RELEASE=="ga")'
)
parameters {
choiceParam('REPOSITORY', Constants.REPOSITORY, 'Mandrel repo')
choiceParam(
Expand All @@ -45,7 +49,7 @@ matrixJob('mandrel-23-0-windows-build-matrix') {
)
stringParam(
'PACKAGING_REPOSITORY_BRANCH_OR_TAG',
'master',
'23.0',
'e.g. master if you use heads or some tag if you use tags.'
)
stringParam(
Expand Down
Loading

0 comments on commit 7858d96

Please sign in to comment.