run-container.sh 637 Bytes
Newer Older
1 2 3 4
#!/bin/bash
# Copyright ETSI 2017
# See: https://forge.etsi.org/etsi-forge-copyright-statement.txt

5 6 7 8 9 10 11
# Change this variable to true if you want
# to copy the created yaml files to a web served directory
#
#
WEB_PUBLISH=true

f="${1:-`pwd`}"
12
filter="$2"
13 14 15 16 17 18

echo "Mounting dir $f as /work"

if [ -n "$JOB_BASE_NAME" -a "$WEB_PUBLISH" = true ] ; then 
  s="/var/www/html/api/nfv/$JOB_BASE_NAME/$BUILD_NUMBER"
  mkdir -v -p "$s"
19 20
  echo "Mounting dir $s as /storage"  
  docker run -v "$f":/work -v "$s":/storage openapivalidator "/work" "/storage" "$filter"
21
else
22
  docker run -v "$f":/work openapivalidator "/work" "/storage" "$filter"
23 24 25 26 27
fi