From b0b953dc0549b9922c581a338d28f88c26122a1b Mon Sep 17 00:00:00 2001 From: Dmitry Ilyin Date: Mon, 12 Aug 2013 18:38:18 +0400 Subject: [PATCH 1/4] Make rdoc script --- .gitignore | 1 + make-rdoc.sh | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100755 make-rdoc.sh diff --git a/.gitignore b/.gitignore index 84f7dca46c..062ab2e78b 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ Vagrantfile metadata.json Gemfile.lock +/rdoc diff --git a/make-rdoc.sh b/make-rdoc.sh new file mode 100755 index 0000000000..e21f7d0ef4 --- /dev/null +++ b/make-rdoc.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +ruby -v | grep -q 'ruby 1.8' + +if [ $? -gt 0 ]; then + echo "Error: you are not using ruby 1.8.*!" + exit 1 +fi + +file="${0}" +dir=`dirname "${file}"` +cd "${dir}" || exit 1 + +if [ -d 'rdoc' ]; then + rm -rf 'rdoc' +fi + +puppet doc --mode "rdoc" --outputdir 'rdoc' --charset "utf-8" --modulepath='deployment/puppet/' --manifestdir='deployment/puppet/nailgun/examples/' + +if [ $? -gt 0 ]; then + exit 1 +fi + +if [ "`uname`" = 'Darwin' ]; then + open 'rdoc/index.html' +elif [ "`uname`" = 'Linux' ]; then + xdg-open 'rdoc/index.html' +else + exit 1 +fi From b00a67b15ebfd8e8f7bd72c61f4c7cb81b8b4cdc Mon Sep 17 00:00:00 2001 From: Dmitry Ilyin Date: Sat, 7 Sep 2013 14:09:22 +0400 Subject: [PATCH 2/4] Fix rdoc generation --- make-rdoc.sh | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/make-rdoc.sh b/make-rdoc.sh index e21f7d0ef4..ee98e5e97f 100755 --- a/make-rdoc.sh +++ b/make-rdoc.sh @@ -15,16 +15,8 @@ if [ -d 'rdoc' ]; then rm -rf 'rdoc' fi -puppet doc --mode "rdoc" --outputdir 'rdoc' --charset "utf-8" --modulepath='deployment/puppet/' --manifestdir='deployment/puppet/nailgun/examples/' +puppet doc --verbose --mode "rdoc" --outputdir 'rdoc' --charset "utf-8" --modulepath='deployment/puppet/' --manifestdir='deployment/puppet/nailgun/examples/' if [ $? -gt 0 ]; then exit 1 fi - -if [ "`uname`" = 'Darwin' ]; then - open 'rdoc/index.html' -elif [ "`uname`" = 'Linux' ]; then - xdg-open 'rdoc/index.html' -else - exit 1 -fi From 1254bf9a586a400ec40322eafb81c2711b2910a3 Mon Sep 17 00:00:00 2001 From: Dmitry Ilyin Date: Tue, 17 Sep 2013 14:59:01 +0400 Subject: [PATCH 3/4] Move make rdoc script --- make-rdoc.sh => utils/jenkins/make_rdoc.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename make-rdoc.sh => utils/jenkins/make_rdoc.sh (100%) diff --git a/make-rdoc.sh b/utils/jenkins/make_rdoc.sh similarity index 100% rename from make-rdoc.sh rename to utils/jenkins/make_rdoc.sh From 0f6129195a3862dbce01c30866be65a25ed57cf1 Mon Sep 17 00:00:00 2001 From: Dmitry Ilyin Date: Tue, 17 Sep 2013 15:28:52 +0400 Subject: [PATCH 4/4] Add RDOC building script for Jenkins --- utils/jenkins/make_rdoc.sh | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/utils/jenkins/make_rdoc.sh b/utils/jenkins/make_rdoc.sh index ee98e5e97f..1a4433acd2 100755 --- a/utils/jenkins/make_rdoc.sh +++ b/utils/jenkins/make_rdoc.sh @@ -7,16 +7,30 @@ if [ $? -gt 0 ]; then exit 1 fi -file="${0}" -dir=`dirname "${file}"` -cd "${dir}" || exit 1 +if [ -z "${WORKSPACE}" ]; then + echo "Error! WORKSPACE is not set!" + exit 1 +fi + +cd "${WORKSPACE}" + +if [ $? -gt 0 ]; then + echo "Error! Can't cd to ${WORKSPACE}" + exit 1 +fi if [ -d 'rdoc' ]; then rm -rf 'rdoc' fi +if [ ! -d "deployment/puppet" ]; then + echo "Puppet modules not found! Something is very wrong!." + exit 1 +fi + puppet doc --verbose --mode "rdoc" --outputdir 'rdoc' --charset "utf-8" --modulepath='deployment/puppet/' --manifestdir='deployment/puppet/nailgun/examples/' if [ $? -gt 0 ]; then + echo "Error building RDOC pages!" exit 1 fi