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: I737badefa19fd8d65def0ab79cadaa63d7d93b5a
This commit is contained in:
parent
3f3cfa2a8d
commit
b010bab520
12
charms/ovn-relay-k8s/osci.yaml
Normal file
12
charms/ovn-relay-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: ovn-relay-k8s
|
||||||
|
build_type: charmcraft
|
||||||
|
publish_charm: true
|
||||||
|
charmcraft_channel: 2.0/stable
|
||||||
|
publish_channel: latest/edge
|
13
charms/ovn-relay-k8s/rename.sh
Executable file
13
charms/ovn-relay-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
|
@ -25,7 +25,7 @@ develop a new k8s charm using the Operator Framework:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from typing import List
|
from typing import List, Mapping
|
||||||
|
|
||||||
from ops.framework import StoredState
|
from ops.framework import StoredState
|
||||||
from ops.main import main
|
from ops.main import main
|
||||||
@ -76,6 +76,15 @@ class OVNRelayOperatorCharm(ovn_charm.OSBaseOVNOperatorCharm):
|
|||||||
ovn_ctxts.OVNDBConfigContext(self, "ovs_db"))
|
ovn_ctxts.OVNDBConfigContext(self, "ovs_db"))
|
||||||
return contexts
|
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 {}
|
||||||
|
|
||||||
|
|
||||||
class OVNRelayXenaOperatorCharm(OVNRelayOperatorCharm):
|
class OVNRelayXenaOperatorCharm(OVNRelayOperatorCharm):
|
||||||
|
|
||||||
|
@ -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