-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
89 lines (71 loc) · 3.21 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
.PHONY: help
GCP_PROJECT ?= pluralsh
APP_NAME ?= console
APP_VSN ?= `git describe`
BUILD ?= `git rev-parse --short HEAD`
DKR_HOST ?= dkr.plural.sh
PLRL_WWW ?= ../plural/www/src
dep ?= forge-core
GIT_COMMIT ?= abd123
TARGETARCH ?= amd64
help:
@perl -nle'print $& if m{^[a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
build: ## Build the Docker image
docker build --build-arg GIT_COMMIT=$(GIT_COMMIT) \
--build-arg TARGETARCH=$(TARGETARCH) \
-t $(APP_NAME):$(APP_VSN) \
-t $(APP_NAME):latest \
-t gcr.io/$(GCP_PROJECT)/$(APP_NAME):$(APP_VSN) \
-t $(DKR_HOST)/console/$(APP_NAME):$(APP_VSN) .
push: ## push to gcr
docker push gcr.io/$(GCP_PROJECT)/$(APP_NAME):$(APP_VSN)
docker push $(DKR_HOST)/console/$(APP_NAME):$(APP_VSN)
deploy: ## deploy artifacts to plural
cd plural && plural apply
bump-version: ## bumps the image version of this chart
plural utils image-bump plural/helm/console --tag $(APP_VSN) --path "image.tag"
testup: ## sets up dependent services for test
docker-compose up -d
testdown: ## tear down test dependencies
docker-compose down
migration:
MIX_ENV=test mix ecto.gen.migration $(name)
connectdb: ## proxies the db in kubernetes via kubectl
@echo "run psql -U forge -h 127.0.0.1 forge to connect"
kubectl port-forward statefulset/watchman-postgresql 5432 -n watchman
web: ## starts a local webserver
cd assets && yarn start
gql-codegen: ## generates introspection information for our graph
cd assets && yarn run graphql-codegen
yarn-add: ## adds a yarn dep
cd assets && yarn add $(dep)
import-incidents:
mv assets/src/components/incidents/queries.js queries.js
mv assets/src/components/incidents/Presence.js Presence.js
cp $(PLRL_WWW)/components/incidents/* assets/src/components/incidents
mv queries.js assets/src/components/incidents/queries.js
mv Presence.js assets/src/components/incidents/Presence.js
sed -i '' -- 's/\.\.\/models/graphql/g' assets/src/components/incidents/*
cp $(PLRL_WWW)/components/repos/Tags.js assets/src/components/repos/Tags.js
cp $(PLRL_WWW)/components/utils/AlternatingBox.js assets/src/components/utils/AlternatingBox.js
cp $(PLRL_WWW)/components/utils/TypeaheadEditor.js assets/src/components/utils/TypeaheadEditor.js
cp $(PLRL_WWW)/components/utils/Tooltip.js assets/src/components/utils/Tooltip.js
cp $(PLRL_WWW)/components/utils/SmoothScroller.js assets/src/components/utils/SmoothScroller.js
cp $(PLRL_WWW)/components/utils/hooks.js assets/src/components/utils/hooks.js
cp $(PLRL_WWW)/components/utils/icons.js assets/src/components/utils/icons.js
cp $(PLRL_WWW)/components/utils/TimedCache.js assets/src/components/utils/TimedCache.js
cp $(PLRL_WWW)/utils/date.js assets/src/utils/date.js
cp $(PLRL_WWW)/utils/slate.js assets/src/utils/slate.js
release-vsn: # tags and pushes a new release
@read -p "Version: " tag; \
git checkout master; \
git pull --rebase; \
git tag -a $$tag -m "new release"; \
git push origin $$tag
update-schema:
MIX_ENV=test mix absinthe.schema.sdl --schema Console.GraphQl schema/schema.graphql
cd assets && yarn graphql:codegen
delete-tag: ## deletes a tag from git locally and upstream
@read -p "Version: " tag; \
git tag -d $$tag; \
git push origin :$$tag