Browse Source

not failing on missing site directory

clementinecomputing 6 years ago
parent
commit
5f8abcd187
2 changed files with 9 additions and 4 deletions
  1. 3 3
      server/diu_packager/README.md
  2. 6 1
      server/diu_packager/create_popufare_package.sh

+ 3 - 3
server/diu_packager/README.md

@@ -6,9 +6,9 @@ package ready for DIU deployment.
 
 
 There is a legacy system in place so the install script
 There is a legacy system in place so the install script
 needs to be careful about how it interacts with the
 needs to be careful about how it interacts with the
-system so as not to interfere with a legacy system
-if one is detected but also do normal installation
-if we're on a newer Popufare system.
+target system.
+The install script should proceed nomrally if it detects a
+more recent 'Popufare' system and abort otherwise.
 
 
 This packager is meant mostly for reference.
 This packager is meant mostly for reference.
 Site specific files will need to be added to the packager
 Site specific files will need to be added to the packager

+ 6 - 1
server/diu_packager/create_popufare_package.sh

@@ -26,6 +26,7 @@ mkdir -p package
 pkgver=`date '+%Y%m%d-%H-%M-%S'`
 pkgver=`date '+%Y%m%d-%H-%M-%S'`
 
 
 DIUDIR=`realpath ../../busunit`
 DIUDIR=`realpath ../../busunit`
+SITEDIR="../../site"
 
 
 pkgfile="package-$pkgver.tgz"
 pkgfile="package-$pkgver.tgz"
 pkgdir="package-$pkgver"
 pkgdir="package-$pkgver"
@@ -45,7 +46,11 @@ pushd stage/$pkgdir > /dev/null
   # copy over site specific files that overwrite default
   # copy over site specific files that overwrite default
   # files.
   # files.
   #
   #
-  cp -L -R ../../site .
+  if [[ -d "$SITEDIR" ]] ; then
+    cp -L -R ../../site .
+  else
+    echo "# warning: no site specific directory found ($SITEDIR)"
+  fi
 
 
   tar -czf ../$pkgfile *
   tar -czf ../$pkgfile *