Skip to content

Commit 90f19dc

Browse files
committed
add tutorial path to justfile, update license headers
1 parent 7ff52c0 commit 90f19dc

File tree

3 files changed

+28
-12
lines changed

3 files changed

+28
-12
lines changed

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) HashiCorp, Inc.
2+
# SPDX-License-Identifier: MPL-2.0
3+
14
# syntax=docker/dockerfile:1
25

36
FROM golang:1.25

Justfile

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1+
# Copyright (c) HashiCorp, Inc.
2+
# SPDX-License-Identifier: MPL-2.0
3+
14
set shell := ["bash", "-c"]
25
set positional-arguments
6+
alias test-docker := test
37

48
default: all
59
all: version build deploy-k8s status test clean
10+
test-tutorial-path: version build deploy-image-from-github status clean
611
clean-all: clean
712

813
[group('k8s')]
@@ -29,6 +34,18 @@ deploy-k8s:
2934

3035
echo "kubectl port-forward pod/vault-client 8080:8080"
3136

37+
[group('k8s')]
38+
deploy-image-from-github:clean
39+
@echo ">> running $0"
40+
./vault-setup.sh
41+
docker pull ghcr.io/hashicorp-education/learn-vault-golang-sdk/vault-sdk-go-app:latest
42+
kubectl get secret vault-auth-secret -o json | jq -r ".data.token" | base64 --decode > token
43+
minikube image load ghcr.io/hashicorp-education/learn-vault-golang-sdk/vault-sdk-go-app:latest
44+
sleep 5
45+
kubectl apply -f manifests/go-app.yaml
46+
47+
echo "kubectl port-forward pod/vault-client 8080:8080"
48+
3249
[group('k8s')]
3350
status:
3451
@echo ">> running $0"
@@ -37,26 +54,19 @@ status:
3754
[group('exe')]
3855
test:
3956
@echo ">> running $0"
40-
go run main.go
41-
42-
[group('docker')]
43-
test-docker:
44-
@echo ">> running $0"
45-
docker run -d --name vault-sdk-go-app --publish 8080:8080 ghcr.io/hashicorp-education/learn-vault-golang-sdk/vault-sdk-go-app:latest
46-
57+
curl http://localhost:8080
4758

4859
[group('k8s')]
4960
test-k8s:
5061
@echo ">> running $0"
51-
kubectl apply -f k8s-auth/go-app.yaml
52-
echo "kubectl port-forward pod/vault-client 8080:8080"
62+
kubectl exec -it vault-client -- curl http://localhost:8080
5363

5464
[group('k8s')]
5565
clean:
5666
@echo ">> running $0"
57-
kubectl delete -f go-app.yaml || true
58-
kubectl delete -f vault-auth-service-account.yaml || true
59-
kubectl delete -f vault-auth-secret.yaml || true
67+
kubectl delete -f manifests/go-app.yaml || true
68+
kubectl delete -f manifests/vault-auth-service-account.yaml || true
69+
kubectl delete -f manifests/vault-auth-secret.yaml || true
6070
minikube image rm ghcr.io/hashicorp-education/learn-vault-golang-sdk/vault-sdk-go-app:latest || true
6171
docker stop $(docker ps -aq --filter name=reference=ghcr.io/hashicorp-education/learn-vault-golang-sdk/vault-sdk-go-app) || true
6272
docker image rm $(docker image ls --filter "reference=ghcr.io/hashicorp-education/learn-vault-golang-sdk/vault-sdk-go-app" --format {{"{{.ID}}/"}}) || true

main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) HashiCorp, Inc.
2+
// SPDX-License-Identifier: MPL-2.0
3+
14
package main
25

36
import (

0 commit comments

Comments
 (0)