Skip to content

Commit

Permalink
Rationalise riscv upload function
Browse files Browse the repository at this point in the history
  • Loading branch information
steelhead31 committed Apr 8, 2024
1 parent e128b32 commit f38fb14
Showing 1 changed file with 26 additions and 44 deletions.
70 changes: 26 additions & 44 deletions linux/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -180,40 +180,18 @@ def CheckAndUpload(String Target, String Distro, String BuildArch, String Versio
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'
}
if (BuildArch == "riscv64") {
// RISC Use RT upload
node("dockerBuild&&linux&&x64") {
tool name: 'jfrog-cli', type: 'jfrog'
def copiedFiles = copyArtifacts(filter: '**/build/ospackage/*,**/build/reports/**,**/packageTest/dependencies/deb/*', projectName: env.JOB_NAME, selector: specific(env.BUILD_NUMBER))
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'
// Remove copied artifacts
for (copiedFile in copiedFiles) {
fileToDelete = copiedFile.filePath
echo "Deleting file: ${fileToDelete}"
deleteDir(path: fileToDelete)
}
}
}
break
handleRISCUpload()
}
break
case "Alpine":
jf 'rt u **/build/ospackage/${FILENAME} apk/alpine/main/${BUILDARCH}/ --flat=true'
break
case "RPMS":
if (BuildArch != "riscv64") {
jf 'rt u **/build/ospackage/*.${VALUE}.rpm ${PACKAGEDIR}/${KEY}/Packages/ --flat=true'
}
if (BuildArch == "riscv64") {
// RISC Use RT upload
node("dockerBuild&&linux&&x64") {
tool name: 'jfrog-cli', type: 'jfrog'
def copiedFiles = copyArtifacts(filter: '**/build/ospackage/*,**/build/reports/**,**/packageTest/dependencies/deb/*', projectName: env.JOB_NAME, selector: specific(env.BUILD_NUMBER))
jf 'rt u **/build/ospackage/*.${VALUE}.rpm ${PACKAGEDIR}/${KEY}/Packages/ --flat=true'
// Remove copied artifacts
for (copiedFile in copiedFiles) {
fileToDelete = copiedFile.filePath
echo "Deleting file: ${fileToDelete}"
deleteDir(path: fileToDelete)
}
}
if (BuildArch != "riscv64") {
jf 'rt u **/build/ospackage/*.${VALUE}.rpm ${PACKAGEDIR}/${KEY}/Packages/ --flat=true'
}
if (BuildArch == "riscv64") {
handleRISCUpload()
}
break
default:
Expand All @@ -222,27 +200,31 @@ def CheckAndUpload(String Target, String Distro, String BuildArch, String Versio
jf 'rt u **/build/ospackage/*.${VALUE}.rpm ${PACKAGEDIR}/${KEY}/Packages/ --flat=true'
}
if (BuildArch == "riscv64") {
// RISC Use RT upload
node("dockerBuild&&linux&&x64") {
tool name: 'jfrog-cli', type: 'jfrog'
def copiedFiles = copyArtifacts(filter: '**/build/ospackage/*,**/build/reports/**,**/packageTest/dependencies/deb/*', projectName: env.JOB_NAME, selector: specific(env.BUILD_NUMBER))
jf 'rt u **/build/ospackage/*.${VALUE}.rpm ${PACKAGEDIR}/${KEY}/Packages/ --flat=true'
// Remove copied artifacts
for (copiedFile in copiedFiles) {
fileToDelete = copiedFile.filePath
echo "Deleting file: ${fileToDelete}"
deleteDir(path: fileToDelete)
}
}
}
break
handleRISCUpload()
}
break
}
}
} catch (Exception e) {
error "Error While Checking URL ${Target}: ${e.message}"
}
}

// Riscv Upload Function
def handleRISCUpload() {
node("dockerBuild&&linux&&x64") {
tool name: 'jfrog-cli', type: 'jfrog'
def copiedFiles = copyArtifacts(filter: '**/build/ospackage/*,**/build/reports/**,**/packageTest/dependencies/deb/*', projectName: env.JOB_NAME, selector: specific(env.BUILD_NUMBER))
jf 'rt u **/build/ospackage/*.${VALUE}.rpm ${PACKAGEDIR}/${KEY}/Packages/ --flat=true'
// Remove copied artifacts
for (copiedFile in copiedFiles) {
fileToDelete = copiedFile.filePath
echo "Deleting file: ${fileToDelete}"
deleteDir(path: fileToDelete)
}
}
}

// function only handle debian as DISTRO
def jenkinsStepDeb() {
def temurinVersion = "${TYPE.toLowerCase()} ${VERSION} - ${ARCH}"
Expand Down

0 comments on commit f38fb14

Please sign in to comment.