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: I746b8a5964bd5f8ab43616b1820981567729278c
This commit is contained in:
Hemanth Nakkina 2022-09-08 16:43:20 +05:30
parent c954ca279c
commit 72d5b7bb59
4 changed files with 37 additions and 1 deletions

12
osci.yaml Normal file
View 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: ovn-central-k8s
build_type: charmcraft
publish_charm: true
charmcraft_channel: 2.0/stable
publish_channel: latest/edge

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

@ -7,7 +7,7 @@ This charm provide Glance services as part of an OpenStack deployment
import ovn
import ovsdb as ch_ovsdb
import logging
from typing import List
from typing import List, Mapping
import ops.charm
from ops.framework import StoredState
@ -164,6 +164,15 @@ class OVNCentralOperatorCharm(sunbeam_charm.OSBaseOperatorCharm):
ovn_ctxts.OVNDBConfigContext(self, "ovs_db"))
return contexts
@property
def databases(self) -> Mapping[str, str]:
"""Databases needed to support this charm.
Return empty dict as no mysql databases are
required.
"""
return {}
def ovn_rundir(self):
return '/var/run/ovn'

View File

@ -29,6 +29,7 @@ allowlist_externals =
git
charmcraft
fetch-libs.sh
rename.sh
deps =
-r{toxinidir}/test-requirements.txt
@ -37,6 +38,7 @@ basepython = python3
deps =
commands =
charmcraft -v pack
{toxinidir}/rename.sh
[testenv:fetch]
basepython = python3