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

Proposed by Haw Loeung
Status: Merged
Approved by: Haw Loeung
Approved revision: 1d99c095b199fc42fe43766328428ca820b3fe68
Merged at revision: 4136b31910090d592572ece49c6dd9abf31d0dde
Proposed branch: ~hloeung/mailman3-core-charm:master
Merge into: mailman3-core-charm:master
Diff against target: 80 lines (+40/-19)
3 files modified
.gitignore (+15/-0)
Makefile (+4/-19)
charmcraft.yaml (+21/-0)
Reviewer Review Type Date Requested Status
James Simpson Approve
Canonical IS Reviewers Pending
Review via email: mp+416997@code.launchpad.net

Commit message

Add support for building charm with charmcraft pack

To post a comment you must log in.
Revision history for this message
James Simpson (jsimpso) wrote :

LGTM

review: Approve
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
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 4136b31910090d592572ece49c6dd9abf31d0dde

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/.gitignore b/.gitignore
2new file mode 100644
3index 0000000..3b821e7
4--- /dev/null
5+++ b/.gitignore
6@@ -0,0 +1,15 @@
7+*.charm
8+*.pyc
9+*.swp
10+*~
11+.coverage
12+.pytest_cache/
13+.tox/
14+.unit-state.db
15+__pycache__/
16+build/
17+builds/
18+deps/
19+htmlcov/
20+repo-info
21+revision
22diff --git a/Makefile b/Makefile
23index 915cac6..095bae3 100644
24--- a/Makefile
25+++ b/Makefile
26@@ -12,23 +12,8 @@ test: lint
27 nosetests3 unit_tests/*
28 @echo "\nAmulet based tests in ./tests should be run with bundletester against the built charm"
29
30-CHARM_REPO = lp:mailman3-core-charm
31-CHARM_NAME = mailman3-core
32-CHARM_DEST ?= ~/tmp/$(CHARM_NAME)
33-CHARM_BUILD ?= ~/tmp
34+clean:
35+ @echo "Cleaning files"
36+ @git clean -ffXd
37
38-charm-build:
39- $(eval TMP_CHARM_BUILD_DIR = $(shell mktemp -d -p $(CHARM_BUILD) charm-build.$(CHARM_NAME).XXXXXXXX))
40- @if [ -z $(CHARM_NAME) ]; then \
41- echo "Unable to work out charm name from metadata.yaml"; \
42- exit 1; \
43- fi
44- charm build -o $(TMP_CHARM_BUILD_DIR)
45- @if [ -d $(CHARM_DEST)/ ]; then \
46- git -C $(CHARM_DEST)/ pull; \
47- else \
48- git clone -- $(CHARM_REPO) $(CHARM_DEST)/; \
49- fi
50- rsync -a --exclude .git --delete -- $(TMP_CHARM_BUILD_DIR)/builds/$(CHARM_NAME)/ $(CHARM_DEST)/
51- @echo "Built charm in $(CHARM_DEST)"
52- rm -rf -- $(TMP_CHARM_BUILD_DIR)
53+.PHONY: clean lint test
54diff --git a/charmcraft.yaml b/charmcraft.yaml
55new file mode 100644
56index 0000000..1da5d37
57--- /dev/null
58+++ b/charmcraft.yaml
59@@ -0,0 +1,21 @@
60+type: "charm"
61+bases:
62+ - build-on:
63+ - name: "ubuntu"
64+ channel: "18.04"
65+ - name: "ubuntu"
66+ channel: "20.04"
67+ - name: "ubuntu"
68+ channel: "21.10"
69+ run-on:
70+ - name: "ubuntu"
71+ channel: "18.04"
72+ - name: "ubuntu"
73+ channel: "20.04"
74+ - name: "ubuntu"
75+ channel: "21.10"
76+parts:
77+ charm:
78+ source: .
79+ plugin: reactive
80+ build-snaps: [charm]

Subscribers

People subscribed via source and target branches