Merge ~ballot/content-cache-charm/+git/content-cache-charm:update_makefile into content-cache-charm:master

Proposed by Benjamin Allot
Status: Merged
Approved by: Benjamin Allot
Approved revision: 5710e7226f3e08ad88a17eeca96f105ef646b1a4
Merged at revision: 230c2e3fa814dc25a6ff5a61ec93c7f43bb4d1a6
Proposed branch: ~ballot/content-cache-charm/+git/content-cache-charm:update_makefile
Merge into: content-cache-charm:master
Diff against target: 43 lines (+23/-5)
1 file modified
Makefile (+23/-5)
Reviewer Review Type Date Requested Status
Joel Sing (community) +1 Approve
Nick Moffitt (community) Approve
Canonical IS Reviewers Pending
Review via email: mp+372044@code.launchpad.net

Commit message

Update "make build" target

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
Benjamin Allot (ballot) wrote :

This allow a cleaner charm build, inspired by ngfw target

Revision history for this message
Nick Moffitt (nick-moffitt) wrote :

seems legit

review: Approve
Revision history for this message
Joel Sing (jsing) wrote :

LGTM

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

Change successfully merged at revision 230c2e3fa814dc25a6ff5a61ec93c7f43bb4d1a6

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/Makefile b/Makefile
index 170a4bf..8190269 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,11 @@
1CHARM_REPO = git+ssh://git.launchpad.net/content-cache-charm
2CHARM_NAME = $(shell awk '/^name:/ { print $$2 }' metadata.yaml)
3CHARM_BUILD_DIR ?= ~/tmp
4CHARM_DEST_DIR ?= $(CHARM_BUILD_DIR)/$(CHARM_NAME)
5
6$(CHARM_BUILD_DIR):
7 mkdir -p $@
8
1help:9help:
2 @echo "This project supports the following targets"10 @echo "This project supports the following targets"
3 @echo ""11 @echo ""
@@ -24,11 +32,21 @@ unittest:
24functional: build32functional: build
25 @tox -e functional33 @tox -e functional
2634
27build: clean35build: clean | $(CHARM_BUILD_DIR)
28 @echo "Building charm to base directory $(JUJU_REPOSITORY)"36 $(eval TMP_CHARM_BUILD_DIR = $(shell mktemp -d -p $(CHARM_BUILD_DIR) charm-build.$(CHARM_NAME).XXXXXXXX))
29 @-git describe --always --dirty --tags > ./repo-info37 @if [ -z $(CHARM_NAME) ]; then \
30 @LAYER_PATH=./layers INTERFACE_PATH=./interfaces TERM=linux \38 echo "Unable to work out charm name from metadata.yaml"; \
31 JUJU_REPOSITORY=$(JUJU_REPOSITORY) charm build . --force39 exit 1; \
40 fi
41 charm build -o $(TMP_CHARM_BUILD_DIR)
42 if [ -d $(CHARM_DEST_DIR)/ ]; then \
43 git -C $(CHARM_DEST_DIR)/ pull; \
44 else \
45 git clone -- $(CHARM_REPO) $(CHARM_DEST_DIR)/; \
46 fi
47 rsync -a --exclude .git --delete -- $(TMP_CHARM_BUILD_DIR)/builds/$(CHARM_NAME)/ $(CHARM_DEST_DIR)/
48 @echo "Built charm in $(CHARM_DEST_DIR)"
49 rm -rf -- $(TMP_CHARM_BUILD_DIR)
3250
33clean:51clean:
34 @echo "Cleaning files"52 @echo "Cleaning files"

Subscribers

People subscribed via source and target branches