This repository has been archived by the owner on Jun 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
54 lines (45 loc) · 1.54 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
TAG?=$(shell git rev-parse --short=8 HEAD)
export TAG
all: build-landingpage build
install: install-go-deps install-npm
install-go-deps:
go get -u github.com/rakyll/statik
install-npm:
npm install --no-package-lock postcss-cli purgecss cssnano autoprefixer
# -- Go related targets
test:
go test ./...
build:
go generate
go build -ldflags "-X main.version=$(TAG)" -o gitreleases .
# -- Docker build
pack:
docker build -t registry.gitlab.com/mweibel/gitreleases:$(TAG) .
push:
docker push registry.gitlab.com/mweibel/gitreleases:$(TAG)
apply-secret:
kubectl apply -f k8s/secret.yml
deploy:
./k8s/deploy.sh $(TAG)
ship: build-landingpage build test pack push deploy
# -- Landingpage build
build-landingpage: public/style.min.css index.html public/script.js public/img/headline.png public/img/[email protected] public/img/logo.png public/img/favicon.ico | public public/img
public:
mkdir -p $@
public/img:
mkdir -p $@
public/style.min.css: style.css
npx purgecss --css style.css --content landingpage/index.html landingpage/script.js --out .
npx postcss style.css -o $@
rm style.css
style.css: landingpage/gitreleases.css landingpage/tachyons.min.css
cat landingpage/gitreleases.css landingpage/tachyons.min.css > $@
index.html:
cat landingpage/index.html | sed 's/{{TAG}}/$(TAG)/g' > public/$@
public/%.js: landingpage/%.js
cp $< $@
public/img/%.png: landingpage/img/%.png
cp $< $@
public/img/%.ico: landingpage/img/%.ico
cp $< $@
.PHONY: all install install-go-deps install-npm test build build-landingpage index.html pack push apply-secret deploy ship