Skip to content

Commit

Permalink
Upgrade CI (01 Feb 2022 13:40:19)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Feb 1, 2022
1 parent b747f9e commit dd6b4ca
Show file tree
Hide file tree
Showing 10 changed files with 475 additions and 2,766 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/operator_ci_index_sha.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ env:
OPP_SCRIPT_ISS_URL: "https://raw.githubusercontent.com/redhat-openshift-ecosystem/community-operators-pipeline/ci/latest/ci/scripts/opp-iss.sh"
GODEBUG: x509ignoreCN=0
OPP_INDEX_MIRROR: 1
OPP_MIRROR_LATEST_TAG: "latest"
OPP_MIRROR_LATEST_TAG: ""
OPP_PRODUCTION_TYPE: "k8s"
OPP_MIRROR_INDEX_MULTIARCH_BASE: "registry.redhat.io/openshift4/ose-operator-registry"
OPP_MULTIARCH_SUPPORTED_VERSIONS: "v4.9"
Expand Down
83 changes: 60 additions & 23 deletions .github/workflows/operator_release.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@

name: Operator release

name: Operator release
on:
push:
branches:
- master
- main

workflow_dispatch:
inputs:
release:
description: 'Force to run release'
required: true
default: '0'
delete:
description: 'Delete operator (cockroachdb or cockroachdb/5.0.4) for debuging only'
description: 'Remove operator virtually from git (cockroachdb or cockroachdb/5.0.4) for debuging only'
required: false
default: ''

Expand All @@ -29,7 +28,7 @@ env:
OPP_ANSIBLE_PULL_REPO: "https://github.com/redhat-openshift-ecosystem/operator-test-playbooks"
OPP_ANSIBLE_PULL_BRANCH: "upstream-community"
OPP_PROD: 1
OPP_MIRROR_LATEST_TAG: "latest"
OPP_MIRROR_LATEST_TAG: ""
OPP_PRODUCTION_TYPE: "k8s"
OPP_RELEASE_BUNDLE_REGISTRY: "quay.io"
OPP_RELEASE_BUNDLE_ORGANIZATION: "operatorhubio"
Expand Down Expand Up @@ -114,33 +113,46 @@ jobs:
opp_release_delete_appreg: "${{ steps.op-traffic-light.outputs.opp_release_delete_appreg }}"
opp_pr_title: "${{ steps.op-traffic-light.outputs.opp_pr_title }}"
opp_auto_packagemanifest_cluster_version_label: "${{ steps.op-traffic-light.outputs.opp_auto_packagemanifest_cluster_version_label }}"

remove-k8s:
name: "Remove / k8s"

needs: pr-check
if: needs.pr-check.outputs.opp_release_ready == '1'
runs-on: ubuntu-latest
strategy:
matrix:
index-tag: ['latest']

fail-fast: false
steps:
- name: Remove operator from index
if: needs.pr-check.outputs.opp_op_delete == '1' && needs.pr-check.outputs.opp_name != ''

env:
OPP_LABELS: "${{ needs.pr-check.outputs.opp_labels }}"
OPP_AUTO_PACKAGEMANIFEST_CLUSTER_VERSION_LABEL: "${{ needs.pr-check.outputs.opp_auto_packagemanifest_cluster_version_label }}"
OPERATOR_INDEX_TAG: ${{ matrix.index-tag }}
run: |
echo "OPP_LABELS=$OPP_LABELS"
echo "op_delete operators/${{ needs.pr-check.outputs.opp_name }}/dummy $OPP_THIS_REPO $OPP_THIS_BRANCH"
bash <(curl -sL $OPP_SCRIPT_URL) op_delete operators/${{ needs.pr-check.outputs.opp_name }}/dummy $OPP_THIS_REPO $OPP_THIS_BRANCH
echo "op_delete_${OPERATOR_INDEX_TAG} operators/${{ needs.pr-check.outputs.opp_name }}/dummy $OPP_THIS_REPO $OPP_THIS_BRANCH"
bash <(curl -sL $OPP_SCRIPT_URL) op_delete_${OPERATOR_INDEX_TAG} operators/${{ needs.pr-check.outputs.opp_name }}/dummy $OPP_THIS_REPO $OPP_THIS_BRANCH
- name: Operator release (operator version overwrite)
if: needs.pr-check.outputs.opp_ci_yaml_only == '0' && needs.pr-check.outputs.opp_ver_overwrite == '1' && needs.pr-check.outputs.opp_name != '' && needs.pr-check.outputs.opp_version != ''
env:
OPP_LABELS: "${{ needs.pr-check.outputs.opp_labels }}"
OPP_AUTO_PACKAGEMANIFEST_CLUSTER_VERSION_LABEL: "${{ needs.pr-check.outputs.opp_auto_packagemanifest_cluster_version_label }}"
OPP_IIB_INSTALL: 0
OPERATOR_INDEX_TAG: ${{ matrix.index-tag }}
run: |
echo "OPP_LABELS=$OPP_LABELS"
echo "op_delete operators/${{ needs.pr-check.outputs.opp_name }}/${{ needs.pr-check.outputs.opp_version }} $OPP_THIS_REPO $OPP_THIS_BRANCH"
bash <(curl -sL $OPP_SCRIPT_URL) op_delete operators/${{ needs.pr-check.outputs.opp_name }}/${{ needs.pr-check.outputs.opp_version }} $OPP_THIS_REPO $OPP_THIS_BRANCH
FAKE_RC=false
FAKE_TYPE=$(echo $OPERATOR_INDEX_TAG | cut -d '-' -f 2)
[[ $FAKE_TYPE == *rc* ]] && FAKE_RC=true || true
echo "op_delete_${OPERATOR_INDEX_TAG} operators/${{ needs.pr-check.outputs.opp_name }}/${{ needs.pr-check.outputs.opp_version }} $OPP_THIS_REPO $OPP_THIS_BRANCH"
bash <(curl -sL $OPP_SCRIPT_URL) op_delete_${OPERATOR_INDEX_TAG} operators/${{ needs.pr-check.outputs.opp_name }}/${{ needs.pr-check.outputs.opp_version }} $OPP_THIS_REPO $OPP_THIS_BRANCH || $FAKE_RC
operators-k8s:
name: "Index check / k8s"
Expand All @@ -149,29 +161,38 @@ jobs:
if: needs.pr-check.outputs.opp_release_ready == '1'
runs-on: ubuntu-latest
steps:
- name: Index check
- name: List of missing operators
id: operators
env:
OPP_LABELS: "${{ needs.pr-check.outputs.opp_labels }}"
OPP_AUTO_PACKAGEMANIFEST_CLUSTER_VERSION_LABEL: "${{ needs.pr-check.outputs.opp_auto_packagemanifest_cluster_version_label }}"
OPP_IIB_INSTALL: 0
IIB_INPUT_REGISTRY_TOKEN: ${{ secrets.IIB_INPUT_REGISTRY_TOKEN }}
OPERATOR_INDEX_TAG: "orange_latest"

OPP_INDEX_CHECK_ONLY: 1
run: |
echo "OPP_LABELS=$OPP_LABELS"
echo "'orange' operators/sync $OPP_THIS_REPO $OPP_THIS_BRANCH"
bash <(curl -sL $OPP_SCRIPT_URL) orange operators/sync $OPP_THIS_REPO $OPP_THIS_BRANCH
- name: Operators for sync
echo "'$OPERATOR_INDEX_TAG' operators/sync $OPP_THIS_REPO $OPP_THIS_BRANCH"
bash <(curl -sL $OPP_SCRIPT_URL) "$OPERATOR_INDEX_TAG" operators/sync $OPP_THIS_REPO $OPP_THIS_BRANCH
- name: Index check
run: |
echo "Operators : ${{ steps.operators.outputs.opp_uncomplete_operators }}"
echo "Operators (latest) : ${{ steps.operators.outputs.opp_uncomplete_operators_latest }}"
- name: Operator info
id: op-info
env:

OPP_FORCE_OPERATORS: ${{ steps.operators.outputs.opp_uncomplete_operators }}

OPP_AUTO_LABEL: 1
ANSIBLE_FORCE_COLOR: 1
ANSIBLE_DISPLAY_SKIPPED_HOSTS: 0
ANSIBLE_STDOUT_CALLBACK: "yaml"
run: |
# OPP_ANSIBLE_PULL_BRANCH="upstream-community-dev"
OPP_FORCE_OPERATORS=${OPP_FORCE_OPERATORS// /,}
echo $OPP_FORCE_OPERATORS
[ "$OPP_AUTO_LABEL" = '1' ] && ANSIBLE_ARGS="-e automatic_cluster_version_label=true" || ANSIBLE_ARGS="-e automatic_cluster_version_label=false"
Expand All @@ -191,7 +212,7 @@ jobs:
[ -f /tmp/operator-test/op_info.yaml ] && cat /tmp/operator-test/op_info.yaml || echo "::set-output name=opp_uncomplete_operators::"
outputs:
opp_uncomplete_operators: "${{ steps.operators.outputs.opp_uncomplete_operators }}"

opp_uncomplete_operators_latest: "${{ steps.operators.outputs.opp_uncomplete_operators_latest }}"
bundles-k8s:
name: "Bundles / k8s"
needs: [ pr-check, remove-k8s, operators-k8s ]
Expand All @@ -213,21 +234,31 @@ jobs:
env:
OPP_LABELS: "${{ needs.pr-check.outputs.opp_labels }}"
OPP_AUTO_PACKAGEMANIFEST_CLUSTER_VERSION_LABEL: "${{ needs.pr-check.outputs.opp_auto_packagemanifest_cluster_version_label }}"
OPP_IIB_INSTALL: 0
OPERATOR_INDEX_TAG: latest
OPP_SKIP_INDEX: 1
OPP_FORCE_OPERATORS: "${{ needs.operators-k8s.outputs.opp_uncomplete_operators }}"

run: |
echo "OPP_LABELS=$OPP_LABELS"
echo "OPP_FORCE_OPERATORS=$OPP_FORCE_OPERATORS"
echo "orange operators/sync $OPP_THIS_REPO $OPP_THIS_BRANCH"
bash <(curl -sL $OPP_SCRIPT_URL) orange operators/sync $OPP_THIS_REPO $OPP_THIS_BRANCH
FAKE_RC=false
FAKE_TYPE=$(echo $OPERATOR_INDEX_TAG | cut -d '-' -f 2)
[[ $FAKE_TYPE == *rc* ]] && FAKE_RC=true || true
echo "orange_${OPERATOR_INDEX_TAG} operators/sync $OPP_THIS_REPO $OPP_THIS_BRANCH"
bash <(curl -sL $OPP_SCRIPT_URL) orange_${OPERATOR_INDEX_TAG} operators/sync $OPP_THIS_REPO $OPP_THIS_BRANCH || $FAKE_RC
release-k8s:
name: "Index / k8s"
needs: [ pr-check, operators-k8s, bundles-k8s ]
if: needs.pr-check.outputs.opp_release_ready == '1' && needs.operators-k8s.outputs.opp_uncomplete_operators != ''

runs-on: ubuntu-latest
strategy:
matrix:
index-tag: ['latest']

fail-fast: false
steps:
- name: Download operator_info
uses: actions/download-artifact@v2
Expand All @@ -243,17 +274,23 @@ jobs:
env:
OPP_LABELS: "${{ needs.pr-check.outputs.opp_labels }}"
OPP_AUTO_PACKAGEMANIFEST_CLUSTER_VERSION_LABEL: "${{ needs.pr-check.outputs.opp_auto_packagemanifest_cluster_version_label }}"
OPP_FORCE_INDEX_UPDATE: 1
OPP_IIB_INSTALL: 1
#OPP_MIRROR_INDEX_ENABLED: 0
OPP_FORCE_INDEX_UPDATE: 1
IIB_INPUT_REGISTRY_TOKEN: ${{ secrets.IIB_INPUT_REGISTRY_TOKEN }}
IIB_OUTPUT_REGISTRY_TOKEN: ${{ secrets.IIB_OUTPUT_REGISTRY_TOKEN }}
OPP_FORCE_OPERATORS: "${{ needs.operators-k8s.outputs.opp_uncomplete_operators }}"
OPERATOR_INDEX_TAG: ${{ matrix.index-tag }}
# OPP_FORCE_OPERATORS: "${{ needs.operators-k8s.outputs.opp_uncomplete_operators }}"
OPP_FORCE_OPERATORS: ""
OPP_FORCE_OPERATORS_latest: "${{ needs.operators-k8s.outputs.opp_uncomplete_operators_latest }}"

run: |
echo "OPP_LABELS=$OPP_LABELS"
echo "orange operators/sync $OPP_THIS_REPO $OPP_THIS_BRANCH"
bash <(curl -sL $OPP_SCRIPT_URL) orange operators/sync $OPP_THIS_REPO $OPP_THIS_BRANCH
FAKE_RC=false
FAKE_TYPE=$(echo $OPERATOR_INDEX_TAG | cut -d '-' -f 2)
[[ $FAKE_TYPE == *rc* ]] && FAKE_RC=true || true
echo "orange_${OPERATOR_INDEX_TAG} operators/sync $OPP_THIS_REPO $OPP_THIS_BRANCH"
bash <(curl -sL $OPP_SCRIPT_URL) orange_${OPERATOR_INDEX_TAG} operators/sync $OPP_THIS_REPO $OPP_THIS_BRANCH || $FAKE_RC
ohio-image-k8s:
Expand Down
Loading

0 comments on commit dd6b4ca

Please sign in to comment.