This repository has been archived by the owner on Aug 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
75 lines (57 loc) · 1.68 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
.PHONY: default builder build run test clean \
login godep_reset godep \
default: release_darwin_local
PACKAGE_LIST := ./aws ./cfn ./cfn_template ./commands ./conf ./constants ./daemon ./files ./logger ./promote ./provision ./sample_project ./util
test: prebuild
docker build -t porter-test -f Dockerfile.test .
docker run -it --rm \
-e TEST=true \
porter-test
build_darwin: prebuild
CGO_ENABLED=0 godep go build -a --installsuffix cgo -ldflags '-s' -o porter
build_linux:
docker build -t porter -f Dockerfile.linux .
docker run --rm -v $$PWD:/host porter
# Create a darwin build for production release
stage_darwin: build_darwin
mkdir -p bin
mv porter bin/porter_darwin386
# Create a linux build for production release
stage_linux: build_linux
mkdir -p bin
mv porter bin/porter_linux386
stage: stage_darwin stage_linux
# Create a darwin build and place it in ~/bin which should be in your $PATH
release_darwin_local:
./release_porter upload dev
mv bin/porter_darwin386 ~/bin/porter
# Push a release into production
release_PRODUCTION: clean
godep restore
./release_porter upload
prebuild: generate fmt vet
fmt:
gofmt -s -w .
vet:
go vet $$PACKAGE_LIST
generate:
# TODO fix this to not include vendor
- go generate ./...
clean:
- rm -fr bin
- rm -fr porter
- rm -fr *.gz
- rm -fr *.docker
- find . -path "*_generated.go" -exec rm {} \;
# blow out any changes to the Godeps folder
godep_reset:
git reset -- Godeps vendor
git checkout -- Godeps vendor
git clean -df Godeps vendor
godep:
docker build -t porter-godep -f Dockerfile.godep .
docker run \
-it --rm \
-v $$PWD:/go/src/github.com/adobe-platform/porter \
-w /go/src/github.com/adobe-platform/porter \
porter-godep