-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
111 lines (90 loc) · 2.82 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
.PHONY: help install clean build release deploy_staging_app deploy_development_app
help: help_common \
help_server \
help_client \
help_dummy \
help_electionguard \
help_verifier
include bulletin_board/server.mk
include bulletin_board/client.mk
include voting_schemes/dummy/makefile.mk
include voting_schemes/electionguard/makefile.mk
include verifier/makefile.mk
install: install_server \
install_client \
install_dummy \
install_electionguard
clean: clean_server \
clean_client \
clean_dummy \
clean_electionguard
build: build_server \
build_client \
build_dummy \
build_electionguard
test: test_server \
test_client \
test_dummy \
test_electionguard
sync_main:
git checkout develop && \
git pull && \
git checkout main && \
git pull && \
git rebase develop && git push
sync_develop:
git checkout main && \
git pull && \
git checkout develop && \
git pull && \
git rebase main && git push
release: check_clean_repo \
check_version \
bump_versions \
pre_release_server \
build \
check_release_flag \
update_changelog \
commit_and_push \
release_server \
release_client \
release_dummy \
release_electionguard
deploy_login:
heroku login
heroku container:login
deploy_development_app:
./scripts/deploy_development_app.sh
deploy_staging_app: check_main_branch
./scripts/deploy_staging_app.sh
# SUBTASKS
help_common:
@echo 'Common tasks:'
@echo ' install - Install all dependencies.'
@echo ' build - Compile all artifacts.'
@echo ' clean - Remove all artifacts from the project.'
@echo ' test - Run all tests.'
@echo ' sync_main - Prepare the local repo to perform the release. It pulls the last commits and updates the main branch'
@echo ' release - Bump versions, commit and push changes to the repository and release gems and packages. Requires clean repository and VERSION set.'
@echo ' deploy_login - Login to Heroku to be able to deploy the application.'
@echo ' deploy_staging_app - Deploy the bulletin board staging application. Requires heroku login and must be run in the main branch.'
@echo ' deploy_development_app - Deploy an application to the staging pipeline in the development stage. Requires heroku login.'
bump_versions: bump_client \
bump_dummy \
bump_electionguard \
bump_server
update_changelog:
sed -i.bak -E "s/## Unreleased/## Unreleased\n\n## [${VERSION}] - `date +'%Y-%m-%d'`/g" CHANGELOG.md
commit_and_push:
git commit -am "Bump to version ${VERSION}"
git push
git tag v${VERSION}
git push --tags
check_clean_repo:
git diff --quiet
check_version:
@[ "${VERSION}" ] || ( echo ">> VERSION is not set"; exit 1 )
check_release_flag:
@[ "${RELEASE}" ] || ( echo ">> RELEASE is not set"; exit 1 )
check_main_branch:
@[ "${shell git rev-parse --abbrev-ref HEAD}" = "main" ] || ( echo ">> current branch is not main"; exit 1 )