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: I9560c8801640e3629dc21716f2e0e4534f5a330e
This commit is contained in:
Alex Kavanagh 2022-02-15 14:51:44 +00:00 committed by Corey Bryant
parent 074e8085a7
commit 26dd49b79d
10 changed files with 77 additions and 41 deletions

1
.gitignore vendored
View File

@ -3,6 +3,7 @@ bin
.testrepository
.stestr
.tox
*.charm
tags
*.sw[nop]
*.pyc

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

@ -6,6 +6,7 @@ parts:
source: .
prime:
- actions/*
- charmhelpers/*
- files/*
- hooks/*
- lib/*

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: ceilometer
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

@ -87,7 +87,7 @@ applications:
- '5'
- '6'
- '7'
channel: latest/edge
channel: quincy/edge
ceph-mon:
charm: ch:ceph-mon
@ -98,7 +98,7 @@ applications:
- '8'
- '9'
- '10'
channel: latest/edge
channel: quincy/edge
keystone:
charm: ch:keystone
@ -107,7 +107,7 @@ applications:
openstack-origin: *openstack-origin
to:
- '11'
channel: latest/edge
channel: yoga/edge
glance:
charm: ch:glance
@ -116,7 +116,7 @@ applications:
openstack-origin: *openstack-origin
to:
- '12'
channel: latest/edge
channel: yoga/edge
nova-cloud-controller:
charm: ch:nova-cloud-controller
@ -125,7 +125,7 @@ applications:
openstack-origin: *openstack-origin
to:
- '13'
channel: latest/edge
channel: yoga/edge
placement:
charm: ch:placement
@ -134,7 +134,7 @@ applications:
openstack-origin: *openstack-origin
to:
- '14'
channel: latest/edge
channel: yoga/edge
nova-compute:
charm: ch:nova-compute
@ -143,10 +143,10 @@ applications:
openstack-origin: *openstack-origin
to:
- '15'
channel: latest/edge
channel: yoga/edge
ceilometer:
charm: ../../
charm: ../../ceilometer.charm
num_units: 1
options:
openstack-origin: *openstack-origin
@ -160,10 +160,10 @@ applications:
openstack-origin: *openstack-origin
to:
- '17'
channel: latest/edge
channel: yoga/edge
ceilometer-agent:
charm: cs:~openstack-charmers-next/ceilometer-agent
charm: ch:ceilometer-agent
relations:

View File

@ -83,7 +83,7 @@ applications:
- '5'
- '6'
- '7'
channel: latest/edge
channel: quincy/edge
ceph-mon:
charm: ch:ceph-mon
@ -94,7 +94,7 @@ applications:
- '8'
- '9'
- '10'
channel: latest/edge
channel: quincy/edge
keystone:
charm: ch:keystone
@ -103,7 +103,7 @@ applications:
openstack-origin: *openstack-origin
to:
- '11'
channel: latest/edge
channel: yoga/edge
glance:
charm: ch:glance
@ -112,7 +112,7 @@ applications:
openstack-origin: *openstack-origin
to:
- '12'
channel: latest/edge
channel: yoga/edge
nova-cloud-controller:
charm: ch:nova-cloud-controller
@ -121,7 +121,7 @@ applications:
openstack-origin: *openstack-origin
to:
- '13'
channel: latest/edge
channel: yoga/edge
placement:
charm: ch:placement
@ -130,7 +130,7 @@ applications:
openstack-origin: *openstack-origin
to:
- '14'
channel: latest/edge
channel: yoga/edge
nova-compute:
charm: ch:nova-compute
@ -139,10 +139,10 @@ applications:
openstack-origin: *openstack-origin
to:
- '15'
channel: latest/edge
channel: yoga/edge
ceilometer:
charm: ../../
charm: ../../ceilometer.charm
num_units: 1
options:
openstack-origin: *openstack-origin
@ -156,10 +156,10 @@ applications:
openstack-origin: *openstack-origin
to:
- '17'
channel: latest/edge
channel: yoga/edge
ceilometer-agent:
charm: cs:~openstack-charmers-next/ceilometer-agent
charm: ch:ceilometer-agent
relations:

View File

@ -87,7 +87,7 @@ applications:
- '5'
- '6'
- '7'
channel: latest/edge
channel: quincy/edge
ceph-mon:
charm: ch:ceph-mon
@ -98,7 +98,7 @@ applications:
- '8'
- '9'
- '10'
channel: latest/edge
channel: quincy/edge
keystone:
charm: ch:keystone
@ -107,7 +107,7 @@ applications:
openstack-origin: *openstack-origin
to:
- '11'
channel: latest/edge
channel: yoga/edge
glance:
charm: ch:glance
@ -116,7 +116,7 @@ applications:
openstack-origin: *openstack-origin
to:
- '12'
channel: latest/edge
channel: yoga/edge
nova-cloud-controller:
charm: ch:nova-cloud-controller
@ -125,7 +125,7 @@ applications:
openstack-origin: *openstack-origin
to:
- '13'
channel: latest/edge
channel: yoga/edge
placement:
charm: ch:placement
@ -134,7 +134,7 @@ applications:
openstack-origin: *openstack-origin
to:
- '14'
channel: latest/edge
channel: yoga/edge
nova-compute:
charm: ch:nova-compute
@ -143,10 +143,10 @@ applications:
openstack-origin: *openstack-origin
to:
- '15'
channel: latest/edge
channel: yoga/edge
ceilometer:
charm: ../../
charm: ../../ceilometer.charm
num_units: 1
options:
openstack-origin: *openstack-origin
@ -160,10 +160,10 @@ applications:
openstack-origin: *openstack-origin
to:
- '17'
channel: latest/edge
channel: yoga/edge
ceilometer-agent:
charm: cs:~openstack-charmers-next/ceilometer-agent
charm: ch:ceilometer-agent
relations:

View File

@ -87,7 +87,7 @@ applications:
- '5'
- '6'
- '7'
channel: latest/edge
channel: quincy/edge
ceph-mon:
charm: ch:ceph-mon
@ -98,7 +98,7 @@ applications:
- '8'
- '9'
- '10'
channel: latest/edge
channel: quincy/edge
keystone:
charm: ch:keystone
@ -107,7 +107,7 @@ applications:
openstack-origin: *openstack-origin
to:
- '11'
channel: latest/edge
channel: yoga/edge
glance:
charm: ch:glance
@ -116,7 +116,7 @@ applications:
openstack-origin: *openstack-origin
to:
- '12'
channel: latest/edge
channel: yoga/edge
nova-cloud-controller:
charm: ch:nova-cloud-controller
@ -125,7 +125,7 @@ applications:
openstack-origin: *openstack-origin
to:
- '13'
channel: latest/edge
channel: yoga/edge
placement:
charm: ch:placement
@ -134,7 +134,7 @@ applications:
openstack-origin: *openstack-origin
to:
- '14'
channel: latest/edge
channel: yoga/edge
nova-compute:
charm: ch:nova-compute
@ -143,10 +143,10 @@ applications:
openstack-origin: *openstack-origin
to:
- '15'
channel: latest/edge
channel: yoga/edge
ceilometer:
charm: ../../
charm: ../../ceilometer.charm
num_units: 1
options:
openstack-origin: *openstack-origin
@ -160,10 +160,10 @@ applications:
openstack-origin: *openstack-origin
to:
- '17'
channel: latest/edge
channel: yoga/edge
ceilometer-agent:
charm: cs:~openstack-charmers-next/ceilometer-agent
charm: ch:ceilometer-agent
relations:

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