forked from dokku/dokku
-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.mk
49 lines (44 loc) · 2.21 KB
/
package.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
ifndef PKR_VAR_dokku_version
PKR_VAR_dokku_version = $(shell grep Version debian/control | cut -d' ' -f2)
endif
/tmp/build-dokku/var/lib/dokku/GIT_REV:
mkdir -p /tmp/build-dokku
mkdir -p /tmp/build-dokku/usr/share/bash-completion/completions
mkdir -p /tmp/build-dokku/usr/bin
mkdir -p /tmp/build-dokku/usr/share/doc/dokku
mkdir -p /tmp/build-dokku/usr/share/lintian/overrides
mkdir -p /tmp/build-dokku/usr/share/man/man1
mkdir -p /tmp/build-dokku/var/lib/dokku/core-plugins/available
cp dokku /tmp/build-dokku/usr/bin
cp LICENSE /tmp/build-dokku/usr/share/doc/dokku/copyright
cp contrib/bash-completion /tmp/build-dokku/usr/share/bash-completion/completions/dokku
find . -name ".DS_Store" -depth -exec rm {} \;
$(MAKE) go-build
cp common.mk /tmp/build-dokku/var/lib/dokku/core-plugins/common.mk
cp -r plugins/* /tmp/build-dokku/var/lib/dokku/core-plugins/available
find plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read plugin; do cd /tmp/build-dokku/var/lib/dokku/core-plugins/available/$$plugin && if [ -e Makefile ]; then $(MAKE) src-clean; fi; done
find plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read plugin; do touch /tmp/build-dokku/var/lib/dokku/core-plugins/available/$$plugin/.core; done
rm /tmp/build-dokku/var/lib/dokku/core-plugins/common.mk
$(MAKE) help2man
$(MAKE) addman
cp /usr/local/share/man/man1/dokku.1 /tmp/build-dokku/usr/share/man/man1/dokku.1
gzip -9 /tmp/build-dokku/usr/share/man/man1/dokku.1
ifeq ($(DOKKU_VERSION),master)
git describe --tags > /tmp/build-dokku/var/lib/dokku/VERSION
else
echo $(DOKKU_VERSION) > /tmp/build-dokku/var/lib/dokku/VERSION
endif
ifdef DOKKU_GIT_REV
echo "$(DOKKU_GIT_REV)" > /tmp/build-dokku/var/lib/dokku/GIT_REV
else
git rev-parse HEAD > /tmp/build-dokku/var/lib/dokku/GIT_REV
endif
.PHONY: image/build/digitalocean
image/build/digitalocean:
packer build -var 'dokku_version=${PKR_VAR_dokku_version}' contrib/images/digitalocean/packer.pkr.hcl
.PHONY: image/init/digitalocean
image/init/digitalocean:
packer init contrib/images/digitalocean/packer.pkr.hcl
.PHONY: image/validate/digitalocean
image/validate/digitalocean:
packer validate -var 'dokku_version=${PKR_VAR_dokku_version}' contrib/images/digitalocean/packer.pkr.hcl