Skip to content

Commit

Permalink
wrap skopeo push in withCredentials block
Browse files Browse the repository at this point in the history
  • Loading branch information
cheesesashimi committed Jan 19, 2022
1 parent 27a706b commit 0d430c9
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions Jenkinsfile.release
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,14 @@ podTemplate(cloud: 'openshift', label: pod_label, yaml: pod) {
""")
}

def oscontainer_secret = "/run/kubernetes/secrets/oscontainer-registry/dockercfg";
if (utils.pathExists(oscontainer_secret)) {
stage('Sync oscontainer to quay.io') {
shwrap("""ociarchive=\$(cosa meta --image-path ostree)
case \${ociarchive} in
*ociarchive) skopeo copy --authfile=$oscontainer_secret oci-archive://\${ociarchive} docker://quay.io/cgwalters/fcos:${params.STREAM};;
*) echo Build not configured as oci ;;
esac""")
}
withCredentials([string(credentialsId: "oscontainer-secret", variable: "OSCONTAINER_SECRET")]) {
shwrap("""ociarchive=\$(cosa meta --image-path ostree)
case \${ociarchive} in
*ociarchive) skopeo copy --authfile=<($OSCONTAINER_SECRET) oci-archive://\${ociarchive} docker://quay.io/coreos-assembler/fcos:${params.STREAM};;
*) echo Build not configured as oci ;;
esac""")
}
}

for (basearch in params.ARCHES.split()) {
Expand Down

0 comments on commit 0d430c9

Please sign in to comment.