-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
49 lines (34 loc) · 1.23 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
NAME:=$(shell basename `git rev-parse --show-toplevel`)
BUILDERNAME=alpine-golang
RELEASE:=$(shell git rev-parse --verify --short HEAD)
USER=bketelsen
PWD:=$(shell pwd)
all: docker-push
builder: builder-push
builder-clean:
docker rmi ${BUILDERNAME} &>/dev/null || true
docker rmi ${NAME} &>/dev/null || true
builder-build: builder-clean
docker build --no-cache --pull=true -t ${USER}/${BUILDERNAME}:${RELEASE} . -f Dockerfile.build
docker tag ${USER}/${BUILDERNAME}:${RELEASE} ${USER}/${BUILDERNAME}:latest
builder-push: builder-build
docker login -u ${USER}
docker push ${USER}/${BUILDERNAME}:${RELEASE}
docker push ${USER}/${BUILDERNAME}:latest
clean:
rm -rf bin/${NAME}
test: clean
GO_ENV=test APP_PATH=./ go test ./...
build:
npm rebuild node-sass
npm i
buffalo build -z
docker-clean:
docker rmi ${NAME} &>/dev/null || true
docker-build: docker-clean
docker run --rm -it -v ${PWD}:/root/src/github.com/gopheracademy/learn -w /root/src/github.com/gopheracademy/learn ${USER}/alpine-golang:latest
docker build --pull=true --no-cache -t ${USER}/${NAME}:${RELEASE} .
docker tag ${USER}/${NAME}:${RELEASE} ${USER}/${NAME}:latest
docker-push: docker-build
docker push ${USER}/${NAME}:${RELEASE}
docker push ${USER}/${NAME}:latest