5 VERSIONS_LIST=${@:-"1.2.1 2.2.1 7.1"}
8 if ! [ -x "$(command -v curl)" ];then
9 echo "curl is not installed." >&2
12 #check if unzip exists
13 if ! [ -x "$(command -v unzip)" ];then
14 echo "unzip is not installed." >&2
18 for VERSION in $VERSIONS_LIST
21 "1.2.1") PLUGIN_VERSION=1.0.9
22 #update 1.2.1 openroadm device configuration samples to be compliant with honeynode
23 #device models ("multi-wavelegnth" instead of "multi-wavelength" whose typo has been solved with 2.2.1 device models)
24 sed -i_ 's/multi-wavelegnth/multi-wavelength/g' $(dirname $0)/sample_configs/openroadm/1.2.1/oper-ROADM*.xml
26 "2.2.1") PLUGIN_VERSION=2.0.10
28 "7.1") PLUGIN_VERSION=7.1.9
30 *) echo "unsupported device version" >&2
34 TARGET_DIR=$(dirname $0)/honeynode/$VERSION
35 INSTALL_DIR=$TARGET_DIR/honeynode-simulator
36 ARTIFACT_ZIPFILE=$TARGET_DIR/artifact.zip
37 TARGET_URL="https://gitlab.com/api/v4/projects/17518226/jobs/artifacts/honeynode-plugin-aggregator-$PLUGIN_VERSION/download?job=mvn-build"
39 #clean honeynode install directory
41 if [ -d "$INSTALL_DIR" ];then
42 echo "Removing $INSTALL_DIR directory"
46 #download honeynode and install it
47 #complete source code can be found at https://gitlab.com/Orange-OpenSource/lfn/odl/honeynode-simulator.git
49 echo "Installing honeynode for $VERSION devices to $INSTALL_DIR directory "
50 curl --retry-delay 10 --retry 3 -sS --location --request GET $TARGET_URL -o $ARTIFACT_ZIPFILE || exit 2
51 unzip -q $ARTIFACT_ZIPFILE -d $TARGET_DIR
52 rm -f $ARTIFACT_ZIPFILE