Skip to content

Commit cb851e2

Browse files
authored
Merge pull request #800 from snyk/chore/sync-community-operators-fork
[RUN-1589] Chore/sync community operators fork
2 parents d47195d + 3281cb0 commit cb851e2

File tree

4 files changed

+78
-10
lines changed

4 files changed

+78
-10
lines changed

.circleci/config.yml

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,38 @@ jobs:
759759
name: Notify Slack on failure
760760
when: on_fail
761761
working_directory: ~/kubernetes-monitor
762+
sync_community_operators_with_snyk_fork:
763+
docker:
764+
- auth:
765+
password: $DOCKERHUB_PASSWORD
766+
username: $DOCKERHUB_USER
767+
image: cimg/python:3.9.5
768+
steps:
769+
- checkout
770+
- install_python_requests
771+
- add_ssh_keys:
772+
fingerprints:
773+
- 06:c3:d4:10:0d:ef:37:6c:ec:b9:fb:6e:ed:09:e7:40
774+
- run:
775+
command: |
776+
CURRENT_DIRECTORY=$(pwd)
777+
COMMUNITY_FOLDER_LOCATION="${CURRENT_DIRECTORY}/community-operators"
778+
779+
# Clone Community Operators repo from Snyk
780+
git clone https://github.com/snyk/community-operators.git "${COMMUNITY_FOLDER_LOCATION}"
781+
cd "${COMMUNITY_FOLDER_LOCATION}"
782+
783+
# Sync snyk/community-operators repo from operator-framework/community-operators repo
784+
git remote add upstream https://github.com/operator-framework/community-operators.git
785+
git fetch upstream
786+
git merge upstream/master
787+
git push origin master
788+
name: Sync operator-framework/community-operators with snyk/community-operators
789+
- run:
790+
command: ./scripts/slack/notify_failure.py "${CIRCLE_BRANCH}" "${CIRCLE_JOB}" "${CIRCLE_BUILD_URL}" "${CIRCLE_PULL_REQUEST}" "${SLACK_WEBHOOK}"
791+
name: Notify Slack on failure
792+
when: on_fail
793+
working_directory: ~/kubernetes-monitor
762794
system_tests:
763795
machine:
764796
docker_layer_caching: true
@@ -872,20 +904,27 @@ workflows:
872904
- master
873905
requires:
874906
- hold
875-
- push_operator_to_community_operators:
907+
- sync_community_operators_with_snyk_fork:
876908
filters:
877909
branches:
878910
only:
879911
- master
880912
requires:
881913
- operator_upgrade_tests
914+
- push_operator_to_community_operators:
915+
filters:
916+
branches:
917+
only:
918+
- master
919+
requires:
920+
- sync_community_operators_with_snyk_fork
882921
- push_operator_to_upstream_community_operators:
883922
filters:
884923
branches:
885924
only:
886925
- master
887926
requires:
888-
- operator_upgrade_tests
927+
- sync_community_operators_with_snyk_fork
889928
MERGE_TO_MASTER:
890929
jobs:
891930
- publish:

.circleci/config/@config.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,15 @@ workflows:
144144
<<: *master_branch_only_filter
145145
requires:
146146
- hold
147-
- push_operator_to_community_operators:
147+
- sync_community_operators_with_snyk_fork:
148148
<<: *master_branch_only_filter
149149
requires:
150150
- operator_upgrade_tests
151+
- push_operator_to_community_operators:
152+
<<: *master_branch_only_filter
153+
requires:
154+
- sync_community_operators_with_snyk_fork
151155
- push_operator_to_upstream_community_operators:
152156
<<: *master_branch_only_filter
153157
requires:
154-
- operator_upgrade_tests
158+
- sync_community_operators_with_snyk_fork
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
docker:
2+
- image: cimg/python:3.9.5
3+
auth:
4+
username: $DOCKERHUB_USER
5+
password: $DOCKERHUB_PASSWORD
6+
working_directory: ~/kubernetes-monitor
7+
steps:
8+
- checkout
9+
- install_python_requests
10+
- add_ssh_keys:
11+
fingerprints:
12+
- 06:c3:d4:10:0d:ef:37:6c:ec:b9:fb:6e:ed:09:e7:40
13+
- run:
14+
name: Sync operator-framework/community-operators with snyk/community-operators
15+
command: |
16+
CURRENT_DIRECTORY=$(pwd)
17+
COMMUNITY_FOLDER_LOCATION="${CURRENT_DIRECTORY}/community-operators"
18+
19+
# Clone Community Operators repo from Snyk
20+
git clone https://github.com/snyk/community-operators.git "${COMMUNITY_FOLDER_LOCATION}"
21+
cd "${COMMUNITY_FOLDER_LOCATION}"
22+
23+
# Sync snyk/community-operators repo from operator-framework/community-operators repo
24+
git remote add upstream https://github.com/operator-framework/community-operators.git
25+
git fetch upstream
26+
git merge upstream/master
27+
git push origin master
28+
- run:
29+
name: Notify Slack on failure
30+
command: ./scripts/slack/notify_failure.py "${CIRCLE_BRANCH}" "${CIRCLE_JOB}" "${CIRCLE_BUILD_URL}" "${CIRCLE_PULL_REQUEST}" "${SLACK_WEBHOOK}"
31+
when: on_fail

scripts/operator/push-operator-to-snyk-upstream.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,6 @@ git config --global user.name "${OPENSHIFT_OPERATOR_GITHUB_NAME}"
3030
git clone https://github.com/snyk/community-operators.git $COMMUNITY_OPERATORS_UPSTREAM_LOCATION
3131
cd "${COMMUNITY_OPERATORS_UPSTREAM_LOCATION}"
3232

33-
# Sync snyk/community-operators repo from operator-framework/community-operators repo
34-
git remote add upstream https://github.com/operator-framework/community-operators.git
35-
git fetch upstream
36-
git merge upstream/master
37-
git push origin master
38-
3933
# Checkout branch for new snyk-operator version on community folder
4034
git checkout -b snyk/${COMMUNITY_FOLDER_LOCATION}/snyk-operator-v${NEW_OPERATOR_VERSION}
4135

0 commit comments

Comments
 (0)