diff --git a/ansible/roles/operator-pipeline/templates/openshift/tasks/copy-image.yml b/ansible/roles/operator-pipeline/templates/openshift/tasks/copy-image.yml index f1ce0c807..67b566b40 100644 --- a/ansible/roles/operator-pipeline/templates/openshift/tasks/copy-image.yml +++ b/ansible/roles/operator-pipeline/templates/openshift/tasks/copy-image.yml @@ -36,7 +36,7 @@ spec: # Save data about released bundle to volume RELEASE_INFO_DIR_PATH="$(workspaces.output.path)/release_info" - mkdir "$RELEASE_INFO_DIR_PATH" + mkdir -p "$RELEASE_INFO_DIR_PATH" echo "- $(params.src_image)" | tee "$RELEASE_INFO_DIR_PATH/released_bundle.txt" if [[ "$(params.vendor_label)" == "" ]]; then diff --git a/ansible/roles/operator-pipeline/templates/openshift/tasks/github-pipelinerun-summary.yml b/ansible/roles/operator-pipeline/templates/openshift/tasks/github-pipelinerun-summary.yml index 6382ff90c..9f762c53c 100644 --- a/ansible/roles/operator-pipeline/templates/openshift/tasks/github-pipelinerun-summary.yml +++ b/ansible/roles/operator-pipeline/templates/openshift/tasks/github-pipelinerun-summary.yml @@ -157,7 +157,7 @@ spec: fi # Add info how to update catalog for FBC bundles - if [[ "$(params.fbc-enabled)" == "true" ]]; then + if [[ "$(params.fbc-enabled)" == "true" && -f "$RELEASE_INFO_DIR_PATH/released_bundle.txt" ]]; then echo -e "\n## Catalog update\n" >> "$PR_NAME/comment.md" echo -e "Operator bundle using FBC mode has been released.\nTo add bundle to FBC templates, follow [this guide](https://redhat-openshift-ecosystem.github.io/operator-pipelines/users/fbc_workflow/#adding-new-bundle-to-catalog) to create a new PR with catalog changes." >> "$PR_NAME/comment.md" fi diff --git a/ansible/roles/operator-pipeline/templates/openshift/tasks/publish-to-index.yml b/ansible/roles/operator-pipeline/templates/openshift/tasks/publish-to-index.yml index ea57f50b1..e989f0a9f 100644 --- a/ansible/roles/operator-pipeline/templates/openshift/tasks/publish-to-index.yml +++ b/ansible/roles/operator-pipeline/templates/openshift/tasks/publish-to-index.yml @@ -97,6 +97,10 @@ spec: else FROM_INDEX_PROXY="registry.stage.redhat.io/redhat/${INDEX_NAME}" fi + # Create folder for release info if it's non-existent + RELEASE_INFO_DIR_PATH="$(workspaces.output.path)/release_info" + mkdir -p "$RELEASE_INFO_DIR_PATH" + echo "Copying index images to published repos..." TEMP_IMAGES=$(echo $(params.index_image_paths) | tr "," " ") @@ -133,7 +137,6 @@ spec: docker://$SRC_IMAGE \ docker://$DEST_IMAGE_PERMANENT_TAG - # Save data about indexes to volume - RELEASE_INFO_DIR_PATH="$(workspaces.output.path)/release_info" + # Save data about updated indices to volume echo "- ${FROM_INDEX_PROXY}:${VERSION}" | tee -a "$RELEASE_INFO_DIR_PATH/updated_indices.txt" done