X-Git-Url: https://gerrit.akraino.org/r/gitweb?p=validation.git;a=blobdiff_plain;f=bluval%2Fblucon.sh;fp=bluval%2Fblucon.sh;h=3cc1e5e3f40acff684b63ec63467b8c1125ba5fb;hp=0000000000000000000000000000000000000000;hb=84f85ee9ad86254ba15cc4d237a8b9758304c5e9;hpb=51ff25ab363427ba81387878b8772c17f49daa8b diff --git a/bluval/blucon.sh b/bluval/blucon.sh new file mode 100755 index 0000000..3cc1e5e --- /dev/null +++ b/bluval/blucon.sh @@ -0,0 +1,58 @@ +#!/bin/bash + +############################################################################## +# Copyright (c) 2019 AT&T, ENEA Nokia and others # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); # +# you maynot 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. # +############################################################################## + +if [ -z "$AKRAINO_HOME" ] +then + echo "AKRAINO_HOME not available. Setting..." + this_file="$(readlink -f $0)" + bluval_dir="$(dirname $this_file)" + validation_dir="$(dirname $bluval_dir)" + parent_dir="$(dirname $validation_dir)" + export AKRAINO_HOME="$parent_dir" +fi +echo "AKRAINO_HOME=$AKRAINO_HOME" + +if [ "$#" -eq 0 ] +then + echo 'Usage: sh blucon.sh [OPTIONS] BLUEPRINT + + Invokes blucon.py and passes parameters as it is. + You can pass all the parameters blucon.py accepts, + and as of now here is the list + + Options: + -l, --layer TEXT + -n, --network TEXT + -o, --optional_also + --help Show this message and exit.' + + exit 1 +fi + +echo "Building docker image" +image_tag=$( (git branch || echo "* local") | grep "^\*" | awk '{print $2}') +docker build -t akraino/validation:blucon-$image_tag $AKRAINO_HOME/validation/bluval + +set -x + +docker run --rm \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -v /usr/bin/docker:/usr/bin/docker \ + -v $AKRAINO_HOME/results:/opt/akraino/results \ + -v $AKRAINO_HOME/validation:/opt/akraino/validation \ + akraino/validation:blucon-$image_tag "$@"