Update INFO.yaml with new PTL
[demo.git] / tosca / vCPE / generate_csar.sh
1 #!/bin/bash
2
3 #*******************************************************************************
4 # Copyright (c) 2018 Intel Corp and/or its affiliates.
5 #
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 #     http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #*******************************************************************************
18
19
20 ROOT_DIR=`dirname $(readlink -f $0)`
21 DEST=`pwd`
22 PREFIX="vcpe_"
23
24 DIRS="infra vbrgemu vbng vgmux vgw"
25
26 for dir in $DIRS; do
27
28     # prepare temporary csar build subdirectory
29     cd $ROOT_DIR/$dir
30     mkdir $ROOT_DIR/$dir/tmp
31     cp MainServiceTemplate.mf tmp/
32     if [ $1 ] && [ $1 == "sriov" ]; then
33         cp MainServiceTemplate_sriov.yaml tmp/MainServiceTemplate.yaml
34     else
35         cp MainServiceTemplate.yaml tmp/
36     fi
37     cp -r $ROOT_DIR/Artifacts tmp/
38     cp -r $ROOT_DIR/Definitions tmp/
39     cp -r $ROOT_DIR/TOSCA-Metadata tmp/
40     cp tmp/MainServiceTemplate.yaml tmp/Definitions/
41     cd $ROOT_DIR/$dir/tmp
42
43     # create the csar file
44     zip -r $ROOT_DIR/$dir/$dir.csar Artifacts/ TOSCA-Metadata/ Definitions/ MainServiceTemplate.mf MainServiceTemplate.yaml
45     rm -f $DEST/$dir.csar
46     mv $ROOT_DIR/$dir/$dir.csar $DEST/
47
48     # clean up temporary csar build subdirectory
49     cd $ROOT_DIR/$dir
50     rm -r $ROOT_DIR/$dir/tmp
51 done