diff --git a/README.md b/README.md index a43067e45667c01fce5e61ea8a691d45d14e15e4..358015bd2513a0447ed036ce9d59f1247457f5e3 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,23 @@ This repository has the python-flask Mockup servers created with openapi-generat Please refer to [OCF Documentation] for more detailed information. + +# Install and Run +### (to be added in Getting Started section of Documentation) +``` +mkdir OpenCAPIF + +cd OpenCAPIF + +# The link must be changed when finally merged with the default branch and be permanent +wget https://labs.etsi.org/rep/ocf/capif/-/raw/OCF19-local-installation-of-capif-downloading-script/deploy.sh + +chmod +x deploy.sh + +# ./deploy.sh [branch to fetch] [true or false (default) to install monitoring stack or not] +./deploy.sh staging +``` + ## How to run CAPIF services in this Repository Capif services are developed under /service/ folder. diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 0000000000000000000000000000000000000000..5b483bd72628228beb6b7b5a381e61ac42bf9b37 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +dirlocation=`pwd`/. +# If no argument is provided, use "main" as the default value +default_branch="main" +default_mon="false" +branch="${1:-$default_branch}" +monitoring="${2:-default_mon}" + +echo "Selected branch: $branch" +echo "We're working with $dirlocation" +cd $dirlocation + + +updaterepo(){ + cd $dirlocation + echo "Build " $1 + if [ ! -d $1 ]; then + git clone https://labs.etsi.org/rep/ocf/$1.git + fi + + cd $1/ + git checkout $branch + git pull +} + +updaterepo capif + +cd $dirlocation +cd capif/services + +./run.sh -m $monitoring \ No newline at end of file