-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
63 lines (46 loc) · 1.73 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
ROOT := $(shell git rev-parse --show-toplevel)
PROJECT := chat-lewi
build-dir:
mkdir -p .build
# TODO(jeremy): Get rid of this rule
build-go: build
build: build-dir
CGO_ENABLED=0 go build -o .build/hydros github.com/jlewi/hydros/cmd
tidy-go:
gofmt -s -w .
goimports -w .
tidy: tidy-go
lint-go:
# golangci-lint automatically searches up the root tree for configuration files.
golangci-lint run
lint: lint-go
# TODO(jeremy): get rid of this rule
test-go: test
test:
GITHUB_ACTIONS=true go test -v ./...
# Build with ko
# This is much faster
# TODO(jeremy): We should add support to image.yaml to use ko
build-ko-image:
KO_DOCKER_REPO=us-west1-docker.pkg.dev/foyle-public/images/hydros \
ko build --bare github.com/jlewi/hydros/cmd
# This builds the image using hydros which uses GCB
build-image:
go run github.com/jlewi/hydros/cmd build -f images.yaml
# N.B. The makefile commands to update the manifest were deleted as part of switching to hydros to build the images
# We should now be able to use hydros to update the manifest and pin the images
# hydrate uses the hydros takeover command to apply the sync configuration and push
# hydrated manifests to the manifests repository.
hydrate:
hydros takeover \
--file=$(ROOT)/manifests/manifestsync.yaml \
--app-id=266158 \
--work-dir=.build/run-hydros \
--private-key="gcpSecretManager:///projects/chat-lewi/secrets/hydros-jlewi/versions/latest"
# Apply works by checking out the hydrated manifests and then applying them using a kubectl command.
apply:
cd .build/run-hydros/hydros-dev-takeover/dest && git fetch origin && \
git checkout origin/main
kubectl --context=hydros apply \
-R -f .build/run-hydros/hydros-dev-takeover/dest/hydros/lewi
update: update-image hydrate apply