diff --git a/ci-operator/infra/openshift/release-controller/releases/release-ocp-4.1-ci.json b/ci-operator/infra/openshift/release-controller/releases/release-ocp-4.1-ci.json index 21f2b538f8d4d..6e064d4d3ca67 100644 --- a/ci-operator/infra/openshift/release-controller/releases/release-ocp-4.1-ci.json +++ b/ci-operator/infra/openshift/release-controller/releases/release-ocp-4.1-ci.json @@ -1,17 +1,11 @@ { "name":"4.1.0-0.ci", "to": "release", - "message": "After merging to master, images are built and pushed here. machine-os-content is promoted to nightly if the run passes.", + "message": "After merging to master, CI images are built and a release is created", "mirrorPrefix": "4.1", "expires":"72h", "pullSecretName": "source", "publish":{ - "mirror-to-nightly": { - "imageStreamRef": { - "name": "4.1-art-latest", - "tags": ["machine-os-content"] - } - }, "mirror-to-origin":{ "imageStreamRef":{ "namespace": "origin", diff --git a/ci-operator/infra/openshift/release-controller/releases/release-ocp-4.1.json b/ci-operator/infra/openshift/release-controller/releases/release-ocp-4.1.json index c284511dc2973..c7cc29599cd4b 100644 --- a/ci-operator/infra/openshift/release-controller/releases/release-ocp-4.1.json +++ b/ci-operator/infra/openshift/release-controller/releases/release-ocp-4.1.json @@ -1,7 +1,7 @@ { "name":"4.1.0-0.nightly", "to": "release", - "message": "OCP images are synced here after being published to quay", + "message": "Builds releases from OSBS images that are on quay.io", "mirrorPrefix": "4.1-art-latest", "expires":"168h", "referenceMode": "source", @@ -12,7 +12,7 @@ } }, "publish":{ - "tag":{"tagRef":{"name":"v4.1"}} + "tag":{"tagRef":{"name":"4.1"}} }, "verify":{ "aws":{ diff --git a/ci-operator/jobs/openshift/release/openshift-release-release-4.1-periodics.yaml b/ci-operator/jobs/openshift/release/openshift-release-release-4.1-periodics.yaml index a25e653929fd0..efe9ae1be770d 100644 --- a/ci-operator/jobs/openshift/release/openshift-release-release-4.1-periodics.yaml +++ b/ci-operator/jobs/openshift/release/openshift-release-release-4.1-periodics.yaml @@ -2,30 +2,58 @@ periodics: - agent: kubernetes cron: "" decorate: true - interval: 8h + interval: 15m name: release-promote-openshift-machine-os-content-e2e-aws-4.1 spec: containers: - - args: - - --artifact-dir=$(ARTIFACTS) - - --secret-dir=/usr/local/pull-secret - - --secret-dir=/usr/local/e2e-aws-cluster-profile - - --template=/usr/local/e2e-aws - - --input-hash=$(BUILD_ID) - - --input-hash=$(JOB_NAME) - - --promote - command: - - ci-operator + - command: + - /bin/bash + - -c + - | + #!/bin/bash + set -euo pipefail + + # prow doesn't allow init containers or a second container + export PATH=$PATH:/tmp/bin + mkdir /tmp/bin + curl https://storage.googleapis.com/origin-ci-test/_tools/4.1.0/oc >/tmp/bin/oc 2>/dev/null + chmod ug+x /tmp/bin/oc + + # if the source and destination are identical, do nothing + from=$( oc get istag -n rhcos "machine-os-content:latest" -o template='{{ .image.metadata.name }}' ) + to=$( oc get istag -n ocp "${BRANCH}:machine-os-content" -o template='{{ .image.metadata.name }}' ) + if [[ "${from}" == "${to}" ]]; then + echo "info: rhcos/machine-os-content:latest matches ocp/${branch}:machine-os-content" + exit 0 + fi + echo "Will promote ${from}, current is ${to}" + + # error out if the image isn't on quay + to_quay="quay.io/openshift-release-dev/ocp-v4.0-art-dev@${from}" + if ! oc image info -a "/usr/local/pull-secret/.dockerconfigjson" "${to_quay}"; then + echo "error: The source image has not been pushed to quay ${from}" + exit 1 + fi + + # verify the tests pass + ci-operator --artifact-dir=$(ARTIFACTS) --secret-dir=/usr/local/pull-secret \ + --secret-dir=/usr/local/e2e-aws-cluster-profile --template=/usr/local/e2e-aws \ + --input-hash=$(BUILD_ID) --input-hash=$(JOB_NAME) --promote + + # also tag the image into the art-latest stream + oc tag "${to_quay}" "ocp/${BRANCH}-art-latest" env: + - name: BRANCH + value: "4.1" - name: CLUSTER_TYPE value: aws - name: CONFIG_SPEC value: | tag_specification: - name: '4.1' + name: "$(BRANCH)" namespace: ocp promotion: - name: '4.1' + name: "$(BRANCH)" namespace: ocp additional_images: machine-os-content: machine-os-content @@ -34,7 +62,7 @@ periodics: cluster: https://api.ci.openshift.org name: release namespace: openshift - tag: golang-1.10 + tag: golang-1.11 base_images: machine-os-content: name: machine-os-content