diff --git a/ci-operator/config/openshift/machine-config-operator/openshift-machine-config-operator-fcos.yaml b/ci-operator/config/openshift/machine-config-operator/openshift-machine-config-operator-fcos.yaml index 4593e743b26b0..2d1eab43c7b24 100644 --- a/ci-operator/config/openshift/machine-config-operator/openshift-machine-config-operator-fcos.yaml +++ b/ci-operator/config/openshift/machine-config-operator/openshift-machine-config-operator-fcos.yaml @@ -13,8 +13,16 @@ images: from: base to: machine-config-operator promotion: + additional_images: + machine-config-operator-rpms: rpms + excluded_images: + - machine-config-operator-base-with-rpms name: "4.3" namespace: origin +raw_steps: +- rpm_image_injection_step: + from: base + to: machine-config-operator-base-with-rpms resources: '*': limits: @@ -22,10 +30,25 @@ resources: requests: cpu: 100m memory: 200Mi +rpm_build_commands: |- + TMPDIR=$( mktemp -d ) + RPMBUILD_DIR=_rpmbuild/ + COMMIT=$( git rev-parse HEAD ) + SHORTCOMMIT=$( git rev-parse --short=7 HEAD ) + mkdir -p ${RPMBUILD_DIR}/{BUILD,RPMS,SOURCES,SPECS,SRPMS} + tar -czf "${TMPDIR}/machine-config-operator-${COMMIT}.tar.gz" --exclude='.git' --transform="s|^.|machine-config-operator-${COMMIT}|" --exclude="machine-config-operator-${COMMIT}.tar.gz" ./ + cp ./machine-config-daemon.spec "${RPMBUILD_DIR}/SPECS/" + cp "${TMPDIR}/machine-config-operator-${COMMIT}.tar.gz" "${RPMBUILD_DIR}/SOURCES/machine-config-operator-${SHORTCOMMIT}.tar.gz" + rpmbuild -ba --nodeps --define "_topdir $( pwd )/${RPMBUILD_DIR}" --define "commit ${COMMIT}" ${RPMBUILD_DIR}/SPECS/machine-config-daemon.spec +rpm_build_location: _rpmbuild/RPMS/ tag_specification: name: "4.3" namespace: origin tests: +- as: build-rpms-from-tar + commands: '# noop, just to force the building the `rpms` target' + container: + from: machine-config-operator-base-with-rpms - as: unit commands: make test-unit container: diff --git a/ci-operator/jobs/openshift/machine-config-operator/openshift-machine-config-operator-fcos-postsubmits.yaml b/ci-operator/jobs/openshift/machine-config-operator/openshift-machine-config-operator-fcos-postsubmits.yaml index aa3d321a79b18..b8b0d77fd4d7a 100644 --- a/ci-operator/jobs/openshift/machine-config-operator/openshift-machine-config-operator-fcos-postsubmits.yaml +++ b/ci-operator/jobs/openshift/machine-config-operator/openshift-machine-config-operator-fcos-postsubmits.yaml @@ -21,6 +21,7 @@ postsubmits: - --resolver-address=http://ci-operator-configresolver - --sentry-dsn-path=/etc/sentry-dsn/ci-operator - --target=[images] + - --target=rpms command: - ci-operator env: diff --git a/ci-operator/jobs/openshift/machine-config-operator/openshift-machine-config-operator-fcos-presubmits.yaml b/ci-operator/jobs/openshift/machine-config-operator/openshift-machine-config-operator-fcos-presubmits.yaml index 3af4747352f3b..c2a7e05507c78 100644 --- a/ci-operator/jobs/openshift/machine-config-operator/openshift-machine-config-operator-fcos-presubmits.yaml +++ b/ci-operator/jobs/openshift/machine-config-operator/openshift-machine-config-operator-fcos-presubmits.yaml @@ -1,5 +1,53 @@ presubmits: openshift/machine-config-operator: + - agent: kubernetes + always_run: true + branches: + - fcos + context: ci/prow/build-rpms-from-tar + decorate: true + decoration_config: + skip_cloning: true + labels: + ci-operator.openshift.io/prowgen-controlled: "true" + pj-rehearse.openshift.io/can-be-rehearsed: "true" + name: pull-ci-openshift-machine-config-operator-fcos-build-rpms-from-tar + rerun_command: /test build-rpms-from-tar + spec: + containers: + - args: + - --artifact-dir=$(ARTIFACTS) + - --branch=fcos + - --give-pr-author-access-to-namespace=true + - --org=openshift + - --repo=machine-config-operator + - --resolver-address=http://ci-operator-configresolver + - --sentry-dsn-path=/etc/sentry-dsn/ci-operator + - --target=build-rpms-from-tar + command: + - ci-operator + env: + - name: CONFIG_SPEC + valueFrom: + configMapKeyRef: + key: openshift-machine-config-operator-fcos.yaml + name: ci-operator-misc-configs + image: ci-operator:latest + imagePullPolicy: Always + name: "" + resources: + requests: + cpu: 10m + volumeMounts: + - mountPath: /etc/sentry-dsn + name: sentry-dsn + readOnly: true + serviceAccountName: ci-operator + volumes: + - name: sentry-dsn + secret: + secretName: sentry-dsn + trigger: (?m)^/test( | .* )build-rpms-from-tar,?($|\s.*) - agent: kubernetes always_run: true branches: