Merge pull request #1895 from gpazo/24672
authorSteve Hackbarth <stephenhackbarth@gmail.com>
Thu, 2 Oct 2014 19:43:23 +0000 (15:43 -0400)
committerSteve Hackbarth <stephenhackbarth@gmail.com>
Thu, 2 Oct 2014 19:43:23 +0000 (15:43 -0400)
24672

scripts/release_build.sh
scripts/xml/ent_install.xml [new file with mode: 0644]
scripts/xml/ent_package.xml [new file with mode: 0644]
scripts/xml/xtmfg_package.xml

index 133bf95..b2914f8 100755 (executable)
@@ -6,8 +6,8 @@ PAT=$3
 # Usage: ./scripts/release_build.sh 4 5 0-beta
 echo "BUILDING RELEASE "$MAJ"."$MIN"."$PAT""
 
-git fetch XTUPLE
-git checkout XTUPLE/$MAJ"_"$MIN"_"x
+#git fetch XTUPLE
+#git checkout XTUPLE/$MAJ"_"$MIN"_"x
 
 rm -rf scripts/output
 npm run-script build-basic-postbooks-package-sql
@@ -16,8 +16,8 @@ npm run-script build-basic-postbooks-demo
 npm run-script build-basic-quickstart
 cd ../private-extensions
 
-git fetch XTUPLE
-git checkout XTUPLE/$MAJ"_"$MIN"_"x
+#git fetch XTUPLE
+#git checkout XTUPLE/$MAJ"_"$MIN"_"x
 
 npm run-script build-basic-manufacturing-package-sql
 npm run-script build-basic-manufacturing-empty
@@ -79,9 +79,34 @@ cp scripts/output/manufacturing_upgrade.sql scripts/output/manufacturing-install
 cd scripts/output
 tar -zcvf manufacturing-install-$MAJ$MIN$PAT.gz manufacturing-install-$MAJ$MIN$PAT/
 
+#enterprise upgrade
+cd ../../
+mkdir scripts/output/enterprise-upgrade-$MAJ$MIN$PAT
+cp scripts/xml/ent_package.xml scripts/output/enterprise-upgrade-$MAJ$MIN$PAT/package.xml
+cp scripts/output/postbooks_upgrade.sql scripts/output/enterprise-upgrade-$MAJ$MIN$PAT
+cp scripts/output/inventory_upgrade.sql scripts/output/enterprise-upgrade-$MAJ$MIN$PAT
+cp scripts/output/distribution_upgrade.sql scripts/output/enterprise-upgrade-$MAJ$MIN$PAT
+cp scripts/output/manufacturing_upgrade.sql scripts/output/enterprise-upgrade-$MAJ$MIN$PAT
+cd scripts/output
+tar -zcvf enterprise-upgrade-$MAJ$MIN$PAT.gz enterprise-upgrade-$MAJ$MIN$PAT/
+
+#enterprise install
+cd ../../
+mkdir scripts/output/enterprise-install-$MAJ$MIN$PAT
+cp scripts/xml/ent_package.xml scripts/output/enterprise-install-$MAJ$MIN$PAT/package.xml
+cp scripts/output/postbooks_upgrade.sql scripts/output/enterprise-install-$MAJ$MIN$PAT
+cp scripts/output/inventory_basic_install.sql scripts/output/enterprise-install-$MAJ$MIN$PAT
+cp scripts/output/inventory_upgrade.sql scripts/output/enterprise-install-$MAJ$MIN$PAT
+cp scripts/output/distribution_basic_install.sql scripts/output/enterprise-install-$MAJ$MIN$PAT
+cp scripts/output/distribution_upgrade.sql scripts/output/enterprise-install-$MAJ$MIN$PAT
+cp scripts/output/manufacturing_basic_install.sql scripts/output/enterprise-install-$MAJ$MIN$PAT
+cp scripts/output/manufacturing_upgrade.sql scripts/output/enterprise-install-$MAJ$MIN$PAT
+cd scripts/output
+tar -zcvf enterprise-install-$MAJ$MIN$PAT.gz enterprise-install-$MAJ$MIN$PAT/
+
 ADMIN=admin
 PORT=5432
-HOST=xtuple-vagrant
+HOST=localhost
 
 DB_LIST="postbooks_demo empty quickstart distempty distquickstart mfgempty mfgquickstart mfgdemo";
 for DB in $DB_LIST ; do
@@ -100,5 +125,7 @@ rm -rf scripts/output/inventory_basic_install.sql
 rm -rf scripts/output/inventory_upgrade.sql
 rm -rf scripts/output/manufacturing-install-$MAJ$MIN$PAT/
 rm -rf scripts/output/manufacturing-upgrade-$MAJ$MIN$PAT/
+rm -rf scripts/output/enterprise-upgrade-$MAJ$MIN$PAT/
+rm -rf scripts/output/enterprise-install-$MAJ$MIN$PAT/
 rm -rf scripts/output/manufacturing_basic_install.sql
 rm -rf scripts/output/manufacturing_upgrade.sql
diff --git a/scripts/xml/ent_install.xml b/scripts/xml/ent_install.xml
new file mode 100644 (file)
index 0000000..3007dea
--- /dev/null
@@ -0,0 +1,42 @@
+<package id        = "enterprise-install-470"
+         version   = "4.7.0"
+         developer = "xTuple"
+         descrip   = "load PostBooks resources"
+         updater   = "2.2.4" >
+
+  <prerequisite type = "query"
+                name = "Checking xTuple Edition" >
+    <query>SELECT fetchMetricText('Application') = 'PostBooks';</query>
+    <message>This package must be applied to a PostBooks database.</message>
+  </prerequisite>
+
+  <prerequisite type = "query"
+                name = "Checking for too-old xTuple ERP database version" >
+    <query>SELECT fetchMetricText('ServerVersion') > '4.4.';</query>
+    <message>This package must be applied to a 4.4+ database.
+    </message>
+  </prerequisite>
+
+  <prerequisite type = "query"
+                name = "Checking for too-new xTuple ERP database version" >
+    <query>SELECT NOT fetchMetricText('ServerVersion') >= '4.8.0' AND fetchMetricText('ServerVersion') != '4.7.0';</query>
+    <message>This package may not be applied to a database newer than 4.7.0Beta2.
+    </message>
+  </prerequisite>
+
+ <prerequisite type = "query"
+               name = "Checking for mobile-enabled schemas" >
+    <query>SELECT NOT EXISTS(SELECT 1 FROM pg_namespace WHERE nspname = 'xm');</query>
+    <message>This package may not be applied to a mobile-enabled database. Please see your system administrator or contact xTuple.
+    </message>
+  </prerequisite>
+
+  <script file="postbooks_upgrade.sql" />
+  <script file="inventory_basic_install.sql" />
+  <script file="inventory_upgrade.sql" />
+  <script file="distribution_basic_install.sql" />
+  <script file="distribution_upgrade.sql" />
+  <script file="manufacturing_basic_install.sql" />
+  <script file="manufacturing_upgrade.sql" />
+
+</package>
diff --git a/scripts/xml/ent_package.xml b/scripts/xml/ent_package.xml
new file mode 100644 (file)
index 0000000..f830e6a
--- /dev/null
@@ -0,0 +1,50 @@
+<package id        = "enterprise-upgrade-470beta2"
+         version   = "4.7.0Beta2"
+         developer = "xTuple"
+         descrip   = "load PostBooks resources"
+         updater   = "2.2.4" >
+
+  <prerequisite type = "query"
+                name = "Checking xTuple Edition" >
+    <query>SELECT fetchMetricText('Application') = 'Standard';</query>
+    <message>This package must be applied to a Manufacturing Edition database.</message>
+  </prerequisite>
+
+  <prerequisite type="query"
+               name ="Checking xtmfg package" >
+    <query>SELECT TRUE FROM pkghead WHERE pkghead_name = 'xtmfg';</query>
+    <message>This package must be applied to an xTuple ERP database that already contains the xtmfg package.</message>
+  </prerequisite>
+
+ <prerequisite type="query" name="Checking xtmfg Package Version">
+     <query>SELECT TRUE FROM pkghead WHERE pkghead_name = 'xtmfg' AND (pkghead_version >= '4.4');</query>
+    <message>This package must be applied against the 4.4+ version of the xtmfg package.</message>
+  </prerequisite>
+
+  <prerequisite type = "query"
+                name = "Checking for too-old xTuple ERP database version" >
+    <query>SELECT fetchMetricText('ServerVersion') > '4.4.';</query>
+    <message>This package must be applied to a 4.4+ database.
+    </message>
+  </prerequisite>
+
+  <prerequisite type = "query"
+                name = "Checking for too-new xTuple ERP database version" >
+    <query>SELECT NOT fetchMetricText('ServerVersion') >= '4.7.0Beta2' AND fetchMetricText('ServerVersion') != '4.7.0';</query>
+    <message>This package may not be applied to a database newer than 4.7.0Beta.
+    </message>
+  </prerequisite>
+
+ <prerequisite type = "query"
+               name = "Checking for mobile-enabled schemas" >
+    <query>SELECT NOT EXISTS(SELECT 1 FROM pg_namespace WHERE nspname = 'xm');</query>
+    <message>This package may not be applied to a mobile-enabled database. Please see your system administrator or contact xTuple.
+    </message>
+  </prerequisite>
+
+  <script file="postbooks_upgrade.sql" />
+  <script file="inventory_upgrade.sql" />
+  <script file="distribution_upgrade.sql" />
+  <script file="manufacturing_upgrade.sql" />
+
+</package>
index 264a45a..6099b14 100644 (file)
     </message>
   </prerequisite>
 
-<prerequisite type = "query"
-               name = "Checking for too-new xTuple ERP database version" >
-<query>SELECT NOT fetchMetricText('ServerVersion') >= '4.7.0Beta2' AND fetchMetricText('ServerVersion') != '4.7.0';</query>
-    <message>This package may not be applied to a database newer than 4.7.0Beta2.
+  <prerequisite type = "query"
+                name = "Checking for too-new xTuple ERP database version" >
+    <query>SELECT NOT fetchMetricText('ServerVersion') >= '4.7.0Beta2' AND fetchMetricText('ServerVersion') != '4.7.0';</query>
+    <message>This package may not be applied to a database newer than 4.7.0Beta.
     </message>
-</prerequisite>
-
+  </prerequisite>
 
  <prerequisite type = "query"
                name = "Checking for mobile-enabled schemas" >