Skip to content

Commit

Permalink
Revert mac signing change. (#761)
Browse files Browse the repository at this point in the history
  • Loading branch information
steelhead31 authored Jul 31, 2023
1 parent 9c044ec commit 906d888
Showing 1 changed file with 13 additions and 50 deletions.
63 changes: 13 additions & 50 deletions pipelines/build/common/openjdk_build_pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ class Build {

// Use BUILD_REF override if specified
vendorTestBranches = buildConfig.BUILD_REF ?: vendorTestBranches

try {
context.println 'Running smoke test'
context.stage('smoke test') {
Expand Down Expand Up @@ -332,10 +332,10 @@ class Build {
context.string(name: 'VENDOR_TEST_REPOS', value: vendorTestRepos),
context.string(name: 'VENDOR_TEST_BRANCHES', value: vendorTestBranches),
context.string(name: 'TIME_LIMIT', value: '1')
]
]
currentBuild.result = testJob.getResult()
return testJob.getResult()

}
} catch (Exception e) {
context.println "Failed to execute test: ${e.message}"
Expand All @@ -351,7 +351,7 @@ class Build {
def jdkBranch = getJDKBranch()
def jdkRepo = getJDKRepo()
def openj9Branch = (buildConfig.SCM_REF && buildConfig.VARIANT == 'openj9') ? buildConfig.SCM_REF : 'master'

List testList = buildConfig.TEST_LIST
List dynamicList = buildConfig.DYNAMIC_LIST
List numMachines = buildConfig.NUM_MACHINES
Expand Down Expand Up @@ -463,7 +463,7 @@ class Build {
wait: true
currentBuild.result = testJob.getResult()
context.node('worker') {
//Copy Taps files from downstream test jobs if files available.
//Copy Taps files from downstream test jobs if files available.
context.sh 'rm -f workspace/target/AQAvitTaps/*.tap'
try {
context.timeout(time: 2, unit: 'HOURS') {
Expand Down Expand Up @@ -543,7 +543,7 @@ class Build {
}
}

targets.each { targetMode, targetTests ->
targets.each { targetMode, targetTests ->
try {
context.println "Remote trigger: ${targetTests}"
remoteTargets["${targetTests}"] = {
Expand Down Expand Up @@ -1478,13 +1478,11 @@ class Build {
context.unstash 'jmods'
context.withEnv(["macos_base_path=${macos_base_path}"]) {
// groovylint-disable
try {
context.sh '''
context.sh '''
#!/bin/bash
set -eu
echo "Signing JMOD files"
TMP_DIR="${macos_base_path}/"
MACSIGNSTRING="Apple Certification Authority"
ENTITLEMENTS="$WORKSPACE/entitlements.plist"
FILES=$(find "${TMP_DIR}" -perm +111 -type f -o -name '*.dylib' -type f || find "${TMP_DIR}" -perm /111 -type f -o -name '*.dylib' -type f)
for f in $FILES
Expand All @@ -1493,46 +1491,11 @@ class Build {
dir=$(dirname "$f")
file=$(basename "$f")
mv "$f" "${dir}/unsigned_${file}"
curl --fail -o "$f" -F file="@${dir}/unsigned_${file}" -F entitlements="@$ENTITLEMENTS" https://cbi.eclipse.org/macos/codesign/sign
TESTMACSIGN=`grep -i "$MACSIGNSTRING" "$f"|wc -l`
if [ $TESTMACSIGN -gt 0 ]
then
echo "Code Signed"
chmod --reference="${dir}/unsigned_${file}" "$f"
rm -rf "${dir}/unsigned_${file}"
else
max_iterations=20
iteration=1
while [ $iteration -le $max_iterations ]
do
echo "Code Not Signed - Have Another Try"
sleep 1
curl --fail -o "$f" -F file="@${dir}/unsigned_${file}" -F entitlements="@$ENTITLEMENTS" https://cbi.eclipse.org/macos/codesign/sign
TESTMACSIGN2=`grep -i "$MACSIGNSTRING" "$f"|wc -l`
if [ $TESTMACSIGN2 -gt 0 ]
then
echo "$f Signed OK On Attempt $iteration"
chmod --reference="${dir}/unsigned_${file}" "$f"
rm -rf "${dir}/unsigned_${file}"
break
else
echo "$f Failed Signing On Attempt $iteration"
iteration=$((iteration+1))
fi
if [ $iteration -eq $max_iterations ]
then
echo "Reached Max Attempts = $max_iterations"
exit 1
fi
done
fi
curl -o "$f" -F file="@${dir}/unsigned_${file}" -F entitlements="@$ENTITLEMENTS" https://cbi.eclipse.org/macos/codesign/sign
chmod --reference="${dir}/unsigned_${file}" "$f"
rm -rf "${dir}/unsigned_${file}"
done
'''
} catch (e) {
context.println("Failed to Perform Signing")
currentBuild.result = 'FAILURE'
}

// groovylint-enable
}
context.stash name: 'signed_jmods', includes: "${macos_base_path}/**/*"
Expand Down Expand Up @@ -1707,7 +1670,7 @@ class Build {
}
}

/*
/*
this function should only be used in pr-tester
*/
def updateGithubCommitStatus(STATE, MESSAGE) {
Expand Down Expand Up @@ -1759,7 +1722,7 @@ class Build {
context.println "Executing tests: ${buildConfig.TEST_LIST}"
context.println "Build num: ${env.BUILD_NUMBER}"
context.println "File name: ${filename}"

def enableReproducibleCompare = Boolean.valueOf(buildConfig.ENABLE_REPRODUCIBLE_COMPARE)
def enableTests = Boolean.valueOf(buildConfig.ENABLE_TESTS)
def enableInstallers = Boolean.valueOf(buildConfig.ENABLE_INSTALLERS)
Expand Down Expand Up @@ -1962,7 +1925,7 @@ class Build {
platform = 'x86-64_' + buildConfig.TARGET_OS
} else {
platform = buildConfig.ARCHITECTURE + '_' + buildConfig.TARGET_OS
}
}
if ( !(platform == 'riscv64_linux' || platform =='aarch64_windows') ) {
if ( !(buildConfig.JAVA_TO_BUILD == 'jdk8u' && platform == 's390x_linux') ) {
context.echo "Remote trigger Eclipse Temurin AQA_Test_Pipeline job with ${platform} ${buildConfig.JAVA_TO_BUILD}"
Expand Down

0 comments on commit 906d888

Please sign in to comment.