summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabriele Giacone <1o5g4r8o@gmail.com>2014-07-26 15:40:14 +0200
committerGabriele Giacone <1o5g4r8o@gmail.com>2014-07-26 15:42:58 +0200
commit13d9eab6f9e7b64739a6849e9d2e36b6a76d8a5e (patch)
treee24b4c8455ec527c42555ac75ead2fd6b43b0daf
parent71fb22b54337ee47284210e4ea3fa5f18161da7b (diff)
downloadjenkins.debian.net-13d9eab6f9e7b64739a6849e9d2e36b6a76d8a5e.tar.xz
Create LVM physical volume if not already done.
-rwxr-xr-xupdate_jdn.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/update_jdn.sh b/update_jdn.sh
index 574080ec..f2a87062 100755
--- a/update_jdn.sh
+++ b/update_jdn.sh
@@ -4,6 +4,8 @@
# released under the GPLv=2
BASEDIR=/root/jenkins.debian.net
+PVNAME=/dev/vdb # LVM physical volume for jobs
+VGNAME=jenkins01 # LVM volume group
explain() {
echo
@@ -122,3 +124,16 @@ sudo chown jenkins /var/cache/pbuilder/result
echo
rgrep FIXME $BASEDIR/* | grep -v "rgrep FIXME" | grep -v echo
+#
+# creating LVM volume group for jobs
+#
+if [ "$PVNAME" = "" ]; then
+ figlet Error
+ explain "Set \$PVNAME to physical volume pathname."
+ exit 1
+else
+ if ! sudo pvs $PVNAME >/dev/null 2>&1; then
+ sudo pvcreate $PVNAME
+ sudo vgcreate $VGNAME $PVNAME
+ fi
+fi