Skip to content

Commit 72f3370

Browse files
committed
Set up tilt CI for testing gitops-stack
1 parent 3aef616 commit 72f3370

File tree

8 files changed

+55
-8
lines changed

8 files changed

+55
-8
lines changed

.github/workflows/checks.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Checks
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches:
7+
- develop
8+
9+
jobs:
10+
checks:
11+
12+
runs-on: ubuntu-latest
13+
container:
14+
image: docker/tilt:latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- uses: azure/[email protected]
20+
21+
- name: Create k8s Kind Cluster
22+
run: ctlptl create cluster kind --registry=ctlptl-registry
23+
24+
- name: Test Using Local Config
25+
run: tilt ci --timeout "5m"
26+
27+

README.MD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,5 @@ In the root directory of the repository run `tilt up`. This will start all the f
7979
To develop against the FAF infrastructure you should disable the service in tilt that you are actively developing. Once disabled you can start up your developed version. Some tweaks may need to be made to the default configuration parameters in the source code. The proper values can be found in the configMaps in each of the services kubernetes deploy yaml files.
8080

8181
## Test Data
82-
The default test data that is loaded can be found in /sql/test-data.sql. This can be overridden by providing a new path with the tilt configuration key test-data-path when running tilt up or in the tilt_config.json file in the repository root directory.
82+
The default test data that is loaded can be found in [faf-db](https://github.com/FAForever/db/blob/develop/test-data.sql)
8383

Tiltfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def no_policy_server(yaml):
156156

157157
k8s_yaml("cluster/namespaces.yaml")
158158
k8s_yaml(helm_with_build_cache("infra/clusterroles", namespace="faf-infra", values=["config/local.yaml"]))
159-
k8s_resource(new_name="namespaces", objects=["faf-infra:namespace", "faf-apps:namespace", "faf-ops:namespace"], labels=["core"])
159+
k8s_resource(new_name="namespaces", objects=["faf-infra:namespace", "faf-apps:namespace", "faf-ops:namespace", "traefik:namespace"], labels=["core"])
160160
k8s_resource(new_name="clusterroles", objects=["read-cm-secrets:clusterrole"], labels=["core"])
161161
k8s_resource(new_name="init-apps", objects=["init-apps:serviceaccount:faf-infra", "init-apps:serviceaccount:faf-apps", "allow-init-apps-read-app-config-infra:rolebinding", "allow-init-apps-read-app-config-apps:rolebinding"], resource_deps=["clusterroles"], labels=["core"])
162162

@@ -182,7 +182,7 @@ for object in decode_yaml_stream(traefik_yaml):
182182
if kind != "deployment" and kind != "service":
183183
traefik_identifiers.append(name + ":" + kind)
184184

185-
k8s_resource(new_name="traefik-setup", objects=traefik_identifiers, labels=["traefik"])
185+
k8s_resource(new_name="traefik-setup", objects=traefik_identifiers, resource_deps=["namespaces"], labels=["traefik"])
186186
k8s_resource(workload="release-name-traefik", new_name="traefik", port_forwards=["443:8443"], resource_deps=["traefik-setup"], labels=["traefik"])
187187

188188
postgres_yaml = helm_with_build_cache("infra/postgres", namespace="faf-infra", values=["config/local.yaml"])
@@ -237,9 +237,11 @@ k8s_resource(workload="populate-db", resource_deps=["faf-db-migrations"], labels
237237
k8s_yaml(keep_objects_of_kind(helm_with_build_cache("apps/faf-voting", namespace="faf-apps", values=["config/local.yaml"]), kinds=["ConfigMap", "Secret"]))
238238
k8s_resource(new_name="faf-voting-config", objects=["faf-voting:configmap", "faf-voting:secret"], labels=["voting"])
239239

240-
k8s_yaml(helm_with_build_cache("apps/faf-website", namespace="faf-apps", values=["config/local.yaml", "apps/faf-website/values-prod.yaml"]))
240+
website_yaml = helm_with_build_cache("apps/faf-website", namespace="faf-apps", values=["config/local.yaml", "apps/faf-website/values-prod.yaml"])
241+
website_yaml = patch_config(website_yaml, "faf-website", {"OAUTH_URL": "http://ory-hydra:4444", "OAUTH_PUBLIC_URL": "http://localhost:4444", "API_URL": "http://faf-api:8010", "WP_URL": "http://wordpress:80"})
242+
k8s_yaml(website_yaml)
241243
k8s_resource(new_name="faf-website-config", objects=["faf-website:configmap", "faf-website:secret"], labels=["website"])
242-
k8s_resource(workload="faf-website", objects=["faf-website:ingressroute"], resource_deps=["traefik"], labels=["website"], links=[link("https://www.localhost", "FAForever Website")])
244+
k8s_resource(workload="faf-website", objects=["faf-website:ingressroute"], resource_deps=["traefik", "wordpress"], labels=["website"], links=[link("https://www.localhost", "FAForever Website")])
243245

244246
# k8s_yaml(helm_with_build_cache("apps/faf-content", namespace="faf-apps", values=["config/local.yaml"]))
245247
# k8s_resource(new_name="faf-content-config", objects=["faf-content:configmap"], labels=["content"])

apps/faf-icebreaker/templates/config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ data:
99
HYDRA_URL: "https://hydra.{{.Values.baseDomain}}"
1010
SELF_URL: "https://ice.{{.Values.baseDomain}}"
1111
DB_USERNAME: "faf-icebreaker"
12+
DB_NAME: "faf-icebreaker"
1213
DB_URL: "jdbc:mariadb://mariadb:3306/faf-icebreaker?ssl=false"
1314
RABBITMQ_HOST: "rabbitmq"
1415
RABBITMQ_USER: "faf-icebreaker"

apps/faf-user-service/templates/deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ spec:
4040
limits:
4141
memory: 10Gi
4242
cpu: 3000m
43+
requests:
44+
memory: 2Gi
45+
cpu: 1000m
4346
startupProbe:
4447
httpGet:
4548
port: 8080

apps/ory-hydra/templates/init-clients.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,12 @@ spec:
6666
--policy-uri "{{ .policyUri }}" \
6767
{{- end }}
6868
{{- if .tokenEndpointAuthMethod }}
69-
--token-endpoint-auth-method "{{ .tokenEndpointAuthMethod }}"
69+
--token-endpoint-auth-method "{{ .tokenEndpointAuthMethod }}" \
7070
{{- end }}
7171
{{- if .owner }}
72-
--owner "{{ .owner }}"
72+
--owner "{{ .owner }}" \
7373
{{- end }}
74+
;
7475
else
7576
echo "Client {{ .id }} already exists, skipping."
7677
fi

cluster/namespaces.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,10 @@ metadata:
1313
apiVersion: v1
1414
kind: Namespace
1515
metadata:
16-
name: faf-ops
16+
name: faf-ops
17+
18+
---
19+
apiVersion: v1
20+
kind: Namespace
21+
metadata:
22+
name: traefik

infra/mariadb/values.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ databasesAndUsers:
5050
usernameKey: DB_LOGIN
5151
passwordKey: DB_PASSWORD
5252

53+
# Icebreaker database
54+
- configMapRef: faf-icebreaker
55+
secretRef: faf-icebreaker
56+
databaseKey: DB_NAME
57+
usernameKey: DB_USERNAME
58+
passwordKey: DB_PASSWORD
59+
5360
# Others
5461
- configMapRef: wordpress
5562
secretRef: wordpress

0 commit comments

Comments
 (0)