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

Proposed by Xav Paice
Status: Merged
Approved by: James Troup
Approved revision: 0eb3e8cadb8e5beaf356f60c524aae1d1efe8dd4
Merged at revision: 37e32a7cae69ad853dcb4bda163b0034ac30c648
Proposed branch: ~xavpaice/charm-elasticsearch:add_charmcraft
Merge into: charm-elasticsearch:master
Diff against target: 186 lines (+80/-16)
7 files modified
.gitignore (+2/-1)
Makefile (+18/-11)
charmcraft.yaml (+43/-0)
mod/charm-helpers (+1/-1)
rename.sh (+13/-0)
tests/functional/tests/bundles/overlays/local-charm-overlay.yaml.j2 (+1/-1)
tox.ini (+2/-2)
Reviewer Review Type Date Requested Status
🤖 prod-jenkaas-bootstack (community) continuous-integration Approve
James Troup (community) Needs Fixing
BootStack Reviewers Pending
Review via email: mp+416438@code.launchpad.net

Commit message

add charmcraft.yaml

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 :

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
James Troup (elmo) wrote :

CI failure looks directly related to the change

review: Needs Fixing
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 :

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 :

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: Approve (continuous-integration)
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 37e32a7cae69ad853dcb4bda163b0034ac30c648

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..7a9b7a6 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 75a917e..990b728 100644
15--- a/Makefile
16+++ b/Makefile
17@@ -2,7 +2,10 @@ PYTHON := /usr/bin/python3
18
19 PROJECTPATH=$(dir $(realpath $(MAKEFILE_LIST)))
20 ifndef CHARM_BUILD_DIR
21- CHARM_BUILD_DIR=${PROJECTPATH}.build
22+ CHARM_BUILD_DIR=${PROJECTPATH}/build
23+endif
24+ifdef CONTAINER
25+ BUILD_ARGS="--destructive-mode"
26 endif
27 METADATA_FILE="metadata.yaml"
28 CHARM_NAME=$(shell cat ${PROJECTPATH}/${METADATA_FILE} | grep -E '^name:' | awk '{print $$2}')
29@@ -28,7 +31,9 @@ clean:
30 @echo "Cleaning files"
31 @git clean -ffXd -e '!.idea'
32 @echo "Cleaning existing build"
33- @rm -rf ${CHARM_BUILD_DIR}/${CHARM_NAME}
34+ @rm -rf ${CHARM_BUILD_DIR}/${CHARM_NAME}*.charm
35+ @rm -rf ${CHARM_BUILD_DIR}/*
36+ @charmcraft clean
37
38 submodules:
39 @echo "Cloning submodules"
40@@ -38,15 +43,17 @@ submodules-update:
41 @echo "Pulling latest updates for submodules"
42 @git submodule update --init --recursive --remote --merge
43
44-build: submodules-update
45- @echo "Building charm to base directory ${CHARM_BUILD_DIR}/${CHARM_NAME}"
46+build: clean submodules-update
47+ @echo "Building charm to base directory ${CHARM_BUILD_DIR}/${CHARM_NAME}.charm"
48 @-git rev-parse --abbrev-ref HEAD > ./repo-info
49 @-git describe --always > ./version
50+ @charmcraft -v pack ${BUILD_ARGS}
51+ @bash -c ./rename.sh
52 @mkdir -p ${CHARM_BUILD_DIR}/${CHARM_NAME}
53- @cp -a ./* ${CHARM_BUILD_DIR}/${CHARM_NAME}
54+ @unzip ${PROJECTPATH}/${CHARM_NAME}.charm -d ${CHARM_BUILD_DIR}/${CHARM_NAME}
55
56-release: clean build
57- @echo "Charm is built at ${CHARM_BUILD_DIR}/${CHARM_NAME}"
58+release: build
59+ @charmcraft upload ${CHARM_NAME}.charm --release edge
60
61 lint:
62 @echo "Running lint checks"
63@@ -58,15 +65,15 @@ black:
64
65 proof:
66 @echo "Running charm proof"
67- @charm proof
68+ @-charm proof
69
70-unittests:
71+unittests: submodules-update
72 @echo "Running unit tests"
73 @tox -e unit
74
75 functional: build
76- @echo "Executing functional tests in ${CHARM_BUILD_DIR}"
77- @CHARM_BUILD_DIR=${CHARM_BUILD_DIR} tox -e func
78+ @echo "Executing functional tests"
79+ @CHARM_LOCATION=${PROJECTPATH} tox -e func
80
81 test: lint proof unittests functional
82 @echo "Charm ${CHARM_NAME} has been tested"
83diff --git a/charmcraft.yaml b/charmcraft.yaml
84new file mode 100644
85index 0000000..021c2c6
86--- /dev/null
87+++ b/charmcraft.yaml
88@@ -0,0 +1,43 @@
89+type: charm
90+
91+parts:
92+ charm:
93+ plugin: dump
94+ source: .
95+ prime:
96+ - actions/*
97+ - bin/*
98+ - ansible_module_backports/*
99+ - files/*
100+ - hooks/*
101+ - hooks/charmhelpers/*
102+ - templates/*
103+ - actions.yaml
104+ - config.yaml
105+ - copyright
106+ - metadata.yaml
107+ - README.md
108+ - icon.svg
109+ - lookup_plugins/*
110+ - mod/*
111+ - roles/*
112+ - tasks/*
113+ - playbook.yaml
114+bases:
115+ - build-on:
116+ - name: ubuntu
117+ channel: "18.04"
118+ architectures: ["amd64"]
119+ run-on:
120+ - name: ubuntu
121+ channel: "20.04"
122+ architectures:
123+ - amd64
124+ - name: ubuntu
125+ channel: "18.04"
126+ architectures:
127+ - amd64
128+ - name: ubuntu
129+ channel: "16.04"
130+ architectures:
131+ - amd64
132diff --git a/mod/charm-helpers b/mod/charm-helpers
133index c192e3e..2e84095 160000
134--- a/mod/charm-helpers
135+++ b/mod/charm-helpers
136@@ -1 +1 @@
137-Subproject commit c192e3e354484173516170a46ef18b83f889d7db
138+Subproject commit 2e84095f1d0a4e8784e3355c08d86af644a6c81d
139diff --git a/rename.sh b/rename.sh
140new file mode 100755
141index 0000000..956a76b
142--- /dev/null
143+++ b/rename.sh
144@@ -0,0 +1,13 @@
145+#!/bin/bash
146+charm=$(grep -E "^name:" metadata.yaml | awk '{print $2}')
147+echo "renaming ${charm}_*.charm to ${charm}.charm"
148+echo -n "pwd: "
149+pwd
150+ls -al
151+echo "Removing previous charm if it exists"
152+if [[ -e "${charm}.charm" ]];
153+then
154+ rm "${charm}.charm"
155+fi
156+echo "Renaming charm here."
157+mv ${charm}_*.charm ${charm}.charm
158diff --git a/tests/functional/tests/bundles/overlays/local-charm-overlay.yaml.j2 b/tests/functional/tests/bundles/overlays/local-charm-overlay.yaml.j2
159index e78574f..45065bc 100644
160--- a/tests/functional/tests/bundles/overlays/local-charm-overlay.yaml.j2
161+++ b/tests/functional/tests/bundles/overlays/local-charm-overlay.yaml.j2
162@@ -1,3 +1,3 @@
163 applications:
164 {{ charm_name }}:
165- charm: "{{ CHARM_BUILD_DIR }}/{{ charm_name }}"
166+ charm: "{{ CHARM_LOCATION }}/{{ charm_name }}.charm"
167diff --git a/tox.ini b/tox.ini
168index 2ec3d2e..ff83dfe 100644
169--- a/tox.ini
170+++ b/tox.ini
171@@ -10,7 +10,7 @@ setenv =
172 passenv =
173 HOME
174 PATH
175- CHARM_BUILD_DIR
176+ CHARM_*
177 PYTEST_KEEP_MODEL
178 PYTEST_CLOUD_NAME
179 PYTEST_CLOUD_REGION
180@@ -73,5 +73,5 @@ deps = -r{toxinidir}/tests/unit/requirements.txt
181
182 [testenv:func]
183 changedir = {toxinidir}/tests/functional
184-commands = functest-run-suite {posargs}
185+commands = functest-run-suite --keep-faulty-model {posargs}
186 deps = -r{toxinidir}/tests/functional/requirements.txt

Subscribers

People subscribed via source and target branches

to all changes: