Merge ~xavpaice/charm-mongodb:add_charmcraft into charm-mongodb:master

Proposed by Xav Paice
Status: Merged
Approved by: James Troup
Approved revision: 43b2cba45dc6843eed73ebf36b4f727d4cd88f14
Merged at revision: 3f996a908d92d652d72003b2197b946fbd7ab682
Proposed branch: ~xavpaice/charm-mongodb:add_charmcraft
Merge into: charm-mongodb:master
Diff against target: 103 lines (+56/-6)
4 files modified
Makefile (+7/-5)
charmcraft.yaml (+35/-0)
rename.sh (+13/-0)
tests/functional/tests/bundles/overlays/local-charm-overlay.yaml.j2 (+1/-1)
Reviewer Review Type Date Requested Status
🤖 prod-jenkaas-bootstack (community) continuous-integration Approve
BootStack Reviewers Pending
BootStack Reviewers Pending
Review via email: mp+416286@code.launchpad.net

Commit message

Add charmcraft.yaml

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
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :

A CI job is currently in progress. A follow up comment will be added when it completes.

Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :

A CI job is currently in progress. A follow up comment will be added when it completes.

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

Change successfully merged at revision 3f996a908d92d652d72003b2197b946fbd7ab682

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/Makefile b/Makefile
2index ba7618c..b56a980 100644
3--- a/Makefile
4+++ b/Makefile
5@@ -2,7 +2,7 @@ PYTHON := /usr/bin/python3
6
7 PROJECTPATH=$(dir $(realpath $(MAKEFILE_LIST)))
8 ifndef CHARM_BUILD_DIR
9- CHARM_BUILD_DIR=${PROJECTPATH}.build
10+ CHARM_BUILD_DIR=${PROJECTPATH}
11 endif
12 METADATA_FILE="metadata.yaml"
13 CHARM_NAME=$(shell cat ${PROJECTPATH}/${METADATA_FILE} | grep -E '^name:' | awk '{print $$2}')
14@@ -39,14 +39,16 @@ submodules-update:
15 @git submodule update --init --recursive --remote --merge
16
17 build:
18- @echo "Building charm to base directory ${CHARM_BUILD_DIR}/${CHARM_NAME}"
19+ @echo "Building charm to base directory ${CHARM_BUILD_DIR}/${CHARM_NAME}.charm"
20 @-git rev-parse --abbrev-ref HEAD > ./repo-info
21 @-git describe --always > ./version
22- @mkdir -p ${CHARM_BUILD_DIR}/${CHARM_NAME}
23- @cp -a ./* ${CHARM_BUILD_DIR}/${CHARM_NAME}
24+ @charmcraft clean
25+ @charmcraft -v pack
26+ @bash -c ./rename.sh
27
28 release: clean build
29- @echo "Charm is built at ${CHARM_BUILD_DIR}/${CHARM_NAME}"
30+ @echo "Charm is built at ${CHARM_BUILD_DIR}/${CHARM_NAME}.charm"
31+ @charmcraft upload ${CHARM_BUILD_DIR}/${CHARM_NAME}.charm --release edge
32
33 lint:
34 @echo "Running lint checks"
35diff --git a/charmcraft.yaml b/charmcraft.yaml
36new file mode 100644
37index 0000000..191db30
38--- /dev/null
39+++ b/charmcraft.yaml
40@@ -0,0 +1,35 @@
41+type: charm
42+
43+parts:
44+ charm:
45+ plugin: dump
46+ source: .
47+ prime:
48+ - actions/*
49+ - files/*
50+ - hooks/*
51+ - charmhelpers/*
52+ - templates/*
53+ - actions.yaml
54+ - config.yaml
55+ - copyright
56+ - metadata.yaml
57+ - README.md
58+ - repo-info
59+ - version
60+ - icon.svg
61+ - mod/*
62+bases:
63+ - build-on:
64+ - name: ubuntu
65+ channel: "20.04"
66+ architectures: ["amd64"]
67+ run-on:
68+ - name: ubuntu
69+ channel: "20.04"
70+ architectures:
71+ - amd64
72+ - name: ubuntu
73+ channel: "18.04"
74+ architectures:
75+ - amd64
76diff --git a/rename.sh b/rename.sh
77new file mode 100755
78index 0000000..956a76b
79--- /dev/null
80+++ b/rename.sh
81@@ -0,0 +1,13 @@
82+#!/bin/bash
83+charm=$(grep -E "^name:" metadata.yaml | awk '{print $2}')
84+echo "renaming ${charm}_*.charm to ${charm}.charm"
85+echo -n "pwd: "
86+pwd
87+ls -al
88+echo "Removing previous charm if it exists"
89+if [[ -e "${charm}.charm" ]];
90+then
91+ rm "${charm}.charm"
92+fi
93+echo "Renaming charm here."
94+mv ${charm}_*.charm ${charm}.charm
95diff --git a/tests/functional/tests/bundles/overlays/local-charm-overlay.yaml.j2 b/tests/functional/tests/bundles/overlays/local-charm-overlay.yaml.j2
96index e78574f..d19c84a 100644
97--- a/tests/functional/tests/bundles/overlays/local-charm-overlay.yaml.j2
98+++ b/tests/functional/tests/bundles/overlays/local-charm-overlay.yaml.j2
99@@ -1,3 +1,3 @@
100 applications:
101 {{ charm_name }}:
102- charm: "{{ CHARM_BUILD_DIR }}/{{ charm_name }}"
103+ charm: "{{ CHARM_BUILD_DIR }}/{{ charm_name }}.charm"

Subscribers

People subscribed via source and target branches

to all changes: