Skip to content

Commit 694b71a

Browse files
authored
Merge pull request #56 from replicatedhq/em/helm-install-workflow-updates
2 parents c36cb69 + 1046ba5 commit 694b71a

File tree

8 files changed

+29
-24
lines changed

8 files changed

+29
-24
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,5 @@ applications/wg-easy/release/
5656
applications/wg-easy/*/charts/
5757
applications/wg-easy/*/Chart.lock
5858
.aider*
59+
# SpecStory explanation file
60+
.specstory/.what-is-this.md

applications/wg-easy/README.md

-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ applications/wg-easy/
6969

7070
## Architecture Overview
7171

72-
![Architecture Diagram](docs/architecture.png)
73-
7472
Key components:
7573
- **Taskfile**: Orchestrates the workflow with automated tasks
7674
- **Helmfile**: Manages chart dependencies and installation order

applications/wg-easy/Taskfile.yaml

+16-15
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ includes:
66

77
vars:
88
# Application configuration
9-
APP_NAME: '{{.REPLICATED_APP | default "wg-easy"}}'
9+
APP_SLUG: '{{.REPLICATED_APP | default "wg-easy"}}'
1010

1111
# Cluster configuration
1212
CLUSTER_NAME: '{{.CLUSTER_NAME | default "test-cluster"}}'
@@ -38,8 +38,9 @@ vars:
3838
tasks:
3939
default:
4040
desc: Show available tasks
41+
silent: true
4142
cmds:
42-
- task -s --list
43+
- task --list
4344

4445
cluster-create:
4546
desc: Create a test cluster using Replicated Compatibility Matrix (use EMBEDDED=true for embedded clusters)
@@ -49,24 +50,24 @@ tasks:
4950
EMBEDDED: '{{.EMBEDDED | default "false"}}'
5051
LICENSE_ID: '{{if eq .EMBEDDED "true"}}{{.LICENSE_ID | default "2cmqT1dBVHZ3aSH21kPxWtgoYGr"}}{{end}}'
5152
TIMEOUT: '{{if eq .EMBEDDED "true"}}420{{else}}300{{end}}'
53+
TTL: '{{.TTL | default "4h"}}'
5254
status:
5355
- replicated cluster ls --output json | jq -e '.[] | select(.name == "{{.CLUSTER_NAME}}")' > /dev/null
5456
cmds:
5557
- |
5658
if [ "{{.EMBEDDED}}" = "true" ]; then
5759
echo "Creating embedded cluster {{.CLUSTER_NAME}} with license ID {{.LICENSE_ID}}..."
58-
replicated cluster create --distribution embedded-cluster --name {{.CLUSTER_NAME}} --license-id {{.LICENSE_ID}}
60+
replicated cluster create --distribution embedded-cluster --name {{.CLUSTER_NAME}} --license-id {{.LICENSE_ID}} --ttl {{.TTL}}
5961
else
6062
echo "Creating cluster {{.CLUSTER_NAME}} with distribution {{.DISTRIBUTION}}..."
61-
replicated cluster create --name {{.CLUSTER_NAME}} --distribution {{.DISTRIBUTION}} --version {{.K8S_VERSION}} --disk {{.DISK_SIZE}} --instance-type {{.INSTANCE_TYPE}}
63+
replicated cluster create --name {{.CLUSTER_NAME}} --distribution {{.DISTRIBUTION}} --version {{.K8S_VERSION}} --disk {{.DISK_SIZE}} --instance-type {{.INSTANCE_TYPE}} --ttl {{.TTL}}
6264
fi
6365
- task: utils:wait-for-cluster
6466
vars:
6567
TIMEOUT: "{{.TIMEOUT}}"
6668

67-
list-cluster:
69+
cluster-list:
6870
desc: List the cluster
69-
silent: false
7071
cmds:
7172
- |
7273
CLUSTER_ID=$(replicated cluster ls --output json | jq -r '.[] | select(.name == "{{.CLUSTER_NAME}}") | .id')
@@ -82,7 +83,6 @@ tasks:
8283
- sleep 5
8384
- echo "Tests completed!"
8485

85-
8686
verify-kubeconfig:
8787
desc: Verify kubeconfig
8888
silent: false
@@ -126,6 +126,7 @@ tasks:
126126
dependencies-update:
127127
desc: Update Helm dependencies for all charts
128128
silent: false
129+
run: once
129130
cmds:
130131
- echo "Updating Helm dependencies for all charts..."
131132
- |
@@ -189,7 +190,6 @@ tasks:
189190
- setup-kubeconfig
190191
- ports-expose
191192

192-
193193
cluster-delete:
194194
desc: Delete all test clusters with matching name and clean up kubeconfig
195195
silent: false
@@ -278,22 +278,23 @@ tasks:
278278
279279
- echo "Release files prepared in ./release/ directory"
280280
deps:
281-
- update-version
282-
281+
- dependencies-update
283282

284283
release-create:
285284
desc: Create and promote a release using the Replicated CLI
286285
silent: false
287286
vars:
288287
CHANNEL: '{{.CHANNEL | default "Unstable"}}'
289288
RELEASE_NOTES: '{{.RELEASE_NOTES | default "Release created via task release-create"}}'
289+
requires:
290+
vars: [APP_SLUG, VERSION]
290291
cmds:
291-
- echo "Creating and promoting release for $APP_NAME to channel $CHANNEL..."
292+
- echo "Creating and promoting release for {{.APP_SLUG}} to channel {{.CHANNEL}}..."
292293
- |
293294
# Create and promote the release in one step
294295
echo "Creating release from files in ./release directory..."
295-
replicated release create --app $APP_NAME --yaml-dir ./release --release-notes "$RELEASE_NOTES" --promote $CHANNEL --version $VERSION
296-
echo "Release version $VERSION created and promoted to channel $CHANNEL"
296+
replicated release create --app {{.APP_SLUG}} --yaml-dir ./release --release-notes "{{.RELEASE_NOTES}}" --promote {{.CHANNEL}} --version {{.VERSION}}
297+
echo "Release version {{.VERSION}} created and promoted to channel {{.CHANNEL}}"
297298
deps:
298299
- release-prepare
299300

@@ -342,12 +343,12 @@ tasks:
342343
status:
343344
- |
344345
# Check if the application tarball has already been downloaded and extracted
345-
gcloud compute ssh {{.VM_NAME}} --project={{.GCP_PROJECT}} --zone={{.GCP_ZONE}} --command="test -d ./{{.APP_NAME}}" &>/dev/null
346+
gcloud compute ssh {{.VM_NAME}} --project={{.GCP_PROJECT}} --zone={{.GCP_ZONE}} --command="test -d ./{{.APP_SLUG}}" &>/dev/null
346347
cmds:
347348
- task: utils:gcp-operations
348349
vars:
349350
OPERATION: "setup-embedded"
350-
APP_NAME: '{{.APP_NAME}}'
351+
APP_SLUG: '{{.APP_SLUG}}'
351352
CHANNEL: '{{.CHANNEL}}'
352353
AUTH_TOKEN: '{{.AUTH_TOKEN}}'
353354
GCP_PROJECT: '{{.GCP_PROJECT}}'

applications/wg-easy/container/Containerfile

+8-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ RUN apt-get update && apt-get install -y \
1717
curl \
1818
jq \
1919
less \
20-
yq \
2120
gnupg \
2221
bash-completion \
2322

@@ -42,6 +41,14 @@ RUN curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | b
4241
# Install Task
4342
&& sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin \
4443

44+
# Install yq
45+
&& curl -Ls $(curl -s https://api.github.com/repos/mikefarah/yq/releases/latest \
46+
| grep "browser_download_url.*linux_${TARGETARCH}" \
47+
| cut -d : -f 2,3 \
48+
| tr -d \") -o yq \
49+
&& chmod +x yq \
50+
&& mv yq /usr/local/bin/yq \
51+
4552
# Install Helmfile
4653
&& curl -Ls $(curl -s https://api.github.com/repos/helmfile/helmfile/releases/latest \
4754
| grep "browser_download_url.*linux_${TARGETARCH}.tar.gz" \

applications/wg-easy/docs/chart-structure.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ This document explains the modular chart approach used in the WG-Easy Helm chart
44

55
## Modular Chart Architecture
66

7-
![Chart Structure](architecture.png)
8-
97
The WG-Easy pattern is built around a modular approach to Helm charts, where upstream charts are wrapped in local charts and enhanced with shared templates and customizations.
108

119
### Directory Structure
@@ -94,7 +92,7 @@ releases:
9492
chart: ./cert-manager
9593
createNamespace: true
9694
wait: true
97-
95+
9896
- name: cert-manager-issuers
9997
namespace: cert-manager
10098
chart: ./cert-manager-issuers

applications/wg-easy/docs/development-workflow.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,12 @@ The core philosophy of this workflow is to start simple and add complexity incre
1111
- Build confidence in changes through progressive validation
1212
- Maintain high velocity while ensuring quality
1313

14-
![Workflow Diagram](workflow-diagram.png)
15-
1614
## Prerequisites
1715

1816
Before starting the development workflow, ensure you have the following tools installed:
1917

2018
- **Task:** The task runner used in this project. ([Installation Guide](https://taskfile.dev/installation/))
21-
- **Container runtime tool** Either [Podman](https://podman.io/docs/installation) (default) or [Docker](https://docs.docker.com/get-docker/) for local development
19+
- **Container runtime tool** Either [Podman](https://podman.io/docs/installation) (default) or [Docker](https://docs.docker.com/get-docker/) for local development. Export `CONTAINER_RUNTIME=docker` in your shell if you use docker.
2220

2321
All other tools will be automatically provided through task commands and containers.
2422

applications/wg-easy/replicated/application.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
apiVersion: kots.io/v1beta1
23
kind: Application
34
metadata:

0 commit comments

Comments
 (0)