.jenkins.sh 991 Bytes
Newer Older
1 2 3 4 5 6 7 8
#!/bin/bash
#
# Copyright (c) ETSI 2018
# Realeased under the ETSI Software License
#
# https://forge.etsi.org/etsi-software-license

YANG_MODULES="yang/yang/*"
Mahesh Jethanandani's avatar
Mahesh Jethanandani committed
9
OUTPUT="etsi-nfv-descriptors.html"
10 11
IMG_NAME="sol006"
VERSION=latest
12 13
IMG="$IMG_NAME:$VERSION"

14 15
CMT=$(git rev-parse --short HEAD)

16
docker build --tag "$IMG" .
17
docker run "$IMG"
18

19
echo "Building HTML tree"
20
docker run -v"$(pwd)/src/yang/:/yang/" mjethanandani/pyang \
21 22
	"/bin/sh" -c "cd /yang/ && pyang -f jstree -p /yang/ \
	/yang/etsi-nfv.yang > etsi-nfv.html"
23 24 25 26

sed -r -i 's|<a href=\"http://www.tail-f.com">|<a href="http://etsi.org">|g' src/yang/etsi-nfv.html
sed -r -i 's|data\:image/gif\;base64,R0lGODlhS.*RCAA7|https://www.etsi.org/images/ETSILogoTwitter.png\" height=\"100|g' src/yang/etsi-nfv.html

27
sed -r -i "s|<div class=\"app\">|<p>Commit: <a href=\"https://forge.etsi.org/gitlab/nfv/SOL006/commit/${CMT}\">$CMT</a>, Build:<a href=\"$BUILD_URL\">$BUILD_NUMBER</a></p><div class=\"app\">|g" src/yang/etsi-nfv.html
28

29

30
exit $?
31