Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Resilience & Repeatability Of Linux Installers Packaging Process #747

Merged
merged 21 commits into from
Oct 5, 2023
Merged
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 106 additions & 8 deletions linux/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,59 @@ def uploadAlpineArtifacts(String buildArch) {
// currently only support x64 as buildArch
// set BUILDARCH environment variable for ${buildArch}
env.BUILDARCH = buildArch
jf 'rt u **/build/ospackage/temurin-*j*.apk apk/alpine/main/${BUILDARCH}/ --flat=true'
jf 'rt u **/build/ospackage/temurin-*src*.apk apk/alpine/main/${BUILDARCH}/ --flat=true'

steelhead31 marked this conversation as resolved.
Show resolved Hide resolved
def PackFiles = findFiles(glob: '**/build/ospackage/temurin-*j*.apk') // List All Packages To Upload
def SrcFiles = findFiles(glob: '**/build/ospackage/temurin-*src*.apk') // List All Sources To Upload

for (PackFile in PackFiles) {

def FileName = PackFile.name
def Target = "https://adoptium.jfrog.io/artifactory/apk/alpine/main/${BUILDARCH}/${FileName}"

echo "File : ${PackFile}"
echo "Filename : ${FileName}"
echo "Target : ${Target}"

try {
steelhead31 marked this conversation as resolved.
Show resolved Hide resolved
def ResponseCode = sh(script: "curl -o /dev/null --silent --head --write-out '%{http_code}' ${Target}", returnStdout: true).trim()
echo "ResponseCode = ${ResponseCode}"

if ( ResponseCode == '200') {
echo "Target Exists - Skipping"
} else {
echo "Target Doesnt Exist - Upload Files"
jf 'rt u **/build/ospackage/temurin-*j*.apk apk/alpine/main/${BUILDARCH}/ --flat=true'
}

} catch (Exception e) {
error "Error While Checking URL ${Target}: ${e.message}"
}
}

for (SrcFile in SrcFiles) {
def FileName = SrcFile.name
def Target = "https://adoptium.jfrog.io/artifactory/apk/alpine/main/${BUILDARCH}/${FileName}"

echo "File : ${SrcFile}"
echo "Filename : ${FileName}"
echo "Target : ${Target}"

try {
def ResponseCode = sh(script: "curl -o /dev/null --silent --head --write-out '%{http_code}' ${Target}", returnStdout: true).trim()
echo "ResponseCode = ${ResponseCode}"

if ( ResponseCode == '200') {
echo "Target Exists - Skipping"
} else {
echo "Target Doesnt Exist - Upload Files"
jf 'rt u **/build/ospackage/temurin-*src*.apk apk/alpine/main/${BUILDARCH}/ --flat=true'
}
} catch (Exception e) {
error "Error While Checking URL ${Target}: ${e.message}"
}
}
// unset BUILDARCH environment variable
}
}
steelhead31 marked this conversation as resolved.
Show resolved Hide resolved

def uploadDebArtifacts(String buildArch) {
def debArchList = [
Expand Down Expand Up @@ -338,11 +387,34 @@ def uploadDebArtifacts(String buildArch) {
} else {
env.BUILDARCH = debArchList[buildArch]
env.DISTROLIST = distro_list
jf 'rt u **/build/ospackage/temurin-*${BUILDARCH}.deb deb/pool/main/t/temurin-${VERSION}/ --target-props=${DISTROLIST}deb.component=main;deb.architecture=${BUILDARCH} --flat=true'
break

def PackFiles = findFiles(glob: "**/build/ospackage/temurin-*${debArchList[buildArch]}.deb") // List All Packages To Upload
for (PackFile in PackFiles) {
def FileName = PackFile.name
steelhead31 marked this conversation as resolved.
Show resolved Hide resolved
def Target = "https://adoptium.jfrog.io/artifactory/deb/pool/main/t/temurin-${VERSION}/${FileName}"

echo "File : ${PackFile}"
echo "Filename : ${FileName}"
echo "Target : ${Target}"

try {
def ResponseCode = sh(script: "curl -o /dev/null --silent --head --write-out '%{http_code}' ${Target}", returnStdout: true).trim()
steelhead31 marked this conversation as resolved.
Show resolved Hide resolved
echo "ResponseCode = ${ResponseCode}"

if ( ResponseCode == '200') {
echo "Target Exists - Skipping"
} else {
echo "Target Doesnt Exist - Upload Files"
jf 'rt u **/build/ospackage/temurin-*${BUILDARCH}.deb deb/pool/main/t/temurin-${VERSION}/ --target-props=${DISTROLIST}deb.component=main;deb.architecture=${BUILDARCH} --flat=true'
}
} catch (Exception e) {
error "Error While Checking URL ${Target}: ${e.message}"
}
}
}
break
}
}
}
}
steelhead31 marked this conversation as resolved.
Show resolved Hide resolved

def uploadRpmArtifacts(String DISTRO, String rpmArch) {
def distro_Package = [
Expand Down Expand Up @@ -408,7 +480,33 @@ def uploadRpmArtifacts(String DISTRO, String rpmArch) {
env.VALUE = entry.value
env.KEY = entry.key
env.PACKAGEDIR = packageDir
jf 'rt u **/build/ospackage/*.${VALUE}.rpm ${PACKAGEDIR}/${KEY}/Packages/ --flat=true'

def PackFiles = findFiles(glob: "**/build/ospackage/t*.${entry.value}.rpm") // List All Packages To Upload For Temurin

for (PackFile in PackFiles) {
def FileName = PackFile.name
def Target = "https://adoptium.jfrog.io/artifactory/${PACKAGEDIR}/${KEY}/Packages/${FileName}"

echo "File : ${PackFile}"
echo "Filename : ${FileName}"
echo "Target : ${Target}"

try {
def ResponseCode = sh(script: "curl -o /dev/null --silent --head --write-out '%{http_code}' ${Target}", returnStdout: true).trim()
echo "ResponseCode = ${ResponseCode}"

if ( ResponseCode == '200') {
echo "Target Exists - Skipping"
} else {
echo "Target Doesnt Exist - Upload Files"
jf 'rt u **/build/ospackage/*.${VALUE}.rpm ${PACKAGEDIR}/${KEY}/Packages/ --flat=true'
}

} catch (Exception e) {
error "Error While Checking URL ${Target}: ${e.message}"
}

}
break
}
}
Expand Down