-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
95 lines (70 loc) · 2.22 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
env = PYTHONPATH=validate_biobox_file:vendor/python/lib/python2.7/site-packages PATH=vendor/python/bin:$$PATH
pwd = $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
image = deb-builder
package_version = $(shell cat VERSION)-$(shell cat DEBIAN_PACKAGE_VERSION)
distributable = dist/validate-biobox-file.tar.xz
package = dist/validate-biobox-file_$(package_version)_amd64.deb
###############################################
#
# Workflow steps
#
###############################################
deploy: VERSION $(distributable) $(package)
bundle exec ./plumbing/push-to-s3 VERSION $(distributable)
bundle exec ./plumbing/push-to-deb $(package)
bundle exec ./plumbing/rebuild-website
package: $(package) $(distributable)
build: build/validate-biobox-file
BINARY='$(realpath $<)' \
bundle exec cucumber
feature: Gemfile.lock
BINARY='$(pwd)/vendor/python/bin/python $(pwd)/bin/validate-biobox-file' \
bundle exec cucumber
test:
$(env) nosetests --rednose
console:
$(env) python -i console.py
ssh: $(distributable) .image
docker run \
--tty \
--interactive \
--volume=$(pwd)/$(dir $<):/src:rw \
--entrypoint=/bin/bash \
$(image)
bootstrap: Gemfile.lock vendor/python
.PHONY: bootstrap console test feature build deploy ssh
###############################################
#
# Specific targets
#
###############################################
$(package): $(distributable) .image
docker run \
--volume=$(pwd)/$(dir $<):/src:rw \
$(image) $(package_version) $@
.image: images/deb-builder/Dockerfile
docker build --tag $(image) $(pwd)/$(dir $<)
$(distributable): build/validate-biobox-file
mkdir -p $(dir $@)
tar -c -J -f $@ $(dir $^)
build/validate-biobox-file: bin/validate-biobox-file $(shell find validate_biobox_file/*.py)
$(env) pyinstaller \
--workpath pyinstaller/build \
--specpath pyinstaller \
--onefile \
--noconfirm \
--clean \
--distpath build \
--path . \
--additional-hooks-dir=$(pwd)/pyinstaller \
bin/validate-biobox-file
cp doc/validate-biobox-file.mkd $(dir $@)README.mkd
cp VERSION $(dir $@)
vendor/python: requirements.txt
virtualenv $@
$@/bin/pip install -r $<
touch $@
Gemfile.lock: Gemfile
bundle install --path vendor/ruby
clean:
rm -rf build