Merge ~xavpaice/charm-graylog:update_charmcraft into charm-graylog:master

Proposed by Xav Paice
Status: Merged
Approved by: James Troup
Approved revision: 17a8ff3d68774d46d48fdd2cc7a7421f94771715
Merged at revision: 2759b5cbc2f2141f496d0a403aab549fd9b2226a
Proposed branch: ~xavpaice/charm-graylog:update_charmcraft
Merge into: charm-graylog:master
Diff against target: 146 lines (+42/-15)
7 files modified
.gitignore (+2/-1)
Makefile (+12/-5)
charmcraft.yaml (+13/-6)
rename.sh (+13/-0)
src/metadata.yaml (+0/-1)
src/tests/functional/tests/bundles/overlays/local-charm-overlay.yaml.j2 (+1/-1)
src/tox.ini (+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+416427@code.launchpad.net

Commit message

add bionic and xenial to charmcraft

To post a comment you must log in.
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
🤖 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 :
review: Needs Fixing (continuous-integration)
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 :
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: 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: 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: Needs Fixing (continuous-integration)
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: 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 2759b5cbc2f2141f496d0a403aab549fd9b2226a

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/.gitignore b/.gitignore
2index 6f1f367..7917e99 100644
3--- a/.gitignore
4+++ b/.gitignore
5@@ -38,4 +38,5 @@ dist/
6 *.snap
7
8 # Builds
9-.build/
10\ No newline at end of file
11+.build/
12+*.charm
13diff --git a/Makefile b/Makefile
14index 25acb3d..eb7767a 100644
15--- a/Makefile
16+++ b/Makefile
17@@ -10,6 +10,9 @@ endif
18 ifndef CHARM_INTERFACES_DIR
19 CHARM_INTERFACES_DIR=${PROJECTPATH}/interfaces
20 endif
21+ifdef CONTAINER
22+ BUILD_ARGS="--destructive-mode"
23+endif
24 METADATA_FILE="src/metadata.yaml"
25 CHARM_NAME=$(shell cat ${PROJECTPATH}/${METADATA_FILE} | grep -E "^name:" | awk '{print $$2}')
26
27@@ -36,6 +39,8 @@ clean:
28 @git clean -ffXd -e '!.idea'
29 @echo "Cleaning existing build"
30 @rm -rf ${CHARM_BUILD_DIR}/${CHARM_NAME}
31+ @rm -rf ${PROJECTPATH}/${CHARM_NAME}.charm
32+ @charmcraft clean
33
34 submodules:
35 # @echo "Cloning submodules"
36@@ -47,11 +52,13 @@ submodules-update:
37 # @git submodule update --init --recursive --remote --merge
38 @echo "No submodules. Skipping."
39
40-build:
41+build: clean
42 @echo "Building charm to directory ${CHARM_BUILD_DIR}/${CHARM_NAME}"
43 @-git rev-parse --abbrev-ref HEAD > ./src/repo-info
44- @CHARM_LAYERS_DIR=${CHARM_LAYERS_DIR} CHARM_INTERFACES_DIR=${CHARM_INTERFACES_DIR} \
45- TERM=linux CHARM_BUILD_DIR=${CHARM_BUILD_DIR} charm build src/
46+ @charmcraft -v pack ${BUILD_ARGS}
47+ @bash -c ./rename.sh
48+ @mkdir -p ${CHARM_BUILD_DIR}/${CHARM_NAME}
49+ @unzip ${PROJECTPATH}/${CHARM_NAME}.charm -d ${CHARM_BUILD_DIR}/${CHARM_NAME}
50
51 release: clean build
52 @echo "Charm is built at ${CHARM_BUILD_DIR}/${CHARM_NAME}"
53@@ -74,11 +81,11 @@ unittests:
54
55 functional: build
56 @echo "Executing functional tests in ${CHARM_BUILD_DIR}"
57- @cd src && CHARM_BUILD_DIR=${CHARM_BUILD_DIR} tox -e func
58+ @cd src && CHARM_BUILD_DIR=${CHARM_BUILD_DIR} CHARM_LOCATION=${PROJECTPATH} tox -e func
59
60 functional-extra: build
61 @echo "Executing functional tests in ${CHARM_BUILD_DIR}"
62- @cd src && CHARM_BUILD_DIR=${CHARM_BUILD_DIR} tox -e func-extra
63+ @cd src && CHARM_BUILD_DIR=${CHARM_BUILD_DIR} CHARM_LOCATION=${PROJECTPATH} tox -e func-extra
64
65 test: lint proof unittests functional
66 @echo "Tests completed for charm ${CHARM_NAME}."
67diff --git a/charmcraft.yaml b/charmcraft.yaml
68index f0ffdaa..7d9c002 100644
69--- a/charmcraft.yaml
70+++ b/charmcraft.yaml
71@@ -5,9 +5,16 @@ parts:
72 plugin: reactive
73 build-snaps: [charm]
74 bases:
75- - name: ubuntu
76- channel: "20.04"
77- architectures: ["amd64"]
78- - name: ubuntu
79- channel: "18.04"
80- architectures: ["amd64"]
81+ - build-on:
82+ - name: ubuntu
83+ channel: "20.04"
84+ architectures: ["amd64"]
85+ run-on:
86+ - name: ubuntu
87+ channel: "20.04"
88+ architectures:
89+ - amd64
90+ - name: ubuntu
91+ channel: "18.04"
92+ architectures:
93+ - amd64
94diff --git a/rename.sh b/rename.sh
95new file mode 100755
96index 0000000..bc8697f
97--- /dev/null
98+++ b/rename.sh
99@@ -0,0 +1,13 @@
100+#!/bin/bash
101+charm=$(grep -E "^name:" src/metadata.yaml | awk '{print $2}')
102+echo "renaming ${charm}_*.charm to ${charm}.charm"
103+echo -n "pwd: "
104+pwd
105+ls -al
106+echo "Removing previous charm if it exists"
107+if [[ -e "${charm}.charm" ]];
108+then
109+ rm "${charm}.charm"
110+fi
111+echo "Renaming charm here."
112+mv ${charm}_*.charm ${charm}.charm
113diff --git a/src/metadata.yaml b/src/metadata.yaml
114index 53f9751..c7dd0fe 100644
115--- a/src/metadata.yaml
116+++ b/src/metadata.yaml
117@@ -5,7 +5,6 @@ description: >
118 Installs the Graylog log management system. Connections to elasticsearch and
119 mongodb are required for a fully functioning system. https://www.graylog.org/
120 series:
121- - xenial
122 - bionic
123 - focal
124 tags:
125diff --git a/src/tests/functional/tests/bundles/overlays/local-charm-overlay.yaml.j2 b/src/tests/functional/tests/bundles/overlays/local-charm-overlay.yaml.j2
126index e78574f..45065bc 100644
127--- a/src/tests/functional/tests/bundles/overlays/local-charm-overlay.yaml.j2
128+++ b/src/tests/functional/tests/bundles/overlays/local-charm-overlay.yaml.j2
129@@ -1,3 +1,3 @@
130 applications:
131 {{ charm_name }}:
132- charm: "{{ CHARM_BUILD_DIR }}/{{ charm_name }}"
133+ charm: "{{ CHARM_LOCATION }}/{{ charm_name }}.charm"
134diff --git a/src/tox.ini b/src/tox.ini
135index ef4afd6..6c43ed3 100644
136--- a/src/tox.ini
137+++ b/src/tox.ini
138@@ -10,7 +10,7 @@ setenv =
139 passenv =
140 HOME
141 PATH
142- CHARM_BUILD_DIR
143+ CHARM_*
144 PYTEST_KEEP_MODEL
145 PYTEST_CLOUD_NAME
146 PYTEST_CLOUD_REGION

Subscribers

People subscribed via source and target branches

to all changes: