This repository has been archived by the owner on Oct 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
tools.mk
75 lines (58 loc) · 1.8 KB
/
tools.mk
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
ifndef TOOLS_MK # Prevent repeated "-include".
TOOLS_MK := $(lastword $(MAKEFILE_LIST))
TOOLS_INCLUDE_DIR := $(dir $(TOOLS_MK))
# Define the tools here
tools.path := $(abspath $(build_dir)/tools)
tools.bin.path := $(abspath $(tools.path)/bin)
PACK := $(tools.bin.path)/pack
CREATE-PACKAGE := $(tools.bin.path)/create-package
GSUTIL := $(tools.path)/gsutil/gsutil
$(PACK).darwin:
@mkdir -p $(@D)
curl -sL https://github.com/buildpacks/pack/releases/download/v0.29.0/pack-v0.29.0-macos.tgz | tar -xz -C $(@D)
touch $@
$(PACK).linux:
@mkdir -p $(@D)
curl -sL https://github.com/buildpacks/pack/releases/download/v0.29.0/pack-v0.29.0-linux.tgz | tar -xz -C $(@D)
touch $@
$(PACK): $(PACK).$(os.name)
chmod +x $@
touch $@
YTT := $(tools.bin.path)/ytt
YTT.version := v0.41.1
$(YTT).darwin:
@mkdir -p $(@D)
curl -sL https://github.com/vmware-tanzu/carvel-ytt/releases/download/$(YTT.version)/ytt-darwin-amd64 -o $@
chmod +x $@
touch $@
$(YTT).linux:
@mkdir -p $(@D)
curl -sL https://github.com/vmware-tanzu/carvel-ytt/releases/download/$(YTT.version)/ytt-linux-amd64 -o $@
chmod +x $@
touch $@
$(YTT): $(YTT).$(os.name)
ln -sf $< $@
YJ := $(tools.bin.path)/yj
YJ.version := v5.1.0
$(YJ).darwin:
@mkdir -p $(@D)
curl -sL https://github.com/sclevine/yj/releases/download/$(YJ.version)/yj-macos-amd64 -o $@
chmod +x $@
touch $@
$(YJ).linux:
@mkdir -p $(@D)
curl -sL https://github.com/sclevine/yj/releases/download/$(YJ.version)/yj-linux-amd64 -o $@
chmod +x $@
touch $@
$(YJ): $(YJ).$(os.name)
ln -sf $< $@
$(CREATE-PACKAGE):
@mkdir -p $(@D)
GOBIN=$(@D) go install github.com/paketo-buildpacks/libpak/cmd/create-package@latest
$(GSUTIL):
@mkdir -p $(@D)
curl -sL https://storage.googleapis.com/pub/gsutil.tar.gz | tar -xz -C $(tools.path)
tools.clean:
$(RM) -rf $(tools.path)
clean .PHONY: tools.clean
endif