This repository has been archived by the owner on Oct 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (66 loc) · 2.65 KB
/
ci_wip.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
# Our desired pipeline using only a Nix shell environment
name: Check and build Kardinal
permissions:
id-token: write
contents: read
on:
push:
branches:
- "*"
tags:
- "*"
pull_request:
branches:
- main
jobs:
e2e_tests:
name: E2E tests
runs-on: ubuntu-22.04
steps:
- name: Git checkout
uses: actions/checkout@v3
- name: Install Nix
uses: cachix/install-nix-action@v27
# relax sandbox due impure kontrol-service tests during build
with:
extra_nix_config: |
sandbox = relaxed
- name: Magic cache
uses: DeterminateSystems/magic-nix-cache-action@v7
- name: Build and load kontrol service image
run: |
docker load < $(nix build ./#kontrol-service-container --no-link --print-out-paths)
- name: Start kontrol service and Postgres
run: |
docker compose -f docker-compose.yml up -d
docker ps
docker inspect network default
curl http://::8080/tenant/${tenant_id}/cluster-resources
exit 1
- name: Install CLI
run: curl get.kardinal.dev -sL | sh
- name: Verify kardinal command
run: bash -c 'source ~/.bashrc; if kardinal | grep -q "Kardinal CLI"; then exit 0; else exit 1; fi'
- name: Retrieve the tenant UUID
run: |
tenant_id=$(kardinal tenant show)
echo ${tenant_id}
echo "tenant_id=${tenant_id}" >> "$GITHUB_OUTPUT"
- name: Deploy boutique demo manifest
run: |
KARDINAL_CLI_DEV_MODE=TRUE kardinal deploy -k obd-demo.yaml
- name: Test cluster resources endpoint
run: |
tenant_id=${{ steps.vars.outputs.tenant_id }}
deployments=$(curl http://localhost:8080/tenant/${tenant_id}/cluster-resources | jq -r '.deployments[].metadata.name')
if [ "${deployments}" != "postgres-prod\nproductcatalogservice-prod\ncartservice-prod\nfrontend-prod" ]; then exit 1; fi
- name: Create and delete flow
run: |
KARDINAL_CLI_DEV_MODE=TRUE kardinal flow create frontend kurtosistech/frontend:demo-frontend > kardinal.out
flow_id=$(grep "Flow.*created" kardinal.out | cut -d ' ' -f2 | tr -d "\"")
kardinal flow delete ${flow_id}
- name: Create more complex flow
run: |
KARDINAL_CLI_DEV_MODE=TRUE kardinal flow create frontend kurtosistech/frontend:demo-on-sale -s productcatalogservice=kurtosistech/productcatalogservice:demo-on-sale > kardinal.out
flow_id=$(grep "Flow.*created" kardinal.out | cut -d ' ' -f2 | tr -d "\"")
kardinal flow delete ${flow_id}