Skip to content

index-for-openshift-test #18722

index-for-openshift-test

index-for-openshift-test #18722

name: Prepare Test Index
on:
repository_dispatch:
types:
- manual-test-index
- index-for-openshift-test
env:
OPP_PRODUCTION_TYPE: "ocp"
OPP_IMAGE: "quay.io/operator_testing/operator-test-playbooks:latest"
jobs:
build:
runs-on: ubuntu-latest
# container: quay.io/operator_testing/operator-test-playbooks:latest
steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: python -m pip install --upgrade pip yq
- name: "prepare"
id: variables
env:
OP_PR: ${{ github.event.client_payload.source_pr }}
run: |
tmpfile=$(mktemp /tmp/XXXXXX.json)
curl -s https://api.github.com/repos/redhat-openshift-ecosystem/community-operators-prod/pulls/$OP_PR -o $tmpfile
REPO_FULL=$(cat $tmpfile | jq -r '.head.repo.clone_url')
BRANCH=$(cat $tmpfile | jq -r '.head.ref')
COMMIT=$(cat $tmpfile | jq -r '.head.sha')
REPO=$(echo "$REPO_FULL"| awk -F'https://github.com/' '{print $2}')
echo "opp_repo=$REPO" >> $GITHUB_OUTPUT
echo "opp_branch=$BRANCH" >> $GITHUB_OUTPUT
echo "opp_commit=$COMMIT" >> $GITHUB_OUTPUT
echo "Pull request #$1 : $REPO $BRANCH $COMMIT"
rm -f $tmpfile > /dev/null 2>&1
- name: Build temp index and push
env:
# CONTAINER_TOOL: podman
OP_DEBUG: 0
OP_TOKEN: ${{ secrets.PREPARE_INDEX_API_TOKEN }}
# OP_PR: ${{ github.event.client_payload.source_pr }}
BASE: "https://github.com"
REPO: ${{ steps.variables.outputs.opp_repo }}
BRANCH: ${{ steps.variables.outputs.opp_branch }}
COMMIT: ${{ steps.variables.outputs.opp_commit }}
OPP_OPRT_REPO: ${{ steps.variables.outputs.opp_repo }}
OPP_OPRT_SHA: ${{ steps.variables.outputs.opp_commit }}
IIB_INPUT_REGISTRY_TOKEN: ${{ secrets.IIB_INPUT_REGISTRY_TOKEN }}
IIB_INPUT_REGISTRY_USER: "12742415|community-operators-pipeline"
OPP_MIRROR_INDEX_MULTIARCH_IMAGE: "quay.io/operator-framework/opm:latest"
OPP_SCRIPT_ENV_URL: "https://raw.githubusercontent.com/redhat-openshift-ecosystem/community-operators-pipeline/ci/latest/ci/scripts/opp-osr-run.sh"
OPP_OPRT_SRC_BASE: "https://github.com"
OPP_OPRT_SRC_REPO: "redhat-openshift-ecosystem/community-operators-prod"
OPP_OPRT_SRC_BRANCH: "main"
# REPO: "redhat-openshift-ecosystem/community-operators-prod.git"
# BRANCH: "main"
run: |
echo ${{ github.event.client_payload.source_pr }} >> file
echo
echo
echo -n "Preparing temp index for PR: "
cat file
echo
echo
bash <(curl -sL https://raw.githubusercontent.com/redhat-openshift-ecosystem/community-operators-pipeline/ci/latest/ci/scripts/opp-oprt.sh)