From c1df659fb1b5539c087fa05da398c1ffa81712b8 Mon Sep 17 00:00:00 2001 From: velazquez Date: Mon, 22 Dec 2025 10:47:14 +0100 Subject: [PATCH] New script to dump templates --- scripts/dump_templates_nsc.sh | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 scripts/dump_templates_nsc.sh diff --git a/scripts/dump_templates_nsc.sh b/scripts/dump_templates_nsc.sh new file mode 100644 index 0000000..b93f0df --- /dev/null +++ b/scripts/dump_templates_nsc.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +# Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This file is an original contribution from Telefonica Innovación Digital S.L. + +rm -rf ./report + +echo "Dumping NSC templates..." +mkdir ./report + +copied=0 + +for file in nbi_template.json ietf_template.json realizer_template.json; do + if docker cp nsc:/app/src/templates/$file ./report/ 2>/dev/null; then + echo "Copied $file" + ((copied++)) + else + echo "⚠️ $file not found in container" + fi +done + +if [ "$copied" -eq 0 ]; then + echo "No templates were copied. Removing ./report" + rm -rf ./report + exit 1 +fi + +echo "$copied template(s) dumped in ./report" \ No newline at end of file -- GitLab