Skip to content

Commit 484dae0

Browse files
authored
Merge pull request #1126 from traPtitech/ci/ct-install
`ct install`をCIで実行する
2 parents 55ed41e + f71cbe3 commit 484dae0

File tree

2 files changed

+52
-1
lines changed

2 files changed

+52
-1
lines changed

.github/workflows/ci-helm.yaml

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@ jobs:
1616
- name: Set up Helm
1717
uses: azure/setup-helm@v4
1818

19+
- name: Set up kubectl
20+
uses: azure/setup-kubectl@v4
21+
1922
# Python is required because `ct lint` runs Yamale (https://github.com/23andMe/Yamale) and
2023
# yamllint (https://github.com/adrienverge/yamllint) which require Python
2124
- uses: actions/setup-python@v6
2225
with:
23-
python-version: '3.x'
26+
python-version: "3.x"
2427

2528
- name: Set up chart-testing
2629
uses: helm/chart-testing-action@v2.8.0
@@ -36,3 +39,50 @@ jobs:
3639
- name: Run chart-testing (lint)
3740
if: steps.list-changed.outputs.changed == 'true'
3841
run: ct lint --check-version-increment=false --validate-maintainers=false --target-branch ${{ github.event.repository.default_branch }}
42+
43+
- name: Create kind cluster
44+
uses: helm/kind-action@v1
45+
if: steps.list-changed.outputs.changed == 'true'
46+
47+
- name: Setup kind cluster
48+
if: steps.list-changed.outputs.changed == 'true'
49+
run: |
50+
# Install Traefik CRDs
51+
kubectl apply -f https://raw.githubusercontent.com/traefik/traefik/v3.0.0/docs/content/reference/dynamic-configuration/kubernetes-crd-definition-v1.yml
52+
53+
# Create namespace
54+
kubectl create namespace neoshowcase
55+
kubectl create namespace db
56+
57+
# Create ns secret
58+
kubectl create secret generic ns -n neoshowcase \
59+
--from-literal=db-password=mariadbpassword \
60+
--from-literal=mariadb-password=mariadbpassword \
61+
--from-literal=mongodb-password=mongodbpassword \
62+
--from-literal=s3-access-key=s3accesskey \
63+
--from-literal=s3-access-secret=s3accesssecret \
64+
--from-literal=registry-password=registrypassword \
65+
--from-literal=gitea-token=giteatoken \
66+
--from-literal=controller-token=controllertoken
67+
68+
# Create ns-keys secret
69+
ssh-keygen -t ed25519 -N "" -f id_ed25519
70+
kubectl create secret generic ns-keys -n neoshowcase \
71+
--from-file=id_ed25519=id_ed25519
72+
73+
# Add bitnami repo
74+
helm repo add bitnami https://charts.bitnami.com/bitnami
75+
76+
# Install MariaDB
77+
helm install mariadb bitnami/mariadb \
78+
--set image.tag=latest \
79+
--set auth.rootPassword=mariadbpassword \
80+
--set auth.database=neoshowcase \
81+
-n db
82+
83+
# Wait for MariaDB to be ready
84+
kubectl wait --for=condition=Ready pod -l app.kubernetes.io/instance=mariadb -n db --timeout=60s
85+
86+
- name: Run chart-testing (install)
87+
if: steps.list-changed.outputs.changed == 'true'
88+
run: ct install --charts charts/neoshowcase --namespace neoshowcase --helm-extra-args "--timeout 5m"

charts/neoshowcase/templates/config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ data:
5353
blocking:
5454
timeout: {{ .blocking.timeout }}
5555
{{- end }}
56+
serviceName: {{ $.Release.Name }}-controller
5657
ports:
5758
{{- $.Values.ports | toYaml | nindent 12 }}
5859
ss:

0 commit comments

Comments
 (0)