From 60c63033fde214f2d4f78374a6f853944fb25721 Mon Sep 17 00:00:00 2001 From: escaleira Date: Sat, 26 Mar 2022 15:51:43 +0000 Subject: [PATCH] documentation to add charm libraries as submodules --- 03-day1.md | 51 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/03-day1.md b/03-day1.md index 135ddd6..7b189b5 100644 --- a/03-day1.md +++ b/03-day1.md @@ -107,26 +107,41 @@ osm ns-create ... --config-file vars.yaml This section will focus the attention on creating a Proxy charm to configure a workload. -Create a folder for the `samplecharm` in the VNFD directory, and create necessary files: - +Create a folder for the `samplecharm` in the VNFD directory, and create necessary files (use one of the two following ways): + - Given that you are developing in your local machine: + ```bash + mkdir -p charms/samplecharm/ + cd charms/samplecharm/ + mkdir hooks lib mod src + touch src/charm.py + touch actions.yaml metadata.yaml config.yaml + chmod +x src/charm.py + ln -s ../src/charm.py hooks/upgrade-charm + ln -s ../src/charm.py hooks/install + ln -s ../src/charm.py hooks/start + git clone https://github.com/canonical/operator mod/operator + git clone https://github.com/charmed-osm/charms.osm mod/charms.osm + ln -s ../mod/operator/ops lib/ops + ln -s ../mod/charms.osm/charms lib/charms + ``` + - Given that you are developing in a Git repository: + ```bash + mkdir -p charms/samplecharm/ + cd charms/samplecharm/ + mkdir hooks lib mod src + touch src/charm.py + touch actions.yaml metadata.yaml config.yaml + chmod +x src/charm.py + ln -s ../src/charm.py hooks/upgrade-charm + ln -s ../src/charm.py hooks/install + ln -s ../src/charm.py hooks/start + git submodule add https://github.com/canonical/operator mod/operator + git submodule add https://github.com/charmed-osm/charms.osm mod/charms.osm + ln -s ../mod/operator/ops lib/ops + ln -s ../mod/charms.osm/charms lib/charms + ``` > Go to [charms.osm](https://github.com/charmed-osm/charms.osm) if you want to learn more about how to use the charms.osm library. -```bash -mkdir -p charms/samplecharm/ -cd charms/samplecharm/ -mkdir hooks lib mod src -touch src/charm.py -touch actions.yaml metadata.yaml config.yaml -chmod +x src/charm.py -ln -s ../src/charm.py hooks/upgrade-charm -ln -s ../src/charm.py hooks/install -ln -s ../src/charm.py hooks/start -git clone https://github.com/canonical/operator mod/operator -git clone https://github.com/charmed-osm/charms.osm mod/charms.osm -ln -s ../mod/operator/ops lib/ops -ln -s ../mod/charms.osm/charms lib/charms -``` - Include the following high level metadata in `metadata.yaml`: ```yaml -- GitLab