From 3f24eaa185bc57b99bf126473b81d075437ec0aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Fernando=20S=C3=A1nchez?= Date: Mon, 8 Jun 2015 16:43:03 +0200 Subject: [PATCH 1/2] --- specgen.sh | 42 ++++++++++++++++++++++++++++++++++++++++++ upload.sh | 24 ++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 specgen.sh create mode 100644 upload.sh diff --git a/specgen.sh b/specgen.sh new file mode 100644 index 0000000..5b42993 --- /dev/null +++ b/specgen.sh @@ -0,0 +1,42 @@ +#!/bin/bash +if [ $# -lt 1 ] + then + ONTO=onyx + else + ONTO=$1 +fi +if [ $# -lt 2 ] + then + VERSION=latest + else + VERSION=$2 +fi +if [ $# -lt 3 ] + then + DIR=~/Doctorado/Ontologies/Onyx + else + DIR=$3 +fi +if [ $# -lt 4 ] + then + NS=http://www.gsi.dit.upm.es/ontologies/$ONTO/ns# + else + NS=$4 +fi + +SPECPATH=~/Doctorado/tools/specgen6 + +echo "Generating docs for $ONTO from: $DIR" +echo "Namespace: $NS" + +cp -r $DIR/spec $DIR/spec_backup +rm -rf $VERSION/ +mkdir $DIR/spec/$VERSION +python $SPECPATH/specgen6.py --indir=$DIR --ns=$NS --prefix=$ONTO --ontofile=$ONTO.owl --outdir=$DIR/spec/$VERSION --templatedir=$DIR --outfile=index.html +cd $DIR/spec +rm index.html ns $ONTO.owl +ln -s $VERSION/index.html . +ln -s $VERSION/$ONTO.owl $ONTO.owl +ln -s $VERSION/$ONTO.owl ns +ln -s ../img $VERSION/img +ln -s ../style.css $VERSION/style.css \ No newline at end of file diff --git a/upload.sh b/upload.sh new file mode 100644 index 0000000..45205f9 --- /dev/null +++ b/upload.sh @@ -0,0 +1,24 @@ +#!/bin/bash +if [ $# -lt 1 ] + then + echo "Please, specify an ontology" + return + else + ONTO=$1 +fi +if [ $# -lt 2 ] + then + DIR=~/Doctorado/Ontologies/$ONTO/spec/ + else + DIR=$2 +fi + +if [ $# -lt 3 ] + then + REMOTE=gsi-web@web-home.dit.upm.es:lib/www/gsi/ontologies/$ONTO/ + else + REMOTE=$3 +fi + +echo "Uploading to $REMOTE" +rsync -r --links --copy-unsafe-links $DIR $REMOTE \ No newline at end of file From 3c24001f1d275493227a82cf85d178e8f9752e55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Fernando=20S=C3=A1nchez?= Date: Thu, 10 Dec 2015 11:04:27 +0100 Subject: [PATCH 2/2] --- specgen.sh | 36 ++++++++++++++++++++++++------------ upload.sh | 9 ++++++--- 2 files changed, 30 insertions(+), 15 deletions(-) diff --git a/specgen.sh b/specgen.sh index 5b42993..980519d 100644 --- a/specgen.sh +++ b/specgen.sh @@ -1,27 +1,35 @@ #!/bin/bash if [ $# -lt 1 ] then - ONTO=onyx + echo "Usage: $0 " + echo "Example: $0 onto owl latest /tmp/Onto http://example.com/ontologies owl" + exit else ONTO=$1 fi if [ $# -lt 2 ] then - VERSION=latest + FORMAT=owl else - VERSION=$2 + FORMAT=$2 fi if [ $# -lt 3 ] then - DIR=~/Doctorado/Ontologies/Onyx + VERSION=latest else - DIR=$3 + VERSION=$3 fi if [ $# -lt 4 ] + then + DIR=~/Doctorado/Ontologies/$ONTO + else + DIR=$4 +fi +if [ $# -lt 5 ] then NS=http://www.gsi.dit.upm.es/ontologies/$ONTO/ns# else - NS=$4 + NS=$5 fi SPECPATH=~/Doctorado/tools/specgen6 @@ -32,11 +40,15 @@ echo "Namespace: $NS" cp -r $DIR/spec $DIR/spec_backup rm -rf $VERSION/ mkdir $DIR/spec/$VERSION -python $SPECPATH/specgen6.py --indir=$DIR --ns=$NS --prefix=$ONTO --ontofile=$ONTO.owl --outdir=$DIR/spec/$VERSION --templatedir=$DIR --outfile=index.html +python2 $SPECPATH/specgen6.py --indir=$DIR --ns=$NS --prefix=$ONTO --ontofile=$ONTO.$FORMAT --outdir=$DIR/spec/$VERSION --templatedir=$DIR --outfile=index.html cd $DIR/spec -rm index.html ns $ONTO.owl +cp ../$ONTO.$FORMAT $VERSION/ +ln -s $ONTO.$FORMAT $VERSION/ns +cp -R ../img $VERSION/ +cp ../style.css $VERSION/ +rm index.html img style.css ns $ONTO.$FORMAT ln -s $VERSION/index.html . -ln -s $VERSION/$ONTO.owl $ONTO.owl -ln -s $VERSION/$ONTO.owl ns -ln -s ../img $VERSION/img -ln -s ../style.css $VERSION/style.css \ No newline at end of file +ln -s $VERSION/$ONTO.$FORMAT $ONTO.$FORMAT +ln -s $VERSION/$ONTO.$FORMAT ns +ln -s $VERSION/img img +ln -s $VERSION/style.css style.css \ No newline at end of file diff --git a/upload.sh b/upload.sh index 45205f9..c908071 100644 --- a/upload.sh +++ b/upload.sh @@ -2,7 +2,7 @@ if [ $# -lt 1 ] then echo "Please, specify an ontology" - return + exit 0 else ONTO=$1 fi @@ -15,10 +15,13 @@ fi if [ $# -lt 3 ] then - REMOTE=gsi-web@web-home.dit.upm.es:lib/www/gsi/ontologies/$ONTO/ + REMOTE=ontologies@gsi.dit.upm.es:$ONTO/ else REMOTE=$3 fi echo "Uploading to $REMOTE" -rsync -r --links --copy-unsafe-links $DIR $REMOTE \ No newline at end of file +#scp -r $DIR $REMOTE +sftp $REMOTE -b <