-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (39 loc) · 1.51 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
version=0.2.1
app_name=cloudbleed-check
release_dir=dist/releases
build:
CGO_ENABLED=0 go build -ldflags '-w'
build-dists: build-linux build-darwin build-windows
build-linux: build-linux-386 build-linux-amd64
build-darwin: build-darwin-386 build-darwin-amd64
build-windows: build-windows-386 build-windows-amd64
build-linux-386:
$(call DIST_template,linux,386)
build-linux-amd64:
$(call DIST_template,linux,amd64)
build-darwin-386:
$(call DIST_template,darwin,386)
build-darwin-amd64:
$(call DIST_template,darwin,amd64)
build-windows-386:
$(call DIST_template,windows,386,.exe)
build-windows-amd64:
$(call DIST_template,windows,amd64,.exe)
define DIST_template =
$(eval dist_os := $(1))
$(eval dist_arch := $(2))
$(eval file_ext := $(3))
$(eval dist_dir := dist/${dist_os}/${app_name}-${version}-${dist_os}-${dist_arch})
mkdir -p ${dist_dir}
cp README.md ${dist_dir}
CGO_ENABLED=0 GOOS=${dist_os} GOARCH=${dist_arch} go build -o ${dist_dir}/${app_name}${file_ext} -ldflags '-w'
mkdir -p ${release_dir}
cd ${dist_dir}/.. ; tar -czf ../../${release_dir}/${app_name}-${version}-${dist_os}-${dist_arch}.tar.gz ${app_name}-${version}-${dist_os}-${dist_arch}
endef
docker-build:
docker build . --tag peterrosell/cloudbleed-check:${version} --tag peterrosell/cloudbleed-check:latest
docker-run:
cat test-data/matching-test/input-your-sites.txt | docker run -i peterrosell/cloudbleed-check:${version} | rev
docker-push:
docker push peterrosell/cloudbleed-check:${version}
docker push peterrosell/cloudbleed-check:latest