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: Ifdf20eb653bf5a828a03e120018fa447310f043c
This commit is contained in:
Alex Kavanagh 2022-02-15 17:02:41 +00:00
parent 82897f8f5f
commit c1cbacb9c2
13 changed files with 42 additions and 8 deletions

1
.gitignore vendored
View File

@ -5,6 +5,7 @@ tags
.tox
*.sw[nop]
*.pyc
*.charm
.unit-state.db
.settings
.stestr

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

@ -10,6 +10,10 @@
# https://bugs.launchpad.net/charm-openstack-dashboard/+bug/1951644
- jammy-yoga-gr:
voting: false
vars:
needs_charm_build: true
charm_build_name: openstack-dashboard
build_type: charmcraft
- job:
name: jammy-yoga-gr

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

@ -49,7 +49,7 @@ applications:
channel: latest/edge
openstack-dashboard:
charm: ../../../openstack-dashboard
charm: ../../openstack-dashboard.charm
num_units: 1
options:
openstack-origin: *openstack-origin

View File

@ -49,7 +49,7 @@ applications:
channel: latest/edge
openstack-dashboard:
charm: ../../../openstack-dashboard
charm: ../../openstack-dashboard.charm
num_units: 1
options:
openstack-origin: *openstack-origin

View File

@ -49,7 +49,7 @@ applications:
channel: latest/edge
openstack-dashboard:
charm: ../../../openstack-dashboard
charm: ../../openstack-dashboard.charm
num_units: 1
options:
openstack-origin: *openstack-origin

View File

@ -53,7 +53,7 @@ applications:
- '3'
channel: latest/edge
openstack-dashboard:
charm: ../../../openstack-dashboard
charm: ../../openstack-dashboard.charm
num_units: 3
to:
- '4'

View File

@ -49,7 +49,7 @@ applications:
channel: latest/edge
openstack-dashboard:
charm: ../../../openstack-dashboard
charm: ../../openstack-dashboard.charm
num_units: 1
options:
openstack-origin: *openstack-origin

View File

@ -1 +0,0 @@
cmr-vault.yaml.j2

View File

@ -1 +0,0 @@
vault.yaml.j2

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