Skip to content

Commit

Permalink
Revert Jfrog CLI Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
steelhead31 committed Oct 3, 2023
1 parent 6fec2e0 commit ed57530
Showing 1 changed file with 39 additions and 49 deletions.
88 changes: 39 additions & 49 deletions linux/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -293,62 +293,52 @@ def uploadAlpineArtifacts(String buildArch) {
for (PackFile in PackFiles) {

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

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

env.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 (jf 'rt s $TARGET') {
echo file_exists=true
if ( ResponseCode == '200') {
echo "Target Exists - Skipping"
} else {
echo file_exists=false
}
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'
}
// }

// 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-*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}"
// }
// }
} catch (Exception e) {
error "Error While Checking URL ${Target}: ${e.message}"
}
}
// unset BUILDARCH environment variable
}
}

def uploadDebArtifacts(String buildArch) {
def debArchList = [
Expand Down Expand Up @@ -415,7 +405,7 @@ def uploadDebArtifacts(String buildArch) {
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'
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}"
Expand Down Expand Up @@ -509,7 +499,7 @@ def uploadRpmArtifacts(String DISTRO, String rpmArch) {
echo "Target Exists - Skipping"
} else {
echo "Target Doesnt Exist - Upload Files"
//jf 'rt u **/build/ospackage/*.${VALUE}.rpm ${PACKAGEDIR}/${KEY}/Packages/ --flat=true'
jf 'rt u **/build/ospackage/*.${VALUE}.rpm ${PACKAGEDIR}/${KEY}/Packages/ --flat=true'
}

} catch (Exception e) {
Expand Down

0 comments on commit ed57530

Please sign in to comment.