forked from nucleotides/nucleotides-data
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (41 loc) · 1.45 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
validate = ! bundle exec kwalify -lf $1 | grep --after-context=1 INVALID
data = $(subst .yml,,$(shell ls data))
name = nucleotides/data
################################################
#
# Deploy data container
#
################################################
deploy: .image
docker login --username=$$DOCKER_USER --password=$$DOCKER_PASS --email=$$DOCKER_EMAIL
docker tag $(name) $(name):staging
docker push $(name):staging
.image: $(shell find controlled_vocabulary inputs -name '*.yml') Dockerfile
docker build --tag=$(name) .
touch $@
################################################
#
# Ensure inputs match schema, and S3 files exist
#
################################################
types = $(addprefix cv/,$(shell ls controlled_vocabulary))
inputs = $(addprefix inputs/,$(shell ls inputs))
.test_token/inputs/%: schema/% inputs/%
$(call validate,$^)
@touch $@
.test_token/cv/%: schema/controlled_vocabulary.yml controlled_vocabulary/%
$(call validate,$^)
@touch $@
.test_token/input_s3_files_exist: ./bin/validate-s3-files inputs/file.yml inputs/biological_source.yml
@bundle exec $^
@touch $@
test: $(addprefix .test_token/,$(inputs) $(types)) .test_token/input_s3_files_exist
################################################
#
# Bootstrap required resources
#
################################################
bootstrap: Gemfile.lock
mkdir -p .test_token/cv .test_token/inputs
Gemfile.lock: Gemfile
bundle install --path vendor/bundle