-
Notifications
You must be signed in to change notification settings - Fork 9
45 lines (42 loc) · 1.74 KB
/
cluster_recreate.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
name: recreate ci cluster
on:
workflow_dispatch:
env:
azure_resource_group: contrast-ci
jobs:
recreate:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: ./.github/actions/setup_nix
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
cachixToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Login to Azure
uses: azure/login@6c251865b4e6290e7b78be643ea2d005bc51f69a # v2.1.1
with:
creds: ${{ secrets.CONTRAST_CI_INFRA_AZURE }}
- name: Cleanup .azure dir
run: |
rm $HOME/.azure/{commandIndex.json,versionCheck.json}
- name: Destroy existing CI cluster
continue-on-error: true
run: |
nix run .#scripts.destroy-coco-aks -- --name="$azure_resource_group"
- name: Create CI cluster
run: |
nix run .#scripts.create-coco-aks -- --name="$azure_resource_group"
- name: Deploy sync server
run: |
kubectl apply -f https://raw.githubusercontent.com/katexochen/sync/f069648d8d08951b503559bab367036290d1f50a/server/deployment.yml
kubectl wait --for=condition=available --timeout=5m deployment/sync
- name: Get sync server IP
run: |
kubectl wait --for=jsonpath='{.status.loadBalancer.ingress[0].ip}' --timeout=5m svc/sync
SYNC_IP=$(kubectl get svc sync -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo "SYNC_IP=$SYNC_IP" | tee -a "$GITHUB_ENV"
- name: Create fifo
run: |
fifoUUID=$(curl -fsSL http://$SYNC_IP:8080/fifo/new | jq -r '.uuid')
echo "Fifo UUID: $fifoUUID"
kubectl create configmap sync-server-fifo --from-literal=uuid=$fifoUUID