Merge ~hloeung/mailman3-core-charm:master into mailman3-core-charm:master

Proposed by Haw Loeung
Status: Merged
Approved by: Alexandre Gomes
Approved revision: f93f2378ffc85c0baf4ec0a860090a606ac348a7
Merged at revision: 2d932c3e929cabcf422300cb4925c0e7ac066a52
Proposed branch: ~hloeung/mailman3-core-charm:master
Merge into: mailman3-core-charm:master
Diff against target: 40 lines (+34/-0)
1 file modified
Makefile (+34/-0)
Reviewer Review Type Date Requested Status
Alexandre Gomes Approve
Review via email: mp+345567@code.launchpad.net

Commit message

Add Makefile with common targets such as lint, test, and charm-build

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Alexandre Gomes (alejdg) wrote :

+1

review: Approve
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 2d932c3e929cabcf422300cb4925c0e7ac066a52

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/Makefile b/Makefile
2new file mode 100644
3index 0000000..915cac6
4--- /dev/null
5+++ b/Makefile
6@@ -0,0 +1,34 @@
7+python_scripts = \
8+ ./reactive/*.py \
9+
10+all:
11+
12+lint:
13+ @echo "Checking Python syntax..."
14+ @flake8 --max-complexity=10 --filename=\* --ignore=E501,E402 $(python_scripts) && echo OK
15+
16+test: lint
17+ @echo "\nRunning unit tests\n"
18+ nosetests3 unit_tests/*
19+ @echo "\nAmulet based tests in ./tests should be run with bundletester against the built charm"
20+
21+CHARM_REPO = lp:mailman3-core-charm
22+CHARM_NAME = mailman3-core
23+CHARM_DEST ?= ~/tmp/$(CHARM_NAME)
24+CHARM_BUILD ?= ~/tmp
25+
26+charm-build:
27+ $(eval TMP_CHARM_BUILD_DIR = $(shell mktemp -d -p $(CHARM_BUILD) charm-build.$(CHARM_NAME).XXXXXXXX))
28+ @if [ -z $(CHARM_NAME) ]; then \
29+ echo "Unable to work out charm name from metadata.yaml"; \
30+ exit 1; \
31+ fi
32+ charm build -o $(TMP_CHARM_BUILD_DIR)
33+ @if [ -d $(CHARM_DEST)/ ]; then \
34+ git -C $(CHARM_DEST)/ pull; \
35+ else \
36+ git clone -- $(CHARM_REPO) $(CHARM_DEST)/; \
37+ fi
38+ rsync -a --exclude .git --delete -- $(TMP_CHARM_BUILD_DIR)/builds/$(CHARM_NAME)/ $(CHARM_DEST)/
39+ @echo "Built charm in $(CHARM_DEST)"
40+ rm -rf -- $(TMP_CHARM_BUILD_DIR)

Subscribers

People subscribed via source and target branches