forked from ehazlett/docker-demo
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
46 lines (37 loc) · 1.31 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
CGO_ENABLED=0
GOOS=linux
GOARCH=amd64
TAG?=latest
REPO=ehazlett/docker-demo
MEDIA_SRCS=$(shell find ui/ -type f \
-not -path "ui/semantic/dist/*" \
-not -path "ui/node_modules/*")
all: media-semantic build
test:
@go test -v ./...
deps:
@go get -d ./...
build:
@go build -a -tags 'netgo' -ldflags '-w -linkmode external -extldflags -static' .
dev-setup:
@echo "This could take a while..."
@npm install --loglevel verbose -g gulp browserify babelify
@cd ui && npm install --loglevel verbose
@cd ui/node_modules/semantic-ui && gulp install
media-semantic: static/dist/.bundle_timestamp
static/dist/.bundle_timestamp: $(MEDIA_SRCS)
@cp -f ui/semantic.theme.config ui/semantic/src/theme.config
@mkdir -p ui/semantic/src/themes/app && cp -rf ui/semantic.theme/* ui/semantic/src/themes/app/
@cd ui/semantic && gulp build
@mkdir -p static/dist
@rm -rf static/dist/semantic* static/dist/themes
@cp -f ui/semantic/dist/semantic.min.css static/dist/semantic.min.css
@cp -f ui/semantic/dist/semantic.min.js static/dist/semantic.min.js
@mkdir -p static/dist/themes/default && cp -r ui/semantic/dist/themes/default/assets static/dist/themes/default/
@touch static/dist/.bundle_timestamp
image: build
@docker build -t $(REPO):$(TAG) .
clean:
@rm -rf docker-demo
@rm -rf static/dist/.bundle_timestamp
.PHONY: build deps clean image