@@ -27,83 +27,26 @@ jobs:
27
27
runs-on : ubuntu-latest
28
28
strategy :
29
29
fail-fast : ${{ inputs.fail-fast }}
30
- # If you add a new repository here, also add it to config/repositories.yaml
31
30
matrix :
31
+ # This should be the list of repository names from config/repositories.yaml:
32
+ # yq '.repositories | map(.name)' config/repositories.yaml
32
33
repository :
33
- - name : airflow-operator
34
- pretty_string : Apache Airflow
35
- product_string : airflow
36
- url : stackabletech/airflow-operator.git
37
- - name : commons-operator
38
- include_productconfig : false
39
- has_product : false
40
- pretty_string : Stackable Commons
41
- product_string : commons
42
- url : stackabletech/commons-operator.git
43
- - name : druid-operator
44
- pretty_string : Apache Druid
45
- product_string : druid
46
- url : stackabletech/druid-operator.git
47
- - name : hbase-operator
48
- pretty_string : Apache HBase
49
- product_string : hbase
50
- url : stackabletech/hbase-operator.git
51
- - name : hdfs-operator
52
- pretty_string : Apache HDFS
53
- product_string : hdfs
54
- url : stackabletech/hdfs-operator.git
55
- - name : hive-operator
56
- pretty_string : Apache Hive
57
- product_string : hive
58
- url : stackabletech/hive-operator.git
59
- - name : kafka-operator
60
- pretty_string : Apache Kafka
61
- product_string : kafka
62
- url : stackabletech/kafka-operator.git
63
- - name : nifi-operator
64
- pretty_string : Apache NiFi
65
- product_string : nifi
66
- url : stackabletech/nifi-operator.git
67
- - name : listener-operator
68
- include_productconfig : false
69
- has_product : false
70
- pretty_string : Stackable Listener Operator
71
- product_string : listener-operator
72
- run_as : custom
73
- url : stackabletech/listener-operator.git
74
- - name : opa-operator
75
- extra_crates :
76
- - stackable-opa-bundle-builder
77
- pretty_string : OpenPolicyAgent
78
- product_string : opa
79
- url : stackabletech/opa-operator.git
80
- - name : opensearch-operator
81
- pretty_string : OpenSearch
82
- product_string : opensearch
83
- url : stackabletech/opensearch-operator.git
84
- - name : secret-operator
85
- include_productconfig : false
86
- has_product : false
87
- pretty_string : Stackable Secret Operator
88
- product_string : secret-operator
89
- run_as : custom
90
- url : stackabletech/secret-operator.git
91
- - name : spark-k8s-operator
92
- pretty_string : Apache Spark-on-Kubernetes
93
- product_string : spark-k8s
94
- url : stackabletech/spark-k8s-operator.git
95
- - name : superset-operator
96
- pretty_string : Apache Superset
97
- product_string : superset
98
- url : stackabletech/superset-operator.git
99
- - name : trino-operator
100
- pretty_string : Trino
101
- product_string : trino
102
- url : stackabletech/trino-operator.git
103
- - name : zookeeper-operator
104
- pretty_string : Apache ZooKeeper
105
- product_string : zookeeper
106
- url : stackabletech/zookeeper-operator.git
34
+ - airflow-operator
35
+ - commons-operator
36
+ - druid-operator
37
+ - hbase-operator
38
+ - hdfs-operator
39
+ - hive-operator
40
+ - kafka-operator
41
+ - nifi-operator
42
+ - listener-operator
43
+ - opa-operator
44
+ - opensearch-operator
45
+ - secret-operator
46
+ - spark-k8s-operator
47
+ - superset-operator
48
+ - trino-operator
49
+ - zookeeper-operator
107
50
steps :
108
51
- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
109
52
with :
@@ -113,10 +56,10 @@ jobs:
113
56
env :
114
57
DEBIAN_FRONTEND : noninteractive
115
58
run : |
116
- sudo apt update && \
117
- sudo apt install -y software-properties-common && \
118
- sudo apt-add-repository ppa:ansible/ansible -y && \
119
- sudo apt install -y ansible
59
+ sudo apt update && \
60
+ sudo apt install -y software-properties-common && \
61
+ sudo apt-add-repository ppa:ansible/ansible -y && \
62
+ sudo apt install -y ansible
120
63
121
64
# NOTE (@NickLarsenNZ): This could be removed in favor of nix-shell and rrbutani/use-nix-shell-action
122
65
- name : Install deps for operators
@@ -148,36 +91,18 @@ jobs:
148
91
echo "AUTHOR=stackabletech/developers"
149
92
echo "REASON=Daily run triggered" >> "$GITHUB_ENV"
150
93
151
- - name : Overwrite repositories.yaml for ${{ matrix.repository.name }}
152
- run : |
153
- cat >config/repositories.yaml <<CONFIG
154
- ---
155
- repositories:
156
- - ${{ toJSON(matrix.repository) }}
157
- CONFIG
158
-
159
- # For debugging
160
- cat config/repositories.yaml
161
-
162
- # Generate PRs
163
94
- name : Run playbook
164
- if : ${{ !inputs.dry-run }}
165
95
env :
166
96
CUSTOM_PR_TITLE : ${{ inputs.custom-pr-title }}
167
97
GH_ACCESS_TOKEN : ${{ secrets.gh_access_token }}
98
+ REPOSITORY : ${{ matrix.repository }}
99
+ # tags local excludes all actions that actually generate PRs
100
+ DRY_RUN_FLAGS : ${{ inputs.dry-run && '--tags=local' || '' }}
101
+ # shellsheck disable=SC2086
168
102
run : |
169
- # Funnel via JSON to ensure that values are escaped properly
170
- # Check if custom PR title is set. If so, insert it into the extra vars
171
- if [ -n "$CUSTOM_PR_TITLE" ]; then
172
- echo '{}' | jq '{commit_hash: $ENV.GITHUB_SHA, author: $ENV.AUTHOR, reason: $ENV.REASON, custom_pr_title: $ENV.CUSTOM_PR_TITLE, base_dir: $pwd, gh_access_token: $ENV.GH_ACCESS_TOKEN}' --arg pwd "$(pwd)" > vars.json
173
- else
174
- echo '{}' | jq '{commit_hash: $ENV.GITHUB_SHA, author: $ENV.AUTHOR, reason: $ENV.REASON, base_dir: $pwd, gh_access_token: $ENV.GH_ACCESS_TOKEN}' --arg pwd "$(pwd)" > vars.json
175
- fi
176
- ansible-playbook playbook/playbook.yaml --extra-vars "@vars.json"
177
-
178
- # Do Not Generate PRs
179
- - name : Run playbook (dry-run)
180
- if : ${{ inputs.dry-run }}
181
- run : ./test.sh
182
- env :
183
- GH_ACCESS_TOKEN : " "
103
+ echo '{}' | jq '{commit_hash: $ENV.GITHUB_SHA, author: $ENV.AUTHOR, reason: $ENV.REASON, custom_pr_title: $ENV.CUSTOM_PR_TITLE, base_dir: $pwd, gh_access_token: $ENV.GH_ACCESS_TOKEN, shard_repositories: [$ENV.REPOSITORY]} | with_entries(select(.value != null and .value != ""))' --arg pwd "$(pwd)" > vars.json
104
+ # $DRY_RUN_FLAGS is intentionally not quoted, since we need to avoid
105
+ # passing an argument if we're not in dry mode.
106
+ # This is safe, since it always has one of two hard-coded values.
107
+ # shellcheck disable=SC2086
108
+ ansible-playbook playbook/playbook.yaml --extra-vars "@vars.json" $DRY_RUN_FLAGS
0 commit comments