Skip to content

Commit

Permalink
update Taskfile and tf tests
Browse files Browse the repository at this point in the history
  • Loading branch information
J0hn-B committed Oct 16, 2023
1 parent 2c0a036 commit 4d197b2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 69 deletions.
14 changes: 6 additions & 8 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,13 @@ tasks:
{{ if and (eq OS "linux") (ne (env "KUBECONFIG") "") }}Kubeconfig path: {{(env "KUBECONFIG")}}{{end}}
cmds:
# Source the server.sh script to start docker
- '{{if eq OS "linux"}}source .github/scripts/server.sh{{end}}'
- '{{if eq OS "linux"}}source .github/scripts/server.sh{{end}}' # Source the server.sh script to start docker

# If KUBECONFIG env var is not set, set it to point to the Windows host
- '{{if eq OS "linux"}}[ -z "$KUBECONFIG" ] && echo "Set KUBECONFIG env var ==> {{.KUBE}}" && exit 1 \
|| k3d cluster create {{.CLUSTER_NAME}} --api-port 6443 -p 8080:80@loadbalancer --agents 2{{end}}'

# If host is Windows, create cluster
- '{{if eq OS "windows"}}k3d cluster create {{.CLUSTER_NAME}} --api-port 6443 -p 8080:80@loadbalancer --agents 2{{end}}'
# If KUBECONFIG env var is not set, set it to point to the Windows host (or the host where the kubeconfig file is located)
- '{{if eq OS "linux"}}[ -z "$KUBECONFIG" ] && echo "Set KUBECONFIG env var ==> {{.KUBE}}" \
&& exit 1 || k3d cluster create {{.CLUSTER_NAME}} --api-port 6443 -p 8080:80@loadbalancer --agents 2{{end}}'

- '{{if eq OS "windows"}}k3d cluster create {{.CLUSTER_NAME}} --api-port 6443 -p 8080:80@loadbalancer --agents 2{{end}}' # If host is Windows, create cluster
status:
- k3d cluster list {{.CLUSTER_NAME}} # If cluster exists, skip the task
silent: true
Expand All @@ -51,6 +48,7 @@ tasks:
cmds:
- task: create
- task: tf_init
- terraform -chdir='{{fromSlash "kube/bootstrap"}}' test
- terraform -chdir='{{fromSlash "kube/bootstrap"}}' apply -auto-approve

delete:
Expand Down
60 changes: 0 additions & 60 deletions docs/release_v0.1.0.md

This file was deleted.

15 changes: 14 additions & 1 deletion kube/bootstrap/tests/argocd.tftest.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,23 @@ run "argocd_ingress" {

command = plan

# Verify ArgoCD yaml manifest apiVersion
# Verify ArgoCD ingress apiVersion
assert {
condition = kubernetes_manifest.argocd_ingress.manifest.apiVersion == "networking.k8s.io/v1"
error_message = "ArgoCD yaml manifest apiVersion did not match expected"
}

# Verify ArgoCD ingress port
assert {
condition = kubernetes_manifest.argocd_ingress.manifest.spec.rules[0].http.paths[0].backend.service.port.number == 80
error_message = "ArgoCD ingress port did not match expected"
}

# Verify ArgoCD ingress path
assert {
condition = kubernetes_manifest.argocd_ingress.manifest.spec.rules[0].http.paths[0].path == "/argocd"
error_message = "ArgoCD ingress path did not match expected"
}

}

0 comments on commit 4d197b2

Please sign in to comment.