Add osci yaml
Add project templates and variables to osci.yaml Add rename script to change built charm name to charm_build_name defined in osci.yaml Change-Id: I8ac083237420829d1307d2e0e586ca9fd6256090
This commit is contained in:
parent
cb80255363
commit
dfb105cae8
12
charms/nova-k8s/osci.yaml
Normal file
12
charms/nova-k8s/osci.yaml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
- project:
|
||||||
|
templates:
|
||||||
|
- charm-unit-jobs-py38
|
||||||
|
- charm-unit-jobs-py310
|
||||||
|
- charm-publish-jobs
|
||||||
|
vars:
|
||||||
|
needs_charm_build: true
|
||||||
|
charm_build_name: nova-k8s
|
||||||
|
build_type: charmcraft
|
||||||
|
publish_charm: true
|
||||||
|
charmcraft_channel: 2.0/stable
|
||||||
|
publish_channel: latest/edge
|
13
charms/nova-k8s/rename.sh
Executable file
13
charms/nova-k8s/rename.sh
Executable 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
|
@ -50,6 +50,29 @@ class TestNovaOperatorCharm(test_utils.CharmTestCase):
|
|||||||
self.harness = test_utils.get_harness(
|
self.harness = test_utils.get_harness(
|
||||||
_NovaXenaOperatorCharm,
|
_NovaXenaOperatorCharm,
|
||||||
container_calls=self.container_calls)
|
container_calls=self.container_calls)
|
||||||
|
|
||||||
|
# clean up events that were dynamically defined,
|
||||||
|
# otherwise we get issues because they'll be redefined,
|
||||||
|
# which is not allowed.
|
||||||
|
from charms.data_platform_libs.v0.database_requires import (
|
||||||
|
DatabaseEvents
|
||||||
|
)
|
||||||
|
for attr in (
|
||||||
|
"database_database_created",
|
||||||
|
"database_endpoints_changed",
|
||||||
|
"database_read_only_endpoints_changed",
|
||||||
|
"api_database_database_created",
|
||||||
|
"api_database_endpoints_changed",
|
||||||
|
"api_database_read_only_endpoints_changed",
|
||||||
|
"cell_database_database_created",
|
||||||
|
"cell_database_endpoints_changed",
|
||||||
|
"cell_database_read_only_endpoints_changed",
|
||||||
|
):
|
||||||
|
try:
|
||||||
|
delattr(DatabaseEvents, attr)
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
|
||||||
self.addCleanup(self.harness.cleanup)
|
self.addCleanup(self.harness.cleanup)
|
||||||
test_utils.add_complete_ingress_relation(self.harness)
|
test_utils.add_complete_ingress_relation(self.harness)
|
||||||
self.harness.begin()
|
self.harness.begin()
|
||||||
|
@ -29,6 +29,7 @@ allowlist_externals =
|
|||||||
git
|
git
|
||||||
charmcraft
|
charmcraft
|
||||||
fetch-libs.sh
|
fetch-libs.sh
|
||||||
|
rename.sh
|
||||||
deps =
|
deps =
|
||||||
-r{toxinidir}/test-requirements.txt
|
-r{toxinidir}/test-requirements.txt
|
||||||
|
|
||||||
@ -37,6 +38,7 @@ basepython = python3
|
|||||||
deps =
|
deps =
|
||||||
commands =
|
commands =
|
||||||
charmcraft -v pack
|
charmcraft -v pack
|
||||||
|
{toxinidir}/rename.sh
|
||||||
|
|
||||||
[testenv:fetch]
|
[testenv:fetch]
|
||||||
basepython = python3
|
basepython = python3
|
||||||
|
Loading…
Reference in New Issue
Block a user