forked from cucumber/common
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
83 lines (71 loc) · 2.39 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
SHELL := /usr/bin/env bash
BUILD_IMAGE ?= $(shell grep "image: cucumber/cucumber-build:" .circleci/config.yml | cut -c 16-)
PACKAGES ?= messages \
gherkin \
gherkin-utils \
query
default: .rsynced $(patsubst %,default-%,$(PACKAGES))
.PHONY: default
default-%: %
cd $< && make default
update-dependencies: $(patsubst %,update-dependencies-%,$(PACKAGES))
.PHONY: update-dependencies
update-dependencies-%: %
cd $< && make update-dependencies
clean: $(patsubst %,clean-%,$(PACKAGES))
rm -f .rsynced
.PHONY: clean
clean-%: %
cd $< && make clean
ci: push_subrepos check_synced default
check_synced: .rsynced
[[ -z $$(git status -s) ]] || ( \
echo "Working copy is dirty. Please run 'source scripts/functions.sh && rsync_files' and commit modified files." && \
echo "Found: " && \
git status -s && \
exit 1 \
)
.PHONY: check_synced
push_subrepos:
source scripts/functions.sh && push_subrepos .
.PHONY: push_subrepos
.rsynced:
source scripts/functions.sh && rsync_files
touch $@
docker-run:
[ "${BUILD_IMAGE}" ] || (echo "Build image version could not be read from .circleci/config.yml" && exit 1)
[ -d "${HOME}/.m2/repository" ] || mkdir -p "${HOME}/.m2/repository"
docker run \
--publish "6006:6006" \
--volume "${shell pwd}":/app \
--volume "${HOME}/.m2/repository":/home/cukebot/.m2/repository \
--user 1000 \
--rm \
--interactive \
--tty \
${BUILD_IMAGE} \
bash
.PHONY:
docker-run-with-secrets:
[ -d '../secrets' ] || git clone keybase://team/cucumberbdd/secrets ../secrets
git -C ../secrets pull
../secrets/update_permissions
[ -d "${HOME}/.m2/repository" ] || mkdir -p "${HOME}/.m2/repository"
docker run \
--publish "6006:6006" \
--volume "${shell pwd}":/app \
--volume "${HOME}/.m2/repository":/home/cukebot/.m2/repository \
--volume "${shell pwd}/../secrets/.pause":/home/cukebot/.pause \
--volume "${shell pwd}/../secrets/.gem":/home/cukebot/.gem \
--volume "${shell pwd}/../secrets/.ssh":/home/cukebot/.ssh \
--volume "${shell pwd}/../secrets/.npmrc":/home/cukebot/.npmrc \
--volume "${shell pwd}/../secrets/configure":/home/cukebot/configure \
--volume "${shell pwd}/../secrets/codesigning.key":/home/cukebot/codesigning.key \
--volume "${shell pwd}/../secrets/gpg-with-passphrase":/home/cukebot/gpg-with-passphrase \
--env-file ../secrets/secrets.list \
--user 1000 \
--rm \
--interactive \
--tty \
${BUILD_IMAGE} \
bash