@@ -382,7 +382,7 @@ jobs:
382382 Deploys a previously released version of the snyk-operator.
383383 Subsequently upgrades the Operator with a new version that is intended
384384 to be released. If the Operator reaches the running state in both cases,
385- we can aassume that it's able to upgrade.
385+ we can assume that it's able to upgrade.
386386 executor : redhat-openshift/default
387387 steps :
388388 - checkout
@@ -413,9 +413,11 @@ jobs:
413413 source $BASH_ENV
414414 set -xeo pipefail
415415
416- OPERATOR_VERSION=$(python ./scripts/ operator/get_last_published_operator_version.py)
416+ OPERATOR_REPO_URL="https://raw.githubusercontent.com/redhat-openshift-ecosystem/community-operators-prod/main/operators/snyk- operator/snyk-operator.package.yaml"
417417
418- echo "Currently released version is: ${OPERATOR_VERSION}"
418+ OPERATOR_VERSION=$(python ./scripts/operator/get_last_published_operator_version.py $OPERATOR_REPO_URL)
419+
420+ echo "Currently released embedded version is: ${OPERATOR_VERSION}"
419421 echo "export OPERATOR_VERSION=${OPERATOR_VERSION}" >> $BASH_ENV
420422 name : Get last released Operator version
421423 - run :
@@ -446,10 +448,7 @@ jobs:
446448 OPERATOR_DIR=$(python scripts/operator/package_operator_bundle.py $OPERATOR_VERSION $SNYK_OPERATOR_IMAGE_TAG $SNYK_MONITOR_IMAGE_TAG)
447449
448450 python scripts/operator/create_operator_bundle_and_index_and_push.py $OPERATOR_DIR $OPERATOR_VERSION $DOCKERHUB_USER $DOCKERHUB_PASSWORD
449- description : |
450- Even though the Operator is released to the community-operators repo,
451- we can reproduce it locally using our packaged scripts. This also helps us
452- test the upgrade by pushing all tested Operators to our Quay repo.
451+ description : " Even though the Operator is released to the\n redhat-openshift-ecosystem/community-operators-prod repo, we can \n reproduce it locally using our packaged scripts. This also helps us\n test the upgrade by pushing all tested Operators to our Quay repo.\n "
453452 name : Package Operator Bundle and push to Docker Hub
454453 - run :
455454 command : |
@@ -650,7 +649,7 @@ jobs:
650649 push_operator_to_community_operators :
651650 description : |
652651 Packages a new Operator and pushes it to Snyk's fork of
653- the OpenShift community-operators.
652+ the OpenShift k8s-operatorhub/ community-operators.
654653 executor : redhat-openshift/default
655654 steps :
656655 - checkout
@@ -665,7 +664,9 @@ jobs:
665664 - run :
666665 command : |
667666 set -xeo pipefail
668- LAST_OPERATOR_VERSION=$(python ./scripts/operator/get_last_published_operator_version.py)
667+ OPERATOR_REPO_URL="https://raw.githubusercontent.com/k8s-operatorhub/community-operators/main/operators/snyk-operator/snyk-operator.package.yaml"
668+
669+ LAST_OPERATOR_VERSION=$(python ./scripts/operator/get_last_published_operator_version.py $OPERATOR_REPO_URL)
669670 echo "export LAST_OPERATOR_VERSION=${LAST_OPERATOR_VERSION}" >> $BASH_ENV
670671 name : Get last released Operator version
671672 - run :
@@ -693,15 +694,15 @@ jobs:
693694 COMMUNITY_FOLDER_LOCATION="community-operators"
694695 ./scripts/operator/push-operator-to-snyk-upstream.sh "${CURRENT_DIRECTORY}" "${COMMUNITY_FOLDER_LOCATION}"
695696 echo "export COMMUNITY_FOLDER_LOCATION=${COMMUNITY_FOLDER_LOCATION}" >> $BASH_ENV
696- name : Push new Operator to the fork of the community-operators repository
697+ name : Push new Operator to the fork of the k8s-operatorhub/ community-operators repository
697698 - run :
698699 command : |
699700 SLACK_PR_URL=$(python ./scripts/operator/raise_pr_to_community_operators_from_our_fork.py "${COMMUNITY_FOLDER_LOCATION}" "${NEW_OPERATOR_VERSION}")
700701 echo "export SLACK_PR_URL=${SLACK_PR_URL}" >> $BASH_ENV
701- name : Open a Pull Request to the operator-framework /community-operators repository for community-operators
702+ name : Open a Pull Request to the k8s-operatorhub /community-operators repository
702703 - run :
703704 command : |
704- ./scripts/slack/notify_success_operator_push.py "${NEW_OPERATOR_VERSION}" "${COMMUNITY_FOLDER_LOCATION}" "${SLACK_PR_URL}"
705+ ./scripts/slack/notify_success_operator_push.py "${NEW_OPERATOR_VERSION}" "community/operators/ ${COMMUNITY_FOLDER_LOCATION}" "${SLACK_PR_URL}"
705706 name : Notify Slack on new branch in snyk/community-operators
706707 - run :
707708 command : |
@@ -711,10 +712,10 @@ jobs:
711712 name : Notify Slack on failure
712713 when : on_fail
713714 working_directory : ~/kubernetes-monitor
714- push_operator_to_upstream_community_operators :
715+ push_operator_to_embedded_community_operators :
715716 description : |
716717 Packages a new Operator and pushes it to Snyk's fork of
717- the OpenShift upstream- community-operators.
718+ the redhat-openshift-ecosystem/ community-operators-prod .
718719 executor : redhat-openshift/default
719720 steps :
720721 - checkout
@@ -729,7 +730,9 @@ jobs:
729730 - run :
730731 command : |
731732 set -xeo pipefail
732- LAST_OPERATOR_VERSION=$(python ./scripts/operator/get_last_published_operator_version.py)
733+ OPERATOR_REPO_URL="https://raw.githubusercontent.com/redhat-openshift-ecosystem/community-operators-prod/main/operators/snyk-operator/snyk-operator.package.yaml"
734+
735+ LAST_OPERATOR_VERSION=$(python ./scripts/operator/get_last_published_operator_version.py $OPERATOR_REPO_URL)
733736 echo "export LAST_OPERATOR_VERSION=${LAST_OPERATOR_VERSION}" >> $BASH_ENV
734737 name : Get last released Operator version
735738 - run :
@@ -754,19 +757,19 @@ jobs:
754757 - run :
755758 command : |
756759 CURRENT_DIRECTORY=$(pwd)
757- COMMUNITY_FOLDER_LOCATION="upstream- community-operators"
760+ COMMUNITY_FOLDER_LOCATION="community-operators-prod "
758761 ./scripts/operator/push-operator-to-snyk-upstream.sh "${CURRENT_DIRECTORY}" "${COMMUNITY_FOLDER_LOCATION}"
759762 echo "export COMMUNITY_FOLDER_LOCATION=${COMMUNITY_FOLDER_LOCATION}" >> $BASH_ENV
760- name : Push new Operator to the fork of the upstream- community-operators repository
763+ name : Push new Operator to the fork of the redhat-openshift-ecosystem/ community-operators-prod repository
761764 - run :
762765 command : |
763- SLACK_PR_URL=$(python ./scripts/operator/raise_pr_to_community_operators_from_our_fork .py "${COMMUNITY_FOLDER_LOCATION}" "${NEW_OPERATOR_VERSION}")
766+ SLACK_PR_URL=$(python ./scripts/operator/raise_pr_to_embedded_community_operators_from_our_fork .py "${COMMUNITY_FOLDER_LOCATION}" "${NEW_OPERATOR_VERSION}")
764767 echo "export SLACK_PR_URL=${SLACK_PR_URL}" >> $BASH_ENV
765- name : Open a Pull Request to the operator-framework /community-operators repository for upstream-community-operators
768+ name : Open a Pull Request to the redhat-openshift-ecosystem /community-operators-prod repository
766769 - run :
767770 command : |
768771 ./scripts/slack/notify_success_operator_push.py "${NEW_OPERATOR_VERSION}" "${COMMUNITY_FOLDER_LOCATION}" "${SLACK_PR_URL}"
769- name : Notify Slack on new branch in snyk/upstream- community-operators
772+ name : Notify Slack on new branch in snyk/community-operators-prod
770773 - run :
771774 command : |
772775 if [[ "${NOTHING_TO_TEST}" != "true" ]]; then
@@ -796,12 +799,44 @@ jobs:
796799 git clone https://github.com/snyk/community-operators.git "${COMMUNITY_FOLDER_LOCATION}"
797800 cd "${COMMUNITY_FOLDER_LOCATION}"
798801
799- # Sync snyk/community-operators repo from operator-framework/community-operators repo
800- git remote add upstream https://github.com/operator-framework/community-operators.git
802+ # Sync snyk/community-operators repo from k8s-operatorhub/community-operators repo
803+ git remote add upstream https://github.com/k8s-operatorhub/community-operators.git
804+ git fetch upstream
805+ git merge upstream/main
806+ git push origin main
807+ name : Sync k8s-operatorhub/community-operators with snyk/community-operators
808+ - run :
809+ command : ./scripts/slack/notify_failure.py "${CIRCLE_BRANCH}" "${CIRCLE_JOB}" "${CIRCLE_BUILD_URL}" "${CIRCLE_PULL_REQUEST}" "${SLACK_WEBHOOK}"
810+ name : Notify Slack on failure
811+ when : on_fail
812+ working_directory : ~/kubernetes-monitor
813+ sync_embedded_community_operators_with_snyk_fork :
814+ docker :
815+ - auth :
816+ password : $DOCKERHUB_PASSWORD
817+ username : $DOCKERHUB_USER
818+ image : cimg/python:3.9.5
819+ steps :
820+ - checkout
821+ - install_python_requests
822+ - add_ssh_keys :
823+ fingerprints :
824+ - 06:c3:d4:10:0d:ef:37:6c:ec:b9:fb:6e:ed:09:e7:40
825+ - run :
826+ command : |
827+ CURRENT_DIRECTORY=$(pwd)
828+ COMMUNITY_FOLDER_LOCATION="${CURRENT_DIRECTORY}/community-operators-prod"
829+
830+ # Clone Community Operators repo from Snyk
831+ git clone https://github.com/snyk/community-operators-prod.git "${COMMUNITY_FOLDER_LOCATION}"
832+ cd "${COMMUNITY_FOLDER_LOCATION}"
833+
834+ # Sync snyk/community-operators repo from redhat-openshift-ecosystem/community-operators-prod repo
835+ git remote add upstream https://github.com/redhat-openshift-ecosystem/community-operators-prod.git
801836 git fetch upstream
802- git merge upstream/master
803- git push origin master
804- name : Sync operator-framework /community-operators with snyk/community-operators
837+ git merge upstream/main
838+ git push origin main
839+ name : Sync redhat-openshift-ecosystem /community-operators-prod with snyk/community-operators-prod
805840 - run :
806841 command : ./scripts/slack/notify_failure.py "${CIRCLE_BRANCH}" "${CIRCLE_JOB}" "${CIRCLE_BUILD_URL}" "${CIRCLE_PULL_REQUEST}" "${SLACK_WEBHOOK}"
807842 name : Notify Slack on failure
@@ -920,21 +955,28 @@ workflows:
920955 - master
921956 requires :
922957 - hold
923- - sync_community_operators_with_snyk_fork :
958+ - sync_embedded_community_operators_with_snyk_fork :
924959 filters :
925960 branches :
926961 only :
927962 - master
928963 requires :
929964 - operator_upgrade_tests
930- - push_operator_to_community_operators :
965+ - push_operator_to_embedded_community_operators :
931966 filters :
932967 branches :
933968 only :
934969 - master
935970 requires :
936- - sync_community_operators_with_snyk_fork
937- - push_operator_to_upstream_community_operators :
971+ - sync_embedded_community_operators_with_snyk_fork
972+ - sync_community_operators_with_snyk_fork :
973+ filters :
974+ branches :
975+ only :
976+ - master
977+ requires :
978+ - push_operator_to_embedded_community_operators
979+ - push_operator_to_community_operators :
938980 filters :
939981 branches :
940982 only :
@@ -1058,10 +1100,10 @@ workflows:
10581100 MONTHLY :
10591101 jobs :
10601102 - operator_upgrade_tests
1061- - push_operator_to_community_operators :
1103+ - push_operator_to_embedded_community_operators :
10621104 requires :
10631105 - operator_upgrade_tests
1064- - push_operator_to_upstream_community_operators :
1106+ - push_operator_to_community_operators :
10651107 requires :
10661108 - operator_upgrade_tests
10671109 triggers :
0 commit comments