Skip to content

Instantly share code, notes, and snippets.

@audacioustux
Created November 30, 2023 17:37
Show Gist options
  • Save audacioustux/77b7342c7504e90e77c71577552c92a8 to your computer and use it in GitHub Desktop.
Save audacioustux/77b7342c7504e90e77c71577552c92a8 to your computer and use it in GitHub Desktop.
version: "3"
tasks:
default: task --list-all
# provision
prod:up: INFRA=prod bin/up.sh
dev:up: bin/up.sh
# access
argo:password: echo "Bearer $(kubectl get secret -n argo default.service-account-token -o=jsonpath='{.data.token}' | base64 --decode)"
argo:port-forward: kubectl port-forward -n argo svc/argo-server 2746
argocd:password: echo "$(kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d)"
argocd:port-forward: kubectl port-forward svc/argocd-server -n argocd 8080:443
grafana:port-forward: ebort -- kubectl port-forward -n monitoring svc/kube-prometheus-stack-grafana 3000:80 2> /dev/null # user:pass=admin:prom-operator
prometheus:port-forward: ebort -- kubectl port-forward -n monitoring svc/kube-prometheus-stack-prometheus 9090 2> /dev/null
# misc
cf-tunnel:
vars:
NS: cloudflared
cmds:
- kubectl create ns {{.NS}} --dry-run=client -o yaml | kubectl apply -f -
- kubectl apply -k k8s/kustomize/cloudflared -n {{.NS}}
- kubectl create secret generic cloudflare-config --from-literal=TUNNEL_TOKEN=$CLOUDFLARE_TUNNEL_TOKEN --dry-run=client -o yaml | kubectl apply -n {{.NS}} -f -
update-kubeconfig:
dir: terraform
cmd: aws eks --region $(terraform output -raw region) update-kubeconfig --name $(terraform output -raw cluster_name)
traffic-simulate: echo "GET https://ec-helloworld-go.knative-serving.127.0.0.1.sslip.io" | vegeta attack -insecure -workers 20 -rate 200 | vegeta report
# wasmjs
wasmjs:publish:
cmd: >-
pack build ${OCI_REGISTRY_USERNAME:?}/wasmjs-runtime
--publish
-b docker.io/paketocommunity/rust
-B paketobuildpacks/builder-jammy-base
-e BP_CARGO_WORKSPACE_MEMBERS="wasmjs-runtime"
wasmjs:engine:build:
dir: crates/wasmjs-engine
cmd: task build
wasmjs:examples:hono:build:
dir: examples/ec-wasmjs-hono
cmds:
- npm install
- npm run build
internal: true
wasmjs:test:
deps:
- wasmjs:engine:build
- wasmjs:examples:hono:build
dir: examples/ec-wasmjs-hono
cmd: cargo run --bin wasmjs-runtime bin/
# billing
billing:publish:
cmd: >-
pack build ${OCI_REGISTRY_USERNAME:?}/ec-billing-api
--publish
-b docker.io/paketocommunity/rust
-B paketobuildpacks/builder-jammy-base
-e BP_NODE_RUN_SCRIPTS="billing-api"
billing:check:
dir: crates/billing-api
cmd: cargo watch -x check -s 'touch .trigger'
internal: true
billing:watch:
dir: crates/billing-api
cmd: mirrord exec -f .mirrord/mirrord.json -- systemfd --no-pid -s http::4000 -- cargo watch --no-vcs-ignores -w .trigger -x 'run --bin billing-api -- --port 4000'
internal: true
billing:dev:
deps:
- billing:check
- billing:watch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment