diff --git a/chart/Chart.yaml b/chart/Chart.yaml index 85e40c2..2b8688a 100644 --- a/chart/Chart.yaml +++ b/chart/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: badhouseplants-net description: A Helm chart for Kubernetes type: application -version: 0.3.5 +version: 0.3.6 appVersion: "1.16.0" diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index eefd219..e1d83fd 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -49,6 +49,9 @@ spec: args: - --baseURL - {{ .Values.hugo.baseURL }} + {{- if .Values.hugo.buildDrafts }} + - --buildDrafts + {{- end }} volumeMounts: - name: {{ .Values.volumes.rclone.name }} mountPath: /src/static diff --git a/chart/values.yaml b/chart/values.yaml index dce353b..2317388 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -34,6 +34,7 @@ hugo: pullPolicy: Always tag: latest baseURL: badhouseplants.net + buildDrafts: false istio: enabled: true diff --git a/content/posts/argocd-dynamic-environment-per-branch-part-1/index.md b/content/posts/argocd-dynamic-environment-per-branch-part-1/index.md index 2094bef..89b3c35 100644 --- a/content/posts/argocd-dynamic-environment-per-branch-part-1/index.md +++ b/content/posts/argocd-dynamic-environment-per-branch-part-1/index.md @@ -40,7 +40,7 @@ Before I can start deploying them, I have to prepare the application for that. A 1. Container must not contain any static content 2. I can't use only latest tags anymore 3. Helm chart has a lot of stuff that's hardcoded -4. CI pipelines must be rewritten almost completely +4. CI pipelines must be adjusted 5. Deployment process should be rethought ### Static Container @@ -142,6 +142,7 @@ I had to find all the values, that should be different between different environ 1. Istio `VirtualServices` hostnames (Or Ingress hostname, if you don't use Istio) 2. Image tag for the container with the source code 3. And a hostname that should be passed to hugo as a base URL +4. Preview environments should display pages that are still `drafts` So all of that I've put to `values.yaml` ```YAML @@ -152,6 +153,7 @@ istio: image: tag: $COMMIT_SHA baseURL: https://badhouseplants.net/ + buildDrafts: false ``` ### CI pipelines @@ -178,4 +180,6 @@ Now I need to push a new image on each commit instead of pushing only once the c from_secret: GITEA_TOKEN repo: git.badhouseplants.net/allanger/badhouseplants-net tags: ${DRONE_COMMIT_SHA} -``` \ No newline at end of file +``` + +Now if my code is not really broken, I'll have an image for each commit. And when I merge my branch to `main` I can use a tag from the latest preview build on for the production instance. So I'm almost sure that what I've tested before is what a visitor will see. \ No newline at end of file