Update to classic charms to build using charmcraft in CI

This update is to ensure that the Zuul Canonical CI builds the charm
before functional tests and ensure that that artifact is used for the
functional tests.  This is to try to ensure that the charm that gets
landed to the charmhub is the same charm that was tested with.

Change-Id: I546438f1af6b3f779aa01e9ddd8c8ae7c3b7d063
This commit is contained in:
Alex Kavanagh 2022-02-15 15:13:49 +00:00 committed by Corey Bryant
parent 3c5f539b15
commit a7e6225b2b
9 changed files with 100 additions and 65 deletions

1
.gitignore vendored
View File

@ -4,6 +4,7 @@ bin
.testrepository
.tox
*.sw[nop]
*.charm
.idea
*.pyc
func-results.json

7
build-requirements.txt Normal file
View File

@ -0,0 +1,7 @@
# NOTES(lourot):
# * We don't install charmcraft via pip anymore because it anyway spins up a
# container and scp the system's charmcraft snap inside it. So the charmcraft
# snap is necessary on the system anyway.
# * `tox -e build` successfully validated with charmcraft 1.2.1
cffi==1.14.6; python_version < '3.6' # cffi 1.15.0 drops support for py35.

View File

@ -4,3 +4,7 @@
- charm-unit-jobs-py39
- charm-xena-functional-jobs
- charm-yoga-functional-jobs
vars:
needs_charm_build: true
charm_build_name: ceph-mon
build_type: charmcraft

13
rename.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
charm=$(grep "charm_build_name" osci.yaml | awk '{print $2}')
echo "renaming ${charm}_*.charm to ${charm}.charm"
echo -n "pwd: "
pwd
ls -al
echo "Removing bad downloaded charm maybe?"
if [[ -e "${charm}.charm" ]];
then
rm "${charm}.charm"
fi
echo "Renaming charm here."
mv ${charm}_*.charm ${charm}.charm

View File

@ -32,19 +32,19 @@ applications:
keystone-mysql-router:
charm: ch:mysql-router
channel: latest/edge
channel: stable/yoga
glance-mysql-router:
charm: ch:mysql-router
channel: latest/edge
channel: stable/yoga
cinder-mysql-router:
charm: ch:mysql-router
channel: latest/edge
channel: stable/yoga
nova-cloud-controller-mysql-router:
charm: ch:mysql-router
channel: latest/edge
channel: stable/yoga
placement-mysql-router:
charm: ch:mysql-router
channel: latest/edge
channel: stable/yoga
mysql-innodb-cluster:
charm: ch:mysql-innodb-cluster
@ -55,7 +55,7 @@ applications:
- '0'
- '1'
- '2'
channel: latest/edge
channel: stable/yoga
ceph-osd:
charm: ch:ceph-osd
@ -69,10 +69,10 @@ applications:
- '3'
- '4'
- '5'
channel: latest/edge
channel: stable/yoga
ceph-mon:
charm: ../../../ceph-mon
charm: ../../ceph-mon.charm
num_units: 3
options:
source: *openstack-origin
@ -89,7 +89,7 @@ applications:
source: *openstack-origin
to:
- '9'
channel: latest/edge
channel: stable/yoga
keystone:
expose: True
@ -99,7 +99,7 @@ applications:
openstack-origin: *openstack-origin
to:
- '10'
channel: latest/edge
channel: stable/yoga
nova-compute:
charm: ch:nova-compute
@ -109,7 +109,7 @@ applications:
libvirt-image-backend: rbd
to:
- '11'
channel: latest/edge
channel: stable/yoga
glance:
expose: True
@ -119,7 +119,7 @@ applications:
openstack-origin: *openstack-origin
to:
- '12'
channel: latest/edge
channel: stable/yoga
cinder:
expose: True
@ -131,11 +131,11 @@ applications:
openstack-origin: *openstack-origin
to:
- '13'
channel: latest/edge
channel: stable/yoga
cinder-ceph:
charm: ch:cinder-ceph
channel: latest/edge
channel: stable/yoga
nova-cloud-controller:
expose: True
@ -145,7 +145,7 @@ applications:
openstack-origin: *openstack-origin
to:
- '14'
channel: latest/edge
channel: stable/yoga
placement:
charm: ch:placement
@ -154,7 +154,7 @@ applications:
openstack-origin: *openstack-origin
to:
- '15'
channel: latest/edge
channel: stable/yoga
prometheus2:
# Pin prometheus2 charm version Bug #1891942

View File

@ -32,19 +32,19 @@ applications:
keystone-mysql-router:
charm: ch:mysql-router
channel: latest/edge
channel: stable/yoga
glance-mysql-router:
charm: ch:mysql-router
channel: latest/edge
channel: stable/yoga
cinder-mysql-router:
charm: ch:mysql-router
channel: latest/edge
channel: stable/yoga
nova-cloud-controller-mysql-router:
charm: ch:mysql-router
channel: latest/edge
channel: stable/yoga
placement-mysql-router:
charm: ch:mysql-router
channel: latest/edge
channel: stable/yoga
mysql-innodb-cluster:
charm: ch:mysql-innodb-cluster
@ -55,7 +55,7 @@ applications:
- '0'
- '1'
- '2'
channel: latest/edge
channel: stable/yoga
ceph-osd:
charm: ch:ceph-osd
@ -69,10 +69,10 @@ applications:
- '3'
- '4'
- '5'
channel: latest/edge
channel: stable/yoga
ceph-mon:
charm: ../../../ceph-mon
charm: ../../ceph-mon.charm
num_units: 3
options:
source: *openstack-origin
@ -89,7 +89,7 @@ applications:
source: *openstack-origin
to:
- '9'
channel: latest/edge
channel: stable/yoga
keystone:
expose: True
@ -99,7 +99,7 @@ applications:
openstack-origin: *openstack-origin
to:
- '10'
channel: latest/edge
channel: stable/yoga
nova-compute:
charm: ch:nova-compute
@ -109,7 +109,7 @@ applications:
libvirt-image-backend: rbd
to:
- '11'
channel: latest/edge
channel: stable/yoga
glance:
expose: True
@ -119,7 +119,7 @@ applications:
openstack-origin: *openstack-origin
to:
- '12'
channel: latest/edge
channel: stable/yoga
cinder:
expose: True
@ -131,11 +131,11 @@ applications:
openstack-origin: *openstack-origin
to:
- '13'
channel: latest/edge
channel: stable/yoga
cinder-ceph:
charm: ch:cinder-ceph
channel: latest/edge
channel: stable/yoga
nova-cloud-controller:
expose: True
@ -145,7 +145,7 @@ applications:
openstack-origin: *openstack-origin
to:
- '14'
channel: latest/edge
channel: stable/yoga
placement:
charm: ch:placement
@ -154,7 +154,7 @@ applications:
openstack-origin: *openstack-origin
to:
- '15'
channel: latest/edge
channel: stable/yoga
prometheus2:
# Pin prometheus2 charm version Bug #1891942

View File

@ -33,19 +33,19 @@ applications:
keystone-mysql-router:
charm: ch:mysql-router
channel: latest/edge
channel: stable/yoga
glance-mysql-router:
charm: ch:mysql-router
channel: latest/edge
channel: stable/yoga
cinder-mysql-router:
charm: ch:mysql-router
channel: latest/edge
channel: stable/yoga
nova-cloud-controller-mysql-router:
charm: ch:mysql-router
channel: latest/edge
channel: stable/yoga
placement-mysql-router:
charm: ch:mysql-router
channel: latest/edge
channel: stable/yoga
mysql-innodb-cluster:
charm: ch:mysql-innodb-cluster
@ -56,7 +56,7 @@ applications:
- '0'
- '1'
- '2'
channel: latest/edge
channel: stable/yoga
ceph-osd:
charm: ch:ceph-osd
@ -70,10 +70,10 @@ applications:
- '3'
- '4'
- '5'
channel: latest/edge
channel: stable/yoga
ceph-mon:
charm: ../../../ceph-mon
charm: ../../ceph-mon.charm
num_units: 3
options:
source: *openstack-origin
@ -90,7 +90,7 @@ applications:
source: *openstack-origin
to:
- '9'
channel: latest/edge
channel: stable/yoga
keystone:
expose: True
@ -100,7 +100,7 @@ applications:
openstack-origin: *openstack-origin
to:
- '10'
channel: latest/edge
channel: stable/yoga
nova-compute:
charm: ch:nova-compute
@ -110,7 +110,7 @@ applications:
libvirt-image-backend: rbd
to:
- '11'
channel: latest/edge
channel: stable/yoga
glance:
expose: True
@ -120,7 +120,7 @@ applications:
openstack-origin: *openstack-origin
to:
- '12'
channel: latest/edge
channel: stable/yoga
cinder:
expose: True
@ -132,11 +132,11 @@ applications:
openstack-origin: *openstack-origin
to:
- '13'
channel: latest/edge
channel: stable/yoga
cinder-ceph:
charm: ch:cinder-ceph
channel: latest/edge
channel: stable/yoga
nova-cloud-controller:
expose: True
@ -146,7 +146,7 @@ applications:
openstack-origin: *openstack-origin
to:
- '14'
channel: latest/edge
channel: stable/yoga
placement:
charm: ch:placement
@ -155,7 +155,7 @@ applications:
openstack-origin: *openstack-origin
to:
- '15'
channel: latest/edge
channel: stable/yoga
prometheus2:
# Pin prometheus2 charm version Bug #1891942

View File

@ -33,19 +33,19 @@ applications:
keystone-mysql-router:
charm: ch:mysql-router
channel: latest/edge
channel: stable/yoga
glance-mysql-router:
charm: ch:mysql-router
channel: latest/edge
channel: stable/yoga
cinder-mysql-router:
charm: ch:mysql-router
channel: latest/edge
channel: stable/yoga
nova-cloud-controller-mysql-router:
charm: ch:mysql-router
channel: latest/edge
channel: stable/yoga
placement-mysql-router:
charm: ch:mysql-router
channel: latest/edge
channel: stable/yoga
mysql-innodb-cluster:
charm: ch:mysql-innodb-cluster
@ -56,7 +56,7 @@ applications:
- '0'
- '1'
- '2'
channel: latest/edge
channel: stable/yoga
ceph-osd:
charm: ch:ceph-osd
@ -70,10 +70,10 @@ applications:
- '3'
- '4'
- '5'
channel: latest/edge
channel: stable/yoga
ceph-mon:
charm: ../../../ceph-mon
charm: ../../ceph-mon.charm
num_units: 3
options:
source: *openstack-origin
@ -90,7 +90,7 @@ applications:
source: *openstack-origin
to:
- '9'
channel: latest/edge
channel: stable/yoga
keystone:
expose: True
@ -100,7 +100,7 @@ applications:
openstack-origin: *openstack-origin
to:
- '10'
channel: latest/edge
channel: stable/yoga
nova-compute:
charm: ch:nova-compute
@ -110,7 +110,7 @@ applications:
libvirt-image-backend: rbd
to:
- '11'
channel: latest/edge
channel: stable/yoga
glance:
expose: True
@ -120,7 +120,7 @@ applications:
openstack-origin: *openstack-origin
to:
- '12'
channel: latest/edge
channel: stable/yoga
cinder:
expose: True
@ -132,11 +132,11 @@ applications:
openstack-origin: *openstack-origin
to:
- '13'
channel: latest/edge
channel: stable/yoga
cinder-ceph:
charm: ch:cinder-ceph
channel: latest/edge
channel: stable/yoga
nova-cloud-controller:
expose: True
@ -146,7 +146,7 @@ applications:
openstack-origin: *openstack-origin
to:
- '14'
channel: latest/edge
channel: stable/yoga
placement:
charm: ch:placement
@ -155,7 +155,7 @@ applications:
openstack-origin: *openstack-origin
to:
- '15'
channel: latest/edge
channel: stable/yoga
prometheus2:
# Pin prometheus2 charm version Bug #1891942

12
tox.ini
View File

@ -37,10 +37,20 @@ setenv = VIRTUAL_ENV={envdir}
install_command =
{toxinidir}/pip.sh install {opts} {packages}
commands = stestr run --slowest {posargs}
allowlist_externals = juju
allowlist_externals =
charmcraft
rename.sh
passenv = HOME TERM CS_* OS_* TEST_*
deps = -r{toxinidir}/test-requirements.txt
[testenv:build]
basepython = python3
deps = -r{toxinidir}/build-requirements.txt
commands =
charmcraft clean
charmcraft -v build
{toxinidir}/rename.sh
[testenv:py35]
basepython = python3.5
deps = -r{toxinidir}/requirements.txt