-
Notifications
You must be signed in to change notification settings - Fork 1
167 lines (157 loc) · 6.01 KB
/
generate_prs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
---
name: Generate Downstream PRs
run-name: "Generate Downstream PRs (dry-run: ${{ inputs.dry-run }})"
on:
workflow_dispatch:
inputs:
message:
description: "Message to include in the generated commits:"
required: true
dry-run:
description: "Dry Run (PRs are not generated)"
type: boolean
default: true
jobs:
create-prs:
runs-on: ubuntu-latest
strategy:
# If you add a new repository here, also add it to config/repositories.yaml
matrix:
repository:
- name: airflow-operator
pretty_string: Apache Airflow
product_string: airflow
url: stackabletech/airflow-operator.git
- name: commons-operator
include_productconfig: false
has_product: false
pretty_string: Stackable Commons
product_string: commons
url: stackabletech/commons-operator.git
- name: druid-operator
pretty_string: Apache Druid
product_string: druid
url: stackabletech/druid-operator.git
- name: hbase-operator
pretty_string: Apache HBase
product_string: hbase
url: stackabletech/hbase-operator.git
- name: edc-operator
pretty_string: EDC
product_string: edc
url: stackabletech/edc-operator.git
- name: hdfs-operator
pretty_string: Apache HDFS
product_string: hdfs
url: stackabletech/hdfs-operator.git
- name: hello-world-operator
pretty_string: Hello World
product_string: hello
url: stackabletech/hello-world-operator.git
- name: hive-operator
pretty_string: Apache Hive
product_string: hive
url: stackabletech/hive-operator.git
- name: kafka-operator
pretty_string: Apache Kafka
product_string: kafka
url: stackabletech/kafka-operator.git
- name: nifi-operator
pretty_string: Apache NiFi
product_string: nifi
url: stackabletech/nifi-operator.git
- name: listener-operator
include_productconfig: false
has_product: false
pretty_string: Stackable Listener Operator
product_string: listener-operator
run_as: custom
url: stackabletech/listener-operator.git
- name: opa-operator
extra_crates:
- stackable-opa-bundle-builder
pretty_string: OpenPolicyAgent
product_string: opa
url: stackabletech/opa-operator.git
- name: secret-operator
include_productconfig: false
has_product: false
pretty_string: Stackable Secret Operator
product_string: secret-operator
run_as: custom
url: stackabletech/secret-operator.git
- name: spark-k8s-operator
pretty_string: Apache Spark-on-Kubernetes
product_string: spark-k8s
url: stackabletech/spark-k8s-operator.git
- name: superset-operator
pretty_string: Apache Superset
product_string: superset
url: stackabletech/superset-operator.git
- name: trino-operator
pretty_string: Trino
product_string: trino
url: stackabletech/trino-operator.git
- name: zookeeper-operator
pretty_string: Apache ZooKeeper
product_string: zookeeper
url: stackabletech/zookeeper-operator.git
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: cachix/install-nix-action@8887e596b4ee1134dae06b98d573bd674693f47c # tag=v26
- name: Install Ansible
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt update && \
sudo apt install -y software-properties-common && \
sudo apt-add-repository ppa:ansible/ansible -y && \
sudo apt install -y ansible
# NOTE (@NickLarsenNZ): This could be removed in favor of nix-shell and rrbutani/use-nix-shell-action
- name: Install deps for operators
run: |
sudo apt-get install \
protobuf-compiler \
krb5-user \
libclang-dev \
libkrb5-dev \
liblzma-dev \
libssl-dev \
pkg-config
- name: Install jinja2
run: pip install -r requirements.txt
# Create commit message depending on whether this is run manually or due to a scheduled run
- name: Set commit message for manual dispatch
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
echo "AUTHOR=${{ github.event.sender.login }}" >> "$GITHUB_ENV"
echo "REASON=${{ github.event.inputs.message }}" >> "$GITHUB_ENV"
- name: Set commit message for schedule
if: ${{ github.event_name == 'schedule' }}
run: |
echo "AUTHOR=stackabletech/developers"
echo "REASON=Daily run triggered" >> "$GITHUB_ENV"
- name: Overwrite repositories.yaml for ${{ matrix.repository.name }}
run: |
cat >config/repositories.yaml <<CONFIG
---
repositories:
- ${{ toJSON(matrix.repository) }}
CONFIG
# For debugging
cat config/repositories.yaml
# Generate PRs
- name: Run playbook
if: ${{ !inputs.dry-run }}
run: |
# Funnel via JSON to ensure that values are escaped properly
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
ansible-playbook playbook/playbook.yaml --extra-vars "@vars.json"
env:
GH_ACCESS_TOKEN: ${{ secrets.gh_access_token }}
# Do Not Generate PRs
- name: Run playbook (dry-run)
if: ${{ inputs.dry-run }}
run: ./test.sh
env:
GH_ACCESS_TOKEN: ""