Skip to content

Commit 5a49887

Browse files
committed
create customer and cluster and cleanup
1 parent 1e5a141 commit 5a49887

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

.github/workflows/wg-easy-pr-validation.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,3 +203,69 @@ jobs:
203203
env:
204204
REPLICATED_API_TOKEN: ${{ secrets.WG_EASY_REPLICATED_API_TOKEN }}
205205
REPLICATED_APP: ${{ secrets.WG_EASY_REPLICATED_APP }}
206+
207+
create-customer:
208+
runs-on: ubuntu-22.04
209+
needs: replicated-release
210+
defaults:
211+
run:
212+
working-directory: ${{ env.APP_DIR }}
213+
214+
steps:
215+
- name: Checkout code
216+
uses: actions/checkout@v4
217+
218+
- name: Setup Task
219+
uses: arduino/setup-task@v2
220+
with:
221+
version: 3.x
222+
repo-token: ${{ secrets.GITHUB_TOKEN }}
223+
224+
- name: Install Replicated CLI
225+
run: task utils:install-replicated-cli
226+
227+
- name: Create customer with branch name
228+
run: |
229+
BRANCH_NAME="${{ github.head_ref || github.ref_name }}"
230+
replicated customer create --name "$BRANCH_NAME" --channel unstable
231+
timeout-minutes: 5
232+
env:
233+
REPLICATED_API_TOKEN: ${{ secrets.WG_EASY_REPLICATED_API_TOKEN }}
234+
REPLICATED_APP: ${{ secrets.WG_EASY_REPLICATED_APP }}
235+
236+
- name: Create cluster with branch name
237+
run: |
238+
BRANCH_NAME="${{ github.head_ref || github.ref_name }}"
239+
replicated cluster create --name "$BRANCH_NAME" --distribution embedded-cluster
240+
timeout-minutes: 10
241+
env:
242+
REPLICATED_API_TOKEN: ${{ secrets.WG_EASY_REPLICATED_API_TOKEN }}
243+
REPLICATED_APP: ${{ secrets.WG_EASY_REPLICATED_APP }}
244+
245+
cleanup:
246+
runs-on: ubuntu-22.04
247+
needs: [task-validation, lint-and-validate, replicated-release, create-customer]
248+
if: always()
249+
defaults:
250+
run:
251+
working-directory: ${{ env.APP_DIR }}
252+
253+
steps:
254+
- name: Checkout code
255+
uses: actions/checkout@v4
256+
257+
- name: Setup Task
258+
uses: arduino/setup-task@v2
259+
with:
260+
version: 3.x
261+
repo-token: ${{ secrets.GITHUB_TOKEN }}
262+
263+
- name: Install Replicated CLI
264+
run: task utils:install-replicated-cli
265+
266+
- name: Run clean task
267+
run: task clean
268+
timeout-minutes: 10
269+
env:
270+
REPLICATED_API_TOKEN: ${{ secrets.WG_EASY_REPLICATED_API_TOKEN }}
271+
REPLICATED_APP: ${{ secrets.WG_EASY_REPLICATED_APP }}

0 commit comments

Comments
 (0)