Merge branch 'develop' of https://github.com/Dolibarr/dolibarr.git into develop
1
.gitattributes
vendored
@ -20,7 +20,6 @@
|
||||
*.yaml text eol=lf
|
||||
|
||||
.bash_aliases text eol=lf
|
||||
.vimrc text eol=lf
|
||||
|
||||
# Denote all files that are truly binary and should not be modified.
|
||||
*.bmp binary
|
||||
|
||||
@ -248,6 +248,12 @@ source_file = htdocs/langs/en_US/propal.lang
|
||||
source_lang = en_US
|
||||
type = MOZILLAPROPERTIES
|
||||
|
||||
[dolibarr.salaries]
|
||||
file_filter = htdocs/langs/<lang>/salaries.lang
|
||||
source_file = htdocs/langs/en_US/salaries.lang
|
||||
source_lang = en_US
|
||||
type = MOZILLAPROPERTIES
|
||||
|
||||
[dolibarr.sendings]
|
||||
file_filter = htdocs/langs/<lang>/sendings.lang
|
||||
source_file = htdocs/langs/en_US/sendings.lang
|
||||
|
||||
65
ChangeLog
@ -4,27 +4,45 @@ English Dolibarr ChangeLog
|
||||
|
||||
***** ChangeLog for 3.6 compared to 3.5.* *****
|
||||
For users:
|
||||
- New: Can input barcode during product creation step.
|
||||
- New: Add autonumbering of barcode value for products.
|
||||
- New: Update ckeditor to version 4.
|
||||
- New: Add form "search customer order" on commercial main page.
|
||||
- New: Can create contract from an order.
|
||||
- New: Add list of orders products in tab "consumption" on thirdparties.
|
||||
- New: Add graph stats for suppliers orders in tab "stats" on products.
|
||||
- New: Add option MAIN_HIDE_INACTIVETAB_ON_PRINT to hide inactive tabs when you
|
||||
use the "print" view on screen.
|
||||
- New: Add a menu entry to a barcode generation page.
|
||||
- New: Add option MAIN_AUTO_TIMESTAMP_IN_PUBLIC_NOTES and MAIN_AUTO_TIMESTAMP_IN_PRIVATE_NOTES
|
||||
to automatically add timestamp and user line into editionf field when editing a note.
|
||||
to automatically add timestamp and user line into edition field when editing a note.
|
||||
- New: Add button cancel into edition of notes.
|
||||
- New: Improved Opensurvey module and added options to disable comments and disable
|
||||
public votes.
|
||||
- New: Improved Barcode module:
|
||||
Can input barcode during product creation step.
|
||||
Add autonumbering of barcode value for products.
|
||||
Add a page/tool for mass barcode generation.
|
||||
- New: Improved Opensurvey module:
|
||||
Added options to disable comments and disable public votes.
|
||||
Limit dates use calendar popup.
|
||||
Description of survey use wysiwig editor.
|
||||
More information shown on result tab.
|
||||
Renamed "survey" into "poll" (better translation).
|
||||
- New: Add filter on text and status into survey list. Can also sort on id, text and date end.
|
||||
- New: The box "balance of bank accounts" show all opened accounts.
|
||||
- New: Add option MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE.
|
||||
- New: Add option MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE to add sale represnative into public
|
||||
note of generated documents.
|
||||
- New: Add warning if supplier payment is higher that due amount.
|
||||
- New: Increase length of url into bookmark module.
|
||||
- New: Add an admin page to make a mass init of barcode values for all products.
|
||||
- New: Automatic events for sending mails showing info about mail linked objects.
|
||||
- New: Price management enhancement (multiprice level, price by customer, if MAIN_FEATURES_LEVEL=2 Price by qty)
|
||||
- Fix: Project Task numbering rule customs rule works
|
||||
- New: Automatic events sending mails add info about linked objects into email content.
|
||||
- New: Price management enhancement (multiprice level, price by customer, if MAIN_FEATURES_LEVEL=2 Price by qty).
|
||||
- New: Add option MAIN_FAVICON_URL.
|
||||
- New: Created {line_price_ht_locale}, {line_price_vat_locale} and {line_price_ttc_locale} ODT tags.
|
||||
- New: Add filter on project status into task list. By default, only "opened" project are visible.
|
||||
- New: Status "validated" for project are renamed into "opened".
|
||||
- New: Add barcode fields into user database.
|
||||
- New: Add manager name (ceo, director, president...) into main company information page.
|
||||
- New: Add field url as product properties.
|
||||
- New: More options to create a credit note (can be filled autatically according to remain to pay).
|
||||
- New: Can define custom fields for categories.
|
||||
- Fix: Project Task numbering customs rule works.
|
||||
- Fix: Add actions events not implemented.
|
||||
|
||||
TODO
|
||||
- New: Predefined product and free product use same form.
|
||||
@ -32,7 +50,6 @@ TODO
|
||||
- New: [ task #927 ] Add extrafield feature on Proposal lines.
|
||||
- New: [ task #928 ] Add extrafield feature on invoice lines.
|
||||
|
||||
|
||||
For translators:
|
||||
- Update language files.
|
||||
|
||||
@ -54,8 +71,8 @@ Dolibarr better:
|
||||
|
||||
- The deprecated way (with 4 parameters) to declare a new tab into a module descriptor file has been
|
||||
removed. You must now use the 6 parameters way. See file modMyModule.class.php for example.
|
||||
- Remove the javascrit function ac_delay() that is not used anymore by core code.
|
||||
- Properties dictionnaries into module descriptor files has been renamed into dictionaries.
|
||||
- Remove the javascript function ac_delay() that is not used anymore by core code.
|
||||
- Properties "dictionaries" into module descriptor files has been renamed into "dictionaries".
|
||||
|
||||
|
||||
|
||||
@ -64,7 +81,7 @@ Fix: Do not report trigger errors twice.
|
||||
Fix: Error when creating event was not reported.
|
||||
Fix: Bug of import of agenda when using https link
|
||||
Fix: Field nature not saved correctly
|
||||
Fix: Substituion of extra field was ko for order
|
||||
Fix: Substitution of extra field was ko for order
|
||||
Fix: Bad translation of date format for pt_BR.
|
||||
Fix: priority field of agenda record is smallint.
|
||||
Fix: Missing loading of lang in some pages.
|
||||
@ -73,7 +90,7 @@ Fix: Link to paypal was invalid into email text.
|
||||
Fix: ref and date of supplier invoice.
|
||||
Fix: Check on bank account.
|
||||
Fix: Problem with file upload and download.
|
||||
Fix: Page load not ending when large number of thirdparies. We
|
||||
Fix: Page load not ending when large number of thirdparties. We
|
||||
added option MAIN_DISABLE_AJAX_COMBOX to disable javascript
|
||||
combo feature that is root cause of problem.
|
||||
Fix: [ bug #1231 ] PDF always generated in interventions
|
||||
@ -84,8 +101,20 @@ Fix: Enable extrafields for customer order, proposal and invoice lines. This fea
|
||||
Fix: user right on Holiday for month report nor working.
|
||||
Fix: [ bug #1250 ] "Supplier Ref. product" sidebar search box does not work
|
||||
Fix: Bad space in predefined messages.
|
||||
Fix: Signature was not added for email sent from thirdparty page.
|
||||
Fix: [ bug #1256 ] Signature was not added for email sent from thirdparty page.
|
||||
Fix: Action event SHIPPING_VALIDATE is not implemented
|
||||
Fix: The customer code was set to uppercase when using numbering module leopard. We
|
||||
must keep data safe of any change.
|
||||
Fix: [ bug #1291 ] Loading actions extrafields fails.
|
||||
Fix: [ bug #1123 ] Paid deposit invoices are always shown as partially paid when fully paid
|
||||
Fix: Corrected project contact types translation.
|
||||
Fix: [ bug #1206 ] PMP price is bad calculated.
|
||||
Fix: [ bug #520 ] Product statistics and detailed lists are wrong.
|
||||
Fix: [ bug #1240 ] traduction.
|
||||
Fix: [ bug #1238 ] When creating accompte with a %, free product are used for calculation.
|
||||
Fix: [ bug #1280 ] service with not end of date was tagged as expired.
|
||||
Fix: [ bug #1295 ] Error when creating an agenda extrafield with a number as reference
|
||||
New: Added es_CL language
|
||||
|
||||
***** ChangeLog for 3.5 compared to 3.4.* *****
|
||||
For users:
|
||||
@ -1489,7 +1518,7 @@ For developers:
|
||||
- Add Dolibarr triggers support on payments.
|
||||
- Add Dolibarr triggers on supplier and customers orders.
|
||||
- Webcalendar triggers for actions on Member module.
|
||||
- Support optionnal new javascript popup selector for date fields.
|
||||
- Support optional new javascript popup selector for date fields.
|
||||
- Support for several RSS boxes in external RSS module. Setup easier.
|
||||
- Can attach documents on Action, Orders, Invoices, Commercial proposals.
|
||||
- Can attach contacts on proposals, orders, contracts, invoices.
|
||||
|
||||
147
README
@ -1,147 +0,0 @@
|
||||
README (english)
|
||||
--------------------------------
|
||||
Starter documentation
|
||||
--------------------------------
|
||||
|
||||
1) Install Dolibarr
|
||||
2) Upgrade Dolibarr from an older version
|
||||
3) What's new in this version
|
||||
4) What Dolibarr can do
|
||||
5) What Dolibarr can't do yet, todo list
|
||||
6) Follow Dolibarr on Social Networks
|
||||
|
||||
|
||||
I - DOLIBARR INSTALL
|
||||
--------------------
|
||||
|
||||
If you have no technical knowledge, and you are looking for an autoinstaller
|
||||
to install Dolibarr ERP/CRM in few clicks, you must download DoliWamp (the
|
||||
all-in-one package of Dolibarr for Windows), DoliDeb (the all-in-one package
|
||||
of Dolibarr for Debian or Ubuntu) or DoliRpm (the all-in-one package of
|
||||
Dolibarr for Fedora, Redhat, Mandriva, Opensue, Mageia).
|
||||
|
||||
You can download this at:
|
||||
http://www.dolibarr.org/downloads/
|
||||
|
||||
If you already have installed a Web server and a Mysql database, you can
|
||||
install the standard version like this:
|
||||
|
||||
- Uncompress the downloaded archive.
|
||||
|
||||
- Copy directory "dolibarr" and all its files inside your web server root,
|
||||
or copy directory anywhere and set up your web server to use "dolibarr/htdocs"
|
||||
as root for a new web server virtual host (second choice need to be web
|
||||
server administrator).
|
||||
|
||||
- Create an empty file "htdocs/conf/conf.php" and set permissions for your web
|
||||
server user (write permissions will be removed once install is finished).
|
||||
|
||||
- From your browser, call the dolibarr "install/" page. Url depends on choice
|
||||
made on first step:
|
||||
http://localhost/dolibarr/htdocs/install/
|
||||
or
|
||||
http://yourdolibarrvirtualhost/install/
|
||||
|
||||
- Follow instructions provided by installer...
|
||||
|
||||
|
||||
|
||||
II - DOLIBARR UPGRADE
|
||||
---------------------
|
||||
|
||||
To upgrade Dolibarr from an old version to this one:
|
||||
|
||||
- Overwrite all old files inside old 'dolibarr' directory by files
|
||||
provided into new version package.
|
||||
|
||||
- If you came from version x.y.z to x.y.w (only third number differ),
|
||||
there is no need to run any migrate process.
|
||||
|
||||
- If you came from a beta version or from any version x.y.z to any
|
||||
other where x or y number differs, you must call the Dolibarr "install/"
|
||||
page in your browser (this should be done automatically at first dolibarr
|
||||
access).
|
||||
This URL should looks like:
|
||||
http://localhost/dolibarr/htdocs/install/
|
||||
or
|
||||
http://yourdolibarrhost/install/index.php
|
||||
|
||||
Then choose the "update" option according to your case.
|
||||
Note: Migrate process can be ran safely several times.
|
||||
|
||||
|
||||
III - WHAT'S NEW
|
||||
----------------
|
||||
|
||||
See ChangeLog file found into package.
|
||||
|
||||
|
||||
|
||||
IV - WHAT DOLIBARR CAN DO
|
||||
-------------------------
|
||||
|
||||
Main modules/features:
|
||||
- Products and services catalog
|
||||
- Customers, Prospects or Suppliers directory
|
||||
- Address book
|
||||
- Stock management
|
||||
- Bank accounts management
|
||||
- Orders management with PDF export
|
||||
- Commercial proposals management with PDF export
|
||||
- Contracts management
|
||||
- Invoices management with PDF export
|
||||
- Payments management
|
||||
- Standing orders management
|
||||
- Shipping management
|
||||
- EDM (Electronic Document Management)
|
||||
- EMailings
|
||||
- Agenda with ical,vcal export for third tools integration
|
||||
- Management of foundation members
|
||||
- Donation management
|
||||
|
||||
Other modules:
|
||||
- Bookmarks management
|
||||
- Can reports Dolibarr events inside Webcalendar or Phenix
|
||||
- Data export tools
|
||||
- LDAP connectivity
|
||||
- Third parties or products categories
|
||||
- ClickToDial phone numbers
|
||||
- RSS
|
||||
|
||||
Miscellaneous:
|
||||
- Multi-user, with several permissions levels for each feature.
|
||||
- Serveral menu managers (can be used by internal users, as a back-office,
|
||||
with a particular menu, or by external users, as a front-office, with
|
||||
another menu and permissions).
|
||||
- Very user friendly and easy to use.
|
||||
- Optional WYSIWYG forms, optional Ajax forms.
|
||||
- Several skins.
|
||||
- Code is highly customizable (a lot of use of modules and submodules).
|
||||
- Works with Mysql 4.1 or higher, or PostgreSql 8.14 or higher.
|
||||
- Works with PHP 5.2 or higher.
|
||||
- An easy to understand and maintain code (PHP with no heavy frameworks).
|
||||
- A trigger architecture to allow you to make Dolibarr business events run
|
||||
PHP code to update your own information system.
|
||||
- "NPR VAT Rate" (French particularity for managing VAT in DOM-TOM
|
||||
called "Non Perçue Récupérable").
|
||||
|
||||
|
||||
|
||||
V - WHAT DOLIBARR CAN'T DO YET (TODO LIST)
|
||||
------------------------------------------
|
||||
This is features that Dolibarr does not support completely yet:
|
||||
- No accountancy (only bank management).
|
||||
- Dolibarr manage one currency at once (mono-currency).
|
||||
- Dolibarr manage one company/foundation (mono-company). If you want to manage several companies or foundations, you must install several time the software (on same server or not). Another solution is to extend Dolibarr with the addon Module MultiCompany that allows to manage several companies in one Dolibarr instance (one database but with a logical isolation of datas).
|
||||
- Dolibarr does not contains Payroll module.
|
||||
- Tasks on module project can't have dependencies between each other.
|
||||
- Dolibarr does not include any Webmail.
|
||||
- Dolibarr can't do coffee (not yet).
|
||||
|
||||
|
||||
VI - SOCIAL NETWORKS
|
||||
--------------------
|
||||
Follow Dolibarr project on
|
||||
Facebook: <https://www.facebook.com/dolibarr>
|
||||
Google+: <https://plus.google.com/+DolibarrOrg>
|
||||
Twitter: <http://www.twitter.com/dolibarr>
|
||||
13
build/debian/README.Debian
Normal file
@ -0,0 +1,13 @@
|
||||
Information about Dolibarr in Debian
|
||||
------------------------------------
|
||||
|
||||
The Debian package provides integration with apache2 and lighttpd.
|
||||
If you have one of those servers installed, then Dolibarr is immediately
|
||||
accessible at http://localhost/dolibarr/
|
||||
|
||||
But it won't be usable until you configure it via
|
||||
http://localhost/dolibarr/install/
|
||||
|
||||
To complete the setup process you will need the MySQL root credentials
|
||||
because the Dolibarr installer will create the database and the dedicated user
|
||||
for you.
|
||||
@ -1,12 +0,0 @@
|
||||
==================================================================
|
||||
Dolibarr - Web based software to manage a small company or foundation
|
||||
==================================================================
|
||||
|
||||
|
||||
Note for package maintainers
|
||||
----------------------------
|
||||
This file explains how to modify official sources (from http://www.dolibarr.org)
|
||||
to have ready to use source files to build a debian package.
|
||||
|
||||
All changes are included into patch file
|
||||
build/debian/patches
|
||||
@ -5,6 +5,13 @@ dolibarr (3.6.0-1) unstable; urgency=low
|
||||
|
||||
-- Laurent Destailleur (eldy) <eldy@users.sourceforge.net> Sat, 8 Feb 2014 12:00:00 +0100
|
||||
|
||||
dolibarr (3.5.2-3) unstable; urgency=low
|
||||
|
||||
[ Laurent Destailleur (eldy) ]
|
||||
* New upstream release.
|
||||
|
||||
-- Laurent Destailleur (eldy) <eldy@users.sourceforge.net> Fri, 14 March 2014 12:00:00 +0100
|
||||
|
||||
dolibarr (3.5.1-3) unstable; urgency=low
|
||||
|
||||
[ Laurent Destailleur (eldy) ]
|
||||
|
||||
@ -2,10 +2,10 @@ Source: dolibarr
|
||||
Section: web
|
||||
Priority: optional
|
||||
Maintainer: Laurent Destailleur (eldy) <eldy@users.sourceforge.net>
|
||||
Uploaders: Laurent Destailleur (eldy) <eldy@users.sourceforge.net>
|
||||
# Uploaders: Laurent Destailleur (eldy) <eldy@users.sourceforge.net> # Only if differs from Maintainer
|
||||
Standards-Version: 3.9.4
|
||||
Homepage: http://www.dolibarr.org
|
||||
Build-Depends: debhelper (>= 9), po-debconf, dpatch
|
||||
Build-Depends: debhelper (>= 9), po-debconf
|
||||
Comments: This package need at least debian 7 or ubuntu 13.04 or any distribution based on this version
|
||||
|
||||
Package: dolibarr
|
||||
@ -30,7 +30,7 @@ Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm |
|
||||
${perl:Depends}
|
||||
Recommends: mysql-client, apache2 | lighttpd | httpd
|
||||
Suggests: www-browser
|
||||
Description: Web based software to manage a small company or foundation
|
||||
Description: Web based software to manage a company or foundation
|
||||
Dolibarr ERP & CRM is an easy to use open source/free software for small
|
||||
and medium companies, foundations or freelances. It includes different
|
||||
features for Enterprise Resource Planning (ERP) and Customer Relationship
|
||||
|
||||
@ -1,10 +0,0 @@
|
||||
Document: dolibarr
|
||||
Title: Dolibarr ERP & CRM documentation
|
||||
Author: Dolibarr team
|
||||
Abstract: This documentation covers the install, use and administration of
|
||||
Dolibarr ERP & CRM software.
|
||||
Section: Office
|
||||
|
||||
Format: HTML
|
||||
Index: /usr/share/doc/dolibarr/index.html
|
||||
Files: /usr/share/doc/dolibarr/*.html
|
||||
2
build/debian/dolibarr.docs
Normal file
@ -0,0 +1,2 @@
|
||||
README.md
|
||||
README-FR.md
|
||||
@ -6,8 +6,6 @@ debian/lighttpd/50-dolibarr.conf etc/lighttpd/conf-available/
|
||||
debian/install.forced.php.install etc/dolibarr/
|
||||
htdocs usr/share/dolibarr/
|
||||
scripts usr/share/dolibarr/
|
||||
changelog usr/share/doc/dolibarr/
|
||||
README usr/share/doc/dolibarr/
|
||||
doc/install usr/share/doc/dolibarr/
|
||||
doc/user usr/share/doc/dolibarr/
|
||||
doc/index.html usr/share/doc/dolibarr/
|
||||
@ -1 +0,0 @@
|
||||
install.dpatch
|
||||
@ -1,50 +0,0 @@
|
||||
#! /bin/sh /usr/share/dpatch/dpatch-run
|
||||
## install.patch by <eldy@users.sourceforge.net>
|
||||
##
|
||||
## All lines beginning with `## DP:' are a description of the patch.
|
||||
## DP: Updates htdocs/filefunc.inc.php
|
||||
## DP: Updates htdocs/install/inc.php
|
||||
## DP: Updates htdocs/support/inc.php
|
||||
|
||||
@DPATCH@
|
||||
|
||||
|
||||
--- old/htdocs/filefunc.inc.php 2011-09-03 02:32:48.666952000 +0200
|
||||
+++ new/htdocs/filefunc.inc.php 2011-09-03 02:33:00.510952001 +0200
|
||||
@@ -63,8 +63,8 @@
|
||||
$conffile = "conf/conf.php";
|
||||
$conffiletoshow = "htdocs/conf/conf.php";
|
||||
// For debian/redhat like systems
|
||||
-//$conffile = "/etc/dolibarr/conf.php";
|
||||
-//$conffiletoshow = "/etc/dolibarr/conf.php";
|
||||
+$conffile = "/etc/dolibarr/conf.php";
|
||||
+$conffiletoshow = "/etc/dolibarr/conf.php";
|
||||
|
||||
|
||||
// Include configuration
|
||||
--- old/htdocs/install/inc.php 2011-09-03 02:33:26.450952000 +0200
|
||||
+++ new/htdocs/install/inc.php 2011-09-03 02:33:36.286952001 +0200
|
||||
@@ -71,8 +71,8 @@
|
||||
$conffile = "../conf/conf.php";
|
||||
$conffiletoshow = "htdocs/conf/conf.php";
|
||||
// For debian/redhat like systems
|
||||
-//$conffile = "/etc/dolibarr/conf.php";
|
||||
-//$conffiletoshow = "/etc/dolibarr/conf.php";
|
||||
+$conffile = "/etc/dolibarr/conf.php";
|
||||
+$conffiletoshow = "/etc/dolibarr/conf.php";
|
||||
|
||||
|
||||
if (! defined('DONOTLOADCONF') && file_exists($conffile))
|
||||
--- old/htdocs/support/inc.php 2011-09-03 02:34:39.606952000 +0200
|
||||
+++ new/htdocs/support/inc.php 2011-09-03 02:33:59.814952000 +0200
|
||||
@@ -69,8 +69,8 @@
|
||||
$conffile = "../conf/conf.php";
|
||||
$conffiletoshow = "htdocs/conf/conf.php";
|
||||
// For debian/redhat like systems
|
||||
-//$conffile = "/etc/dolibarr/conf.php";
|
||||
-//$conffiletoshow = "/etc/dolibarr/conf.php";
|
||||
+$conffile = "/etc/dolibarr/conf.php";
|
||||
+$conffiletoshow = "/etc/dolibarr/conf.php";
|
||||
|
||||
|
||||
if (! defined('DONOTLOADCONF') && file_exists($conffile))
|
||||
1
build/debian/patches/series
Normal file
@ -0,0 +1 @@
|
||||
use-etc-dolibarr-conf.patch
|
||||
50
build/debian/patches/use-etc-dolibarr-conf.patch
Normal file
@ -0,0 +1,50 @@
|
||||
Description: Enable /etc/dolibarr/conf.php so that we use packaged libraries
|
||||
Update some PHP include files to refer to /etc/dolibarr/conf.php
|
||||
instead of the in-tree conf/conf.php.
|
||||
.
|
||||
/etc/dolibarr/conf.php configures Dolibarr to use packaged libraries
|
||||
instead of the embedded ones.
|
||||
Author: Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
Forwarded: not-needed
|
||||
Last-Update: 2013-07-29
|
||||
---
|
||||
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
|
||||
--- a/htdocs/filefunc.inc.php
|
||||
+++ b/htdocs/filefunc.inc.php
|
||||
@@ -63,8 +63,8 @@ $conffiletoshowshort = "conf.php";
|
||||
$conffile = "conf/conf.php";
|
||||
$conffiletoshow = "htdocs/conf/conf.php";
|
||||
// For debian/redhat like systems
|
||||
-//$conffile = "/etc/dolibarr/conf.php";
|
||||
-//$conffiletoshow = "/etc/dolibarr/conf.php";
|
||||
+$conffile = "/etc/dolibarr/conf.php";
|
||||
+$conffiletoshow = "/etc/dolibarr/conf.php";
|
||||
|
||||
|
||||
// Include configuration
|
||||
--- a/htdocs/install/inc.php
|
||||
+++ b/htdocs/install/inc.php
|
||||
@@ -73,8 +73,8 @@ $conffiletoshowshort = "conf.php";
|
||||
$conffile = "../conf/conf.php";
|
||||
$conffiletoshow = "htdocs/conf/conf.php";
|
||||
// For debian/redhat like systems
|
||||
-//$conffile = "/etc/dolibarr/conf.php";
|
||||
-//$conffiletoshow = "/etc/dolibarr/conf.php";
|
||||
+$conffile = "/etc/dolibarr/conf.php";
|
||||
+$conffiletoshow = "/etc/dolibarr/conf.php";
|
||||
|
||||
|
||||
if (! defined('DONOTLOADCONF') && file_exists($conffile))
|
||||
--- a/htdocs/support/inc.php
|
||||
+++ b/htdocs/support/inc.php
|
||||
@@ -69,8 +69,8 @@ $conffiletoshowshort = "conf.php";
|
||||
$conffile = "../conf/conf.php";
|
||||
$conffiletoshow = "htdocs/conf/conf.php";
|
||||
// For debian/redhat like systems
|
||||
-//$conffile = "/etc/dolibarr/conf.php";
|
||||
-//$conffiletoshow = "/etc/dolibarr/conf.php";
|
||||
+$conffile = "/etc/dolibarr/conf.php";
|
||||
+$conffiletoshow = "/etc/dolibarr/conf.php";
|
||||
|
||||
|
||||
if (! defined('DONOTLOADCONF') && file_exists($conffile))
|
||||
@ -7,29 +7,17 @@ export DH_OPTIONS=-v
|
||||
#export DH_COMPAT=7 # This is the debhelper compatability version to use, now defined into compat file
|
||||
|
||||
|
||||
# use dpatch
|
||||
include /usr/share/dpatch/dpatch.make
|
||||
|
||||
|
||||
configure:
|
||||
%:
|
||||
dh $@
|
||||
|
||||
build: patch
|
||||
dh $@
|
||||
override_dh_auto_clean:
|
||||
# Do nothing. Added to disable launchpad to use bugged dh_auto_clean search for ant
|
||||
|
||||
build-arch: patch
|
||||
dh $@
|
||||
|
||||
build-indep: patch
|
||||
dh $@
|
||||
|
||||
binary:
|
||||
dh $@
|
||||
|
||||
binary-indep:
|
||||
dh $@
|
||||
override_dh_auto_build:
|
||||
# Do nothing. Added to disable launchpad to use bugged dh_auto_build search for ant
|
||||
|
||||
clean:
|
||||
override_dh_install:
|
||||
dh_install
|
||||
# Delete files
|
||||
rm -f .buildpath
|
||||
rm -fr .cache
|
||||
@ -41,7 +29,6 @@ clean:
|
||||
rm -f build.xml
|
||||
rm -f quickbuild.xml
|
||||
rm -f pom.xml
|
||||
rm -f README.md
|
||||
|
||||
rm -f htdocs/install/mssql/README
|
||||
rm -f htdocs/install/mysql/README
|
||||
@ -119,7 +106,16 @@ clean:
|
||||
rm -f htdocs/includes/phpexcel/license.txt
|
||||
rm -f htdocs/includes/tcpdf/LICENSE.TXT
|
||||
|
||||
dh $@
|
||||
# Drop unwanted executable permissions
|
||||
find debian/dolibarr/usr/share/dolibarr/htdocs -type f -print0 | \
|
||||
xargs -0 chmod 644
|
||||
# Add missing executable permissions
|
||||
find debian/dolibarr/usr/share/dolibarr/scripts -type f -name '*.php' -print0 | \
|
||||
xargs -0 chmod 755
|
||||
|
||||
binary-arch:
|
||||
override_dh_fixperms:
|
||||
dh_fixperms
|
||||
# Give rights to the webserver on the upload directory
|
||||
chown www-data:www-data debian/dolibarr/var/lib/dolibarr/documents
|
||||
chmod 2775 debian/dolibarr/var/lib/dolibarr/documents
|
||||
|
||||
|
||||
@ -1 +1 @@
|
||||
3.0 (native)
|
||||
3.0 (quilt)
|
||||
@ -17,9 +17,9 @@
|
||||
; ----- Change this -----
|
||||
AppName=DoliWamp
|
||||
; DoliWamp-x.x.x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x
|
||||
AppVerName=DoliWamp-3.6.0-beta
|
||||
AppVerName=DoliWamp-3.6.0-alpha
|
||||
; DoliWamp-x.x x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x
|
||||
OutputBaseFilename=DoliWamp-3.6.0-beta
|
||||
OutputBaseFilename=DoliWamp-3.6.0-alpha
|
||||
; ----- End of change
|
||||
;OutputManifestFile=build\doliwampbuild.log
|
||||
; Define full path from which all relative path are defined
|
||||
|
||||
@ -758,5 +758,15 @@ SSLCertificateKeyFile "WAMPROOT/myserver.key"
|
||||
#ExpiresByType application/javascript A2592000
|
||||
|
||||
|
||||
# To protect Dolibarr with HTTP Auth
|
||||
#<Location /dolibarr>
|
||||
# Options +Indexes
|
||||
# AuthUserFile /var/www/.htpasswd
|
||||
# AuthName "Zone authent basic Dolibarr"
|
||||
# AuthType Basic
|
||||
# require user test
|
||||
#</Location>
|
||||
|
||||
|
||||
# Declare alias for Dolibarr, PHPMyAdmin and other softwares
|
||||
Include "WAMPROOT/alias/*.conf"
|
||||
|
||||
@ -81,7 +81,7 @@ If you want to build/test package locally:
|
||||
bzr init
|
||||
bzr add
|
||||
bzr commit -m "Init control files"
|
||||
bzr push lp:~yourlogin/+junk/debian-[dev|beta|stable] (put here any branch name)
|
||||
bzr push lp:~yourlogin/+junk/debian-[dev|beta|stable] (put here any branch name or just bzr push if into a known branch)
|
||||
- or download it from launchpad bazaar:
|
||||
cd bzr
|
||||
bzr branch lp:~yourlogin/+junk/debian-[dev|beta|stable]
|
||||
|
||||
@ -16,14 +16,13 @@
|
||||
use Cwd;
|
||||
|
||||
$PROJECT="dolibarr";
|
||||
$MAJOR="3";
|
||||
$MINOR="6";
|
||||
$BUILD="0-dev"; # Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate
|
||||
$RPMSUBVERSION="auto"; # auto use value found into BUILD
|
||||
|
||||
@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
|
||||
%REQUIREMENTPUBLISH=(
|
||||
"SF"=>"git ssh rsync"
|
||||
);
|
||||
%REQUIREMENTTARGET=( # Tool requirement for each package
|
||||
"SNAPSHOT"=>"tar",
|
||||
"TGZ"=>"tar",
|
||||
"ZIP"=>"7z",
|
||||
"XZ"=>"xz",
|
||||
@ -31,24 +30,16 @@ $RPMSUBVERSION="auto"; # auto use value found into BUILD
|
||||
"RPM_FEDORA"=>"rpmbuild",
|
||||
"RPM_MANDRIVA"=>"rpmbuild",
|
||||
"RPM_OPENSUSE"=>"rpmbuild",
|
||||
"DEB"=>"dpkg dpatch",
|
||||
"DEB"=>"dpkg",
|
||||
"APS"=>"zip",
|
||||
"EXEDOLIWAMP"=>"ISCC.exe"
|
||||
"EXEDOLIWAMP"=>"ISCC.exe",
|
||||
"SNAPSHOT"=>"tar"
|
||||
);
|
||||
%ALTERNATEPATH=(
|
||||
"7z"=>"7-ZIP",
|
||||
"makensis.exe"=>"NSIS"
|
||||
);
|
||||
|
||||
$FILENAME="$PROJECT";
|
||||
$FILENAMESNAPSHOT="$PROJECT-snapshot";
|
||||
$FILENAMETGZ="$PROJECT-$MAJOR.$MINOR.$BUILD";
|
||||
$FILENAMEZIP="$PROJECT-$MAJOR.$MINOR.$BUILD";
|
||||
$FILENAMEXZ="$PROJECT-$MAJOR.$MINOR.$BUILD";
|
||||
$FILENAMERPM="$PROJECT-$MAJOR.$MINOR.$BUILD-$RPMSUBVERSION";
|
||||
$FILENAMEDEB="see later";
|
||||
$FILENAMEAPS="$PROJECT-$MAJOR.$MINOR.$BUILD.app";
|
||||
$FILENAMEEXEDOLIWAMP="DoliWamp-$MAJOR.$MINOR.$BUILD";
|
||||
if (-d "/usr/src/redhat") { $RPMDIR="/usr/src/redhat"; } # redhat
|
||||
if (-d "/usr/src/packages") { $RPMDIR="/usr/src/packages"; } # opensuse
|
||||
if (-d "/usr/src/RPM") { $RPMDIR="/usr/src/RPM"; } # mandrake
|
||||
@ -67,6 +58,7 @@ $DIR||='.'; $DIR =~ s/([^\/\\])[\\\/]+$/$1/;
|
||||
|
||||
$SOURCE="$DIR/..";
|
||||
$DESTI="$SOURCE/build";
|
||||
$PUBLISH="eldy,dolibarr\@frs.sourceforge.net:/home/frs/project/dolibarr";
|
||||
if (! $ENV{"DESTIBETARC"} || ! $ENV{"DESTISTABLE"})
|
||||
{
|
||||
print "Error: Missing environment variables.\n";
|
||||
@ -120,7 +112,57 @@ if (! $TEMP || ! -d $TEMP) {
|
||||
$BUILDROOT="$TEMP/buildroot";
|
||||
|
||||
|
||||
my $copyalreadydone=0; # Use "-" before number of choice to avoid copy
|
||||
# Get version $MAJOR, $MINOR and $BUILD
|
||||
$result = open( IN, "<" . $SOURCE . "/htdocs/filefunc.inc.php" );
|
||||
if ( !$result ) { die "Error: Can't open descriptor file " . $SOURCE . "/htdocs/filefunc.inc.php\n"; }
|
||||
while (<IN>) {
|
||||
if ( $_ =~ /define\('DOL_VERSION','([\d\.a-z\-]+)'\)/ ) { $PROJVERSION = $1; break; }
|
||||
}
|
||||
close IN;
|
||||
($MAJOR,$MINOR,$BUILD)=split(/\./,$PROJVERSION,3);
|
||||
if ($MINOR eq '') { die "Error can't detect version into ".$SOURCE . "/htdocs/filefunc.inc.php"; }
|
||||
|
||||
# Set vars for packaging
|
||||
$FILENAME = "$PROJECT";
|
||||
$FILENAMESNAPSHOT = "$PROJECT-snapshot";
|
||||
$FILENAMETGZ = "$PROJECT-$MAJOR.$MINOR.$BUILD";
|
||||
$FILENAMEZIP = "$PROJECT-$MAJOR.$MINOR.$BUILD";
|
||||
$FILENAMEXZ = "$PROJECT-$MAJOR.$MINOR.$BUILD";
|
||||
$FILENAMEDEB = "see later";
|
||||
$FILENAMEAPS = "$PROJECT-$MAJOR.$MINOR.$BUILD.app";
|
||||
$FILENAMEEXEDOLIWAMP = "DoliWamp-$MAJOR.$MINOR.$BUILD";
|
||||
# For RPM
|
||||
$ARCH='noarch';
|
||||
$newbuild = $BUILD;
|
||||
$newbuild =~ s/(dev|alpha)/0.1.a/gi; # dev (fedora)
|
||||
$newbuild =~ s/beta/0.2.beta1/gi; # beta (fedora)
|
||||
$newbuild =~ s/rc./0.3.rc1/gi; # rc (fedora)
|
||||
if ($newbuild !~ /-/) { $newbuild.='-0.3'; } # finale (fedora)
|
||||
#$newbuild =~ s/(dev|alpha)/0/gi; # dev
|
||||
#$newbuild =~ s/beta/1/gi; # beta
|
||||
#$newbuild =~ s/rc./2/gi; # rc
|
||||
#if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale
|
||||
$REL1 = $newbuild; $REL1 =~ s/-.*$//gi;
|
||||
if ($RPMSUBVERSION eq 'auto') { $RPMSUBVERSION = $newbuild; $RPMSUBVERSION =~ s/^.*-//gi; }
|
||||
$FILENAMETGZ2="$PROJECT-$MAJOR.$MINOR.$REL1";
|
||||
$FILENAMERPM=$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm";
|
||||
# For Deb
|
||||
$newbuild = $BUILD;
|
||||
$newbuild =~ s/(dev|alpha)/1/gi; # dev
|
||||
$newbuild =~ s/beta/2/gi; # beta
|
||||
$newbuild =~ s/rc./3/gi; # rc
|
||||
if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale is same than rc.
|
||||
# now newbuild is 0-1 or 0-3 for example. Note that for native package (see debian/source/format), we should not use a dash part but to get a better version management
|
||||
$build = $newbuild;
|
||||
$build =~ s/-.*$//g;
|
||||
# now build is 0 for example
|
||||
# $build .= '+nmu1';
|
||||
# now build is 0+nmu1 for example
|
||||
$FILENAMEDEBNATIVE="${PROJECT}_${MAJOR}.${MINOR}.${build}";
|
||||
$FILENAMEDEB="${PROJECT}_${MAJOR}.${MINOR}.${newbuild}";
|
||||
|
||||
|
||||
my $copyalreadydone=0;
|
||||
my $batch=0;
|
||||
for (0..@ARGV-1) {
|
||||
if ($ARGV[$_] =~ /^-*target=(\w+)/i) { $target=$1; $batch=1; }
|
||||
@ -130,41 +172,47 @@ for (0..@ARGV-1) {
|
||||
$FILENAMESNAPSHOT.="-".$PREFIX;
|
||||
}
|
||||
}
|
||||
if ($ENV{"DESTIBETARC"} && $BUILD =~ /[a-z]/i) { $DESTI = $ENV{"DESTIBETARC"}; } # Force output dir if env DESTI is defined
|
||||
if ($ENV{"DESTISTABLE"} && $BUILD =~ /^[0-9]+$/) { $DESTI = $ENV{"DESTISTABLE"}; } # Force output dir if env DESTI is defined
|
||||
|
||||
if ($ENV{"DESTIBETARC"} && $BUILD =~ /[a-z]/i) { $DESTI = $ENV{"DESTIBETARC"}; } # Force output dir if env DESTIBETARC is defined
|
||||
if ($ENV{"DESTISTABLE"} && $BUILD =~ /^[0-9]+$/) { $DESTI = $ENV{"DESTISTABLE"}; } # Force output dir if env DESTISTABLE is defined
|
||||
if ($ENV{"PUBLISHBETARC"} && $BUILD =~ /[a-z]/i) { $PUBLISH = $ENV{"PUBLISHBETARC"}; } # Force target site for publishing if env PUBLISHBETARC is defined
|
||||
if ($ENV{"PUBLISHSTABLE"} && $BUILD =~ /^[0-9]+$/) { $PUBLISH = $ENV{"PUBLISHSTABLE"}; } # Force target site for publishing if env PUBLISHSTABLE is defined
|
||||
|
||||
print "Makepack version $VERSION\n";
|
||||
print "Building package name: $PROJECT\n";
|
||||
print "Building package version: $MAJOR.$MINOR.$BUILD\n";
|
||||
print "Building/publishing package name: $PROJECT\n";
|
||||
print "Building/publishing package version: $MAJOR.$MINOR.$BUILD\n";
|
||||
print "Source directory (SOURCE): $SOURCE\n";
|
||||
print "Target directory (DESTI) : $DESTI\n";
|
||||
print "Publishing target (PUBLISH): $PUBLISH\n";
|
||||
|
||||
|
||||
# Choose package targets
|
||||
#-----------------------
|
||||
if ($target) {
|
||||
$CHOOSEDTARGET{uc($target)}=1;
|
||||
if ($target eq "ALL") {
|
||||
foreach my $key (@LISTETARGET) {
|
||||
if ($key ne 'SNAPSHOT' && $key ne 'SF') { $CHOOSEDTARGET{$key}=1; }
|
||||
}
|
||||
}
|
||||
if ($target ne "ALL" && $target ne "SF") { $CHOOSEDTARGET{uc($target)}=1; }
|
||||
if ($target eq "SF") { $CHOOSEDPUBLISH{"SF"}=1; }
|
||||
}
|
||||
else {
|
||||
my $found=0;
|
||||
my $NUM_SCRIPT;
|
||||
my $cpt=0;
|
||||
while (! $found) {
|
||||
my $cpt=0;
|
||||
printf(" %2d - %-12s (%s)\n",$cpt,"All (Except SNAPSHOT)","Need ".join(",",values %REQUIREMENTTARGET));
|
||||
printf(" %2d - %-12s (%s)\n",$cpt,"ALL (1..9)","Need ".join(",",values %REQUIREMENTTARGET));
|
||||
foreach my $target (@LISTETARGET) {
|
||||
$cpt++;
|
||||
printf(" %2d - %-12s (%s)\n",$cpt,$target,"Need ".$REQUIREMENTTARGET{$target});
|
||||
}
|
||||
$cpt=99;
|
||||
printf(" %2d - %-12s (%s)\n",$cpt,"SF (publish)","Need ".join(",",values %REQUIREMENTPUBLISH));
|
||||
|
||||
# On demande de choisir le fichier à passer
|
||||
# Ask which target to build
|
||||
print "Choose one package number or several separated with space (0 - ".$cpt."): ";
|
||||
$NUM_SCRIPT=<STDIN>;
|
||||
chomp($NUM_SCRIPT);
|
||||
if ($NUM_SCRIPT =~ s/-//g) {
|
||||
# Do not do copy
|
||||
$copyalreadydone=1;
|
||||
}
|
||||
if ($NUM_SCRIPT !~ /^[0-9\s]+$/)
|
||||
{
|
||||
print "This is not a valid package number list.\n";
|
||||
@ -176,15 +224,20 @@ else {
|
||||
}
|
||||
}
|
||||
print "\n";
|
||||
if ($NUM_SCRIPT) {
|
||||
foreach my $num (split(/\s+/,$NUM_SCRIPT)) {
|
||||
$CHOOSEDTARGET{$LISTETARGET[$num-1]}=1;
|
||||
}
|
||||
if ($NUM_SCRIPT eq "99") {
|
||||
$CHOOSEDPUBLISH{"SF"}=1;
|
||||
}
|
||||
else {
|
||||
foreach my $key (@LISTETARGET) {
|
||||
if ($key ne 'SNAPSHOT') { $CHOOSEDTARGET{$key}=1; }
|
||||
}
|
||||
if ($NUM_SCRIPT eq "0") {
|
||||
foreach my $key (@LISTETARGET) {
|
||||
if ($key ne 'SNAPSHOT' && $key ne 'SF') { $CHOOSEDTARGET{$key}=1; }
|
||||
}
|
||||
}
|
||||
else {
|
||||
foreach my $num (split(/\s+/,$NUM_SCRIPT)) {
|
||||
$CHOOSEDTARGET{$LISTETARGET[$num-1]}=1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -201,7 +254,8 @@ foreach my $target (keys %CHOOSEDTARGET) {
|
||||
}
|
||||
$atleastonerpm=1;
|
||||
}
|
||||
foreach my $req (split(/[,\s]/,$REQUIREMENTTARGET{$target})) {
|
||||
foreach my $req (split(/[,\s]/,$REQUIREMENTTARGET{$target}))
|
||||
{
|
||||
# Test
|
||||
print "Test requirement for target $target: Search '$req'... ";
|
||||
$newreq=$req; $newparam='';
|
||||
@ -236,16 +290,20 @@ print "\n";
|
||||
#----------------------------------------------
|
||||
$nboftargetok=0;
|
||||
$nboftargetneedbuildroot=0;
|
||||
$nboftargetneedcvs=0;
|
||||
$nbofpublishneedtag=0;
|
||||
foreach my $target (keys %CHOOSEDTARGET) {
|
||||
if ($CHOOSEDTARGET{$target} < 0) { next; }
|
||||
if ($target ne 'EXE' && $target ne 'EXEDOLIWAMP')
|
||||
{
|
||||
$nboftargetneedbuildroot++;
|
||||
}
|
||||
if ($target eq 'SNAPSHOT')
|
||||
$nboftargetok++;
|
||||
}
|
||||
foreach my $target (keys %CHOOSEDPUBLISH) {
|
||||
if ($CHOOSEDPUBLISH{$target} < 0) { next; }
|
||||
if ($target eq 'SF')
|
||||
{
|
||||
$nboftargetneedcvs++;
|
||||
$nbofpublishneedtag++;
|
||||
}
|
||||
$nboftargetok++;
|
||||
}
|
||||
@ -254,13 +312,26 @@ if ($nboftargetok) {
|
||||
|
||||
# Update CVS if required
|
||||
#-----------------------
|
||||
if ($nboftargetneedcvs)
|
||||
if ($nbofpublishneedtag)
|
||||
{
|
||||
print "Go to directory $SOURCE\n";
|
||||
$olddir=getcwd();
|
||||
chdir("$SOURCE");
|
||||
print "Run cvs update -P -d\n";
|
||||
$ret=`cvs update -P -d 2>&1`;
|
||||
print 'Run git tag -a -m "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'" "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'"'."\n";
|
||||
$ret=`git tag -a -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD" 2>&1`;
|
||||
if ($ret =~ /already exists/)
|
||||
{
|
||||
print "WARNING: Tag ".$MAJOR.'.'.$MINOR.'.'.$BUILD." already exists. Overwrite (y/N) ? ";
|
||||
$QUESTIONOVERWRITETAG=<STDIN>;
|
||||
chomp($QUESTIONOVERWRITETAG);
|
||||
if ($QUESTIONOVERWRITETAG =~ /(o|y)/)
|
||||
{
|
||||
print 'Run git tag -a -f -m "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'" "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'"'."\n";
|
||||
$ret=`git tag -a -f -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD"`;
|
||||
}
|
||||
}
|
||||
print 'Run git push --tags'."\n";
|
||||
$ret=`git push --tags`;
|
||||
chdir("$olddir");
|
||||
}
|
||||
|
||||
@ -278,22 +349,22 @@ if ($nboftargetok) {
|
||||
mkdir "$BUILDROOT/$PROJECT";
|
||||
print "Copy $SOURCE into $BUILDROOT/$PROJECT\n";
|
||||
$ret=`cp -pr "$SOURCE" "$BUILDROOT/$PROJECT"`;
|
||||
print "Copy $SOURCE/build/debian/apache/.htaccess into $BUILDROOT/$PROJECT/build/debian/apache/.htaccess\n";
|
||||
$ret=`cp -pr "$SOURCE/build/debian/apache/.htaccess" "$BUILDROOT/$PROJECT/build/debian/apache/.htaccess"`;
|
||||
|
||||
#print "Copy $SOURCE/build/debian/apache/.htaccess into $BUILDROOT/$PROJECT/build/debian/apache/.htaccess\n";
|
||||
#$ret=`cp -pr "$SOURCE/build/debian/apache/.htaccess" "$BUILDROOT/$PROJECT/build/debian/apache/.htaccess"`;
|
||||
}
|
||||
print "Clean $BUILDROOT\n";
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/.buildpath`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/.cache`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/.git`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/.gitmodules`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/.gitignore`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/.externalToolBuilders`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/.git*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/.project`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/.settings`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/.travis.yml`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/.tx`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/build.xml`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/quickbuild.xml`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/pom.xml`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/README.md`;
|
||||
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/build/html`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/build/Doli*-*`;
|
||||
@ -319,6 +390,8 @@ if ($nboftargetok) {
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/mysql/README`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/pgsql/README`;
|
||||
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/install/mssql`;
|
||||
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/codesniffer`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/codetemplates`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/dbmodel`;
|
||||
@ -357,6 +430,7 @@ if ($nboftargetok) {
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/multicompany*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/nltechno*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/pos*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/test`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`;
|
||||
@ -370,6 +444,7 @@ if ($nboftargetok) {
|
||||
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/multiselect/MIT-LICENSE.txt`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/lib/Mail`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/samples`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/license.txt`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PDF`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PCLZip`;
|
||||
@ -379,7 +454,7 @@ if ($nboftargetok) {
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/LICENSE.TXT`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/savant`;
|
||||
}
|
||||
|
||||
|
||||
# Build package for each target
|
||||
#------------------------------
|
||||
foreach my $target (keys %CHOOSEDTARGET)
|
||||
@ -402,7 +477,6 @@ if ($nboftargetok) {
|
||||
$ret=`$cmd`;
|
||||
|
||||
print "Compress $BUILDROOT into $FILENAMESNAPSHOT.tgz...\n";
|
||||
#$cmd="tar --exclude \"$BUILDROOT/tgz/tar_exclude.txt\" --exclude .cache --exclude .settings --exclude conf.php --directory \"$BUILDROOT\" -czvf \"$FILENAMESNAPSHOT.tgz\" $FILENAMESNAPSHOT";
|
||||
$cmd="tar --exclude doli*.tgz --exclude doli*.deb --exclude doli*.exe --exclude doli*.xz --exclude doli*.zip --exclude doli*.rpm --exclude .cache --exclude .settings --exclude conf.php --exclude conf.php.mysql --exclude conf.php.old --exclude conf.php.postgres --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$FILENAMESNAPSHOT.tgz\" $FILENAMESNAPSHOT";
|
||||
print $cmd."\n";
|
||||
$ret=`$cmd`;
|
||||
@ -512,30 +586,15 @@ if ($nboftargetok) {
|
||||
mkdir($DESTI.'/'.$subdir);
|
||||
if (-d $DESTI.'/'.$subdir) { $NEWDESTI=$DESTI.'/'.$subdir; }
|
||||
|
||||
$ARCH='noarch';
|
||||
if ($RPMDIR eq "") { $RPMDIR=$ENV{'HOME'}."/rpmbuild"; }
|
||||
$newbuild = $BUILD;
|
||||
# For fedora
|
||||
$newbuild =~ s/(dev|alpha)/0.1.a/gi; # dev
|
||||
$newbuild =~ s/beta/0.2.beta1/gi; # beta
|
||||
$newbuild =~ s/rc./0.3.rc1/gi; # rc
|
||||
if ($newbuild !~ /-/) { $newbuild.='-0.3'; } # finale
|
||||
#$newbuild =~ s/(dev|alpha)/0/gi; # dev
|
||||
#$newbuild =~ s/beta/1/gi; # beta
|
||||
#$newbuild =~ s/rc./2/gi; # rc
|
||||
#if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale
|
||||
#print "newbuild=".$newbuild."\n";exit;
|
||||
$REL1 = $newbuild; $REL1 =~ s/-.*$//gi;
|
||||
if ($RPMSUBVERSION eq 'auto') { $RPMSUBVERSION = $newbuild; $RPMSUBVERSION =~ s/^.*-//gi; }
|
||||
print "Version is $MAJOR.$MINOR.$REL1-$RPMSUBVERSION\n";
|
||||
|
||||
$FILENAMETGZ2="$PROJECT-$MAJOR.$MINOR.$REL1";
|
||||
print "Version is $MAJOR.$MINOR.$REL1-$RPMSUBVERSION\n";
|
||||
|
||||
#print "Create directory $RPMDIR\n";
|
||||
#$ret=`mkdir -p "$RPMDIR"`;
|
||||
|
||||
print "Remove target ".$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm...\n";
|
||||
unlink("$NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm");
|
||||
print "Remove target ".$FILENAMERPM."...\n";
|
||||
unlink("$NEWDESTI/".$FILENAMERPM);
|
||||
print "Remove target ".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm...\n";
|
||||
unlink("$NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm");
|
||||
|
||||
@ -546,8 +605,8 @@ if ($nboftargetok) {
|
||||
$ret=`$cmd`;
|
||||
|
||||
# Set owners
|
||||
print "Set owners on files/dir\n";
|
||||
$ret=`chown -R root.root $BUILDROOT/$FILENAMETGZ2`;
|
||||
#print "Set owners on files/dir\n";
|
||||
#$ret=`chown -R root.root $BUILDROOT/$FILENAMETGZ2`;
|
||||
|
||||
print "Set permissions on files/dir\n";
|
||||
$ret=`chmod -R 755 $BUILDROOT/$FILENAMETGZ2`;
|
||||
@ -590,11 +649,9 @@ if ($nboftargetok) {
|
||||
|
||||
# Move to final dir
|
||||
print "Move $RPMDIR/RPMS/".$ARCH."/".$FILENAMETGZ2."-".$RPMSUBVERSION."*.".$ARCH.".rpm into $NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION."*.".$ARCH.".rpm\n";
|
||||
#$cmd="mv \"$RPMDIR/RPMS/".$ARCH."/".$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm\" \"$NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm\"";
|
||||
$cmd="mv $RPMDIR/RPMS/".$ARCH."/".$FILENAMETGZ2."-".$RPMSUBVERSION."*.".$ARCH.".rpm \"$NEWDESTI/\"";
|
||||
$ret=`$cmd`;
|
||||
print "Move $RPMDIR/SRPMS/".$FILENAMETGZ2."-".$RPMSUBVERSION."*.src.rpm into $NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION."*.src.rpm\n";
|
||||
#$cmd="mv \"$RPMDIR/SRPMS/".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm\" \"$NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm\"";
|
||||
$cmd="mv $RPMDIR/SRPMS/".$FILENAMETGZ2."-".$RPMSUBVERSION."*.src.rpm \"$NEWDESTI/\"";
|
||||
$ret=`$cmd`;
|
||||
print "Move $RPMDIR/SOURCES/".$FILENAMETGZ2.".tgz into $NEWDESTI/".$FILENAMETGZ2.".tgz\n";
|
||||
@ -611,21 +668,6 @@ if ($nboftargetok) {
|
||||
|
||||
$olddir=getcwd();
|
||||
|
||||
$newbuild = $BUILD;
|
||||
$newbuild =~ s/(dev|alpha)/1/gi; # dev
|
||||
$newbuild =~ s/beta/2/gi; # beta
|
||||
$newbuild =~ s/rc./3/gi; # rc
|
||||
if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale is same than rc
|
||||
# now newbuild is 0-1 or 0-3 for example
|
||||
print "Version is $MAJOR.$MINOR.$newbuild\n";
|
||||
$build = $newbuild;
|
||||
$build =~ s/-.*$//g;
|
||||
# now build is 0 for example
|
||||
# $build .= '+nmu1';
|
||||
# now build is 0+nmu1 for example
|
||||
|
||||
$FILENAMEDEB="${PROJECT}_${MAJOR}.${MINOR}.${newbuild}";
|
||||
|
||||
print "Remove target ${FILENAMEDEB}_all.deb...\n";
|
||||
unlink("$NEWDESTI/${FILENAMEDEB}_all.deb");
|
||||
print "Remove target ${FILENAMEDEB}.dsc...\n";
|
||||
@ -634,6 +676,10 @@ if ($nboftargetok) {
|
||||
unlink("$NEWDESTI/${FILENAMEDEB}.tar.gz");
|
||||
print "Remove target ${FILENAMEDEB}.changes...\n";
|
||||
unlink("$NEWDESTI/${FILENAMEDEB}.changes");
|
||||
print "Remove target ${FILENAMEDEB}.debian.tar.gz...\n";
|
||||
unlink("$NEWDESTI/${FILENAMEDEB}.debian.tar.gz");
|
||||
print "Remove target ${FILENAMEDEBNATIVE}.orig.tar.gz...\n";
|
||||
unlink("$NEWDESTI/${FILENAMEDEBNATIVE}.orig.tar.gz");
|
||||
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build`;
|
||||
@ -661,7 +707,7 @@ if ($nboftargetok) {
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/copyright`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.config`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.desktop`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.doc-base`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.docs`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.install`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.lintian-overrides`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.postrm`;
|
||||
@ -669,8 +715,9 @@ if ($nboftargetok) {
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.templates`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/dolibarr.templates.futur`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/rules`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/README.Debian`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/README.howto`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/wash`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/debian/watch`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/doap`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/exe`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/launchpad`;
|
||||
@ -679,12 +726,11 @@ if ($nboftargetok) {
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/perl`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/rpm`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/zip`;
|
||||
# We remove embedded libraries or fonts (this is also inside rules file, target clean)
|
||||
#$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor`;
|
||||
#$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/fonts`,
|
||||
#$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/geoip`;
|
||||
#$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/nusoap`;
|
||||
#$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/odtphp/zip/pclzip`;
|
||||
# Removed duplicate license files
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/LICENSE.md`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/plugins/scayt/LICENSE.md`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/plugins/wsc/LICENSE.md`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/jquery/plugins/flot/LICENSE.txt`;
|
||||
# Rename upstream changelog to match debian rules
|
||||
$ret=`mv $BUILDROOT/$PROJECT.tmp/ChangeLog $BUILDROOT/$PROJECT.tmp/changelog`;
|
||||
|
||||
@ -698,12 +744,12 @@ if ($nboftargetok) {
|
||||
$ret=`cp -f "$SOURCE/build/debian/control" "$BUILDROOT/$PROJECT.tmp/debian"`;
|
||||
$ret=`cp -f "$SOURCE/build/debian/copyright" "$BUILDROOT/$PROJECT.tmp/debian"`;
|
||||
$ret=`cp -f "$SOURCE/build/debian/dolibarr.desktop" "$BUILDROOT/$PROJECT.tmp/debian"`;
|
||||
$ret=`cp -f "$SOURCE/build/debian/dolibarr.doc-base" "$BUILDROOT/$PROJECT.tmp/debian"`;
|
||||
$ret=`cp -f "$SOURCE/build/debian/dolibarr.docs" "$BUILDROOT/$PROJECT.tmp/debian"`;
|
||||
$ret=`cp -f "$SOURCE/build/debian/dolibarr.install" "$BUILDROOT/$PROJECT.tmp/debian"`;
|
||||
$ret=`cp -f "$SOURCE/build/debian/dolibarr.lintian-overrides" "$BUILDROOT/$PROJECT.tmp/debian"`;
|
||||
$ret=`cp -f "$SOURCE/build/debian/dolibarr.xpm" "$BUILDROOT/$PROJECT.tmp/debian"`;
|
||||
$ret=`cp -f "$SOURCE/build/debian/README.source" "$BUILDROOT/$PROJECT.tmp/debian"`;
|
||||
$ret=`cp -f "$SOURCE/build/debian/rules" "$BUILDROOT/$PROJECT.tmp/debian"`;
|
||||
$ret=`cp -f "$SOURCE/build/debian/watch" "$BUILDROOT/$PROJECT.tmp/debian"`;
|
||||
$ret=`cp -fr "$SOURCE/build/debian/patches" "$BUILDROOT/$PROJECT.tmp/debian"`;
|
||||
$ret=`cp -fr "$SOURCE/build/debian/po" "$BUILDROOT/$PROJECT.tmp/debian"`;
|
||||
$ret=`cp -fr "$SOURCE/build/debian/source" "$BUILDROOT/$PROJECT.tmp/debian"`;
|
||||
@ -718,8 +764,9 @@ if ($nboftargetok) {
|
||||
$ret=`cp -f "$SOURCE/build/debian/install.forced.php.install" "$BUILDROOT/$PROJECT.tmp/debian"`;
|
||||
|
||||
# Set owners and permissions
|
||||
print "Set owners on files/dir\n";
|
||||
$ret=`chown -R root.root $BUILDROOT/$PROJECT.tmp`;
|
||||
#print "Set owners on files/dir\n";
|
||||
#$ret=`chown -R root.root $BUILDROOT/$PROJECT.tmp`;
|
||||
|
||||
print "Set permissions on files/dir\n";
|
||||
$ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp`;
|
||||
$cmd="find $BUILDROOT/$PROJECT.tmp -type f -exec chmod 644 {} \\; ";
|
||||
@ -748,6 +795,16 @@ if ($nboftargetok) {
|
||||
$cmd="mv $BUILDROOT/$PROJECT.tmp $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build";
|
||||
$ret=`$cmd`;
|
||||
|
||||
|
||||
print "Go into directory $BUILDROOT\n";
|
||||
chdir("$BUILDROOT");
|
||||
|
||||
# We need a tarball to be able to build "quilt" debian package (not required for native but we need patch so it is not a native)
|
||||
print "Compress $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build into $BUILDROOT/$FILENAMEDEBNATIVE.orig.tar.gz...\n";
|
||||
$cmd="tar --exclude-vcs --exclude-from \"$BUILDROOT/$PROJECT/build/tgz/tar_exclude.txt\" --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$BUILDROOT/$FILENAMEDEBNATIVE.orig.tar.gz\" $PROJECT-$MAJOR.$MINOR.$build";
|
||||
print $cmd."\n";
|
||||
$ret=`$cmd`;
|
||||
|
||||
# Creation of source package
|
||||
print "Go into directory $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build\n";
|
||||
chdir("$BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build");
|
||||
@ -759,13 +816,15 @@ if ($nboftargetok) {
|
||||
|
||||
chdir("$olddir");
|
||||
|
||||
print "You can check package with lintian --pedantic -E -I \"$NEWDESTI/${FILENAMEDEB}_all.deb\"\n";
|
||||
print "You can check bin package with lintian --pedantic -E -I \"$NEWDESTI/${FILENAMEDEB}_all.deb\"\n";
|
||||
print "You can check src package with lintian --pedantic -E -I \"$NEWDESTI/${FILENAMEDEB}.dsc\"\n";
|
||||
|
||||
# Move to final dir
|
||||
print "Move *_all.deb to $NEWDESTI\n";
|
||||
print "Move *_all.deb *.dsc *.orig.tar.gz *.changes to $NEWDESTI\n";
|
||||
$ret=`mv $BUILDROOT/*_all.deb "$NEWDESTI/"`;
|
||||
$ret=`mv $BUILDROOT/*.dsc "$NEWDESTI/"`;
|
||||
$ret=`mv $BUILDROOT/*.tar.gz "$NEWDESTI/"`;
|
||||
$ret=`mv $BUILDROOT/*.orig.tar.gz "$NEWDESTI/"`;
|
||||
$ret=`mv $BUILDROOT/*.debian.tar.gz "$NEWDESTI/"`;
|
||||
$ret=`mv $BUILDROOT/*.changes "$NEWDESTI/"`;
|
||||
next;
|
||||
}
|
||||
@ -880,6 +939,81 @@ if ($nboftargetok) {
|
||||
next;
|
||||
}
|
||||
}
|
||||
|
||||
# Build package for each target
|
||||
#------------------------------
|
||||
foreach my $target (keys %CHOOSEDPUBLISH)
|
||||
{
|
||||
if ($CHOOSEDPUBLISH{$target} < 0) { next; }
|
||||
|
||||
print "\nList of files to publish\n";
|
||||
%filestoscan=(
|
||||
"$DESTI/package_rpm_generic/$FILENAMERPM"=>'Dolibarr installer for Fedora-Redhat-Mandriva-Opensuse (DoliRpm)',
|
||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb"=>'Dolibarr installer for Debian-Ubuntu (DoliDeb)',
|
||||
"$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'Dolibarr installer for Windows (DoliWamp)',
|
||||
"$DESTI/standard/$FILENAMETGZ.tgz"=>'Dolibarr ERP-CRM',
|
||||
"$DESTI/standard/$FILENAMETGZ.zip"=>'Dolibarr ERP-CRM'
|
||||
);
|
||||
foreach my $file (sort keys %filestoscan)
|
||||
{
|
||||
$found=0;
|
||||
my $filesize = -s $file;
|
||||
print $file." ".($filesize?"(found)":"(not found)");
|
||||
print ($filesize?" - ".$filesize:"");
|
||||
print "\n";
|
||||
}
|
||||
|
||||
if ($target eq 'SF')
|
||||
{
|
||||
print "\n";
|
||||
|
||||
$NEWPUBLISH=$PUBLISH;
|
||||
print "Publish to target $NEWPUBLISH. Click enter or CTRL+C...\n";
|
||||
|
||||
# Ask which target to build
|
||||
$NUM_SCRIPT=<STDIN>;
|
||||
chomp($NUM_SCRIPT);
|
||||
|
||||
print "Create empty dir /tmp/emptydir. We need it to create target dir using rsync.\n";
|
||||
$ret=`mkdir -p "/tmp/emptydir/"`;
|
||||
|
||||
foreach my $file (sort keys %filestoscan)
|
||||
{
|
||||
$found=0;
|
||||
my $filesize = -s $file;
|
||||
if (! $filesize) { next; }
|
||||
|
||||
print "\n";
|
||||
print "Publish file ".$file." to ".$filestoscan{$file}."\n";
|
||||
|
||||
$destFolder="$NEWPUBLISH/$filestoscan{$file}/".$MAJOR.'.'.$MINOR.'.'.$BUILD;
|
||||
|
||||
# mkdir
|
||||
#my $ssh = Net::SSH::Perl->new("frs.sourceforge.net");
|
||||
#$ssh->login("$user","$pass");
|
||||
#use String::ShellQuote qw( shell_quote );
|
||||
#$ssh->cmd('mkdir '.shell_quote($destFolder).' && exit');
|
||||
|
||||
#use Net::SFTP::Foreign;
|
||||
#my $sftp = Net::SFTP::Foreign->new($ip, user => $user, password => $pass, autodie => 1);
|
||||
#$sftp->mkdir($destFolder)
|
||||
|
||||
#$command="ssh eldy,dolibarr\@frs.sourceforge.net mkdir -p \"$destFolder\"";
|
||||
#print "$command\n";
|
||||
#my $ret=`$command 2>&1`;
|
||||
$command="rsync -s -e 'ssh' --recursive /tmp/emptydir/ \"".$destFolder."\"";
|
||||
print "$command\n";
|
||||
my $ret=`$command 2>&1`;
|
||||
|
||||
$command="rsync -s $OPTIONUPDATEDIST -e 'ssh' \"$file\" \"".$destFolder."\"";
|
||||
print "$command\n";
|
||||
my $ret=`$command 2>&1`;
|
||||
print "$ret\n";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print "\n----- Summary -----\n";
|
||||
|
||||
@ -10,7 +10,6 @@ beta version of Dolibarr, step by step.
|
||||
- Check all files are commited.
|
||||
- Update version/info in /ChangeLog
|
||||
- Update version number with x.y.z-w in htdocs/filefunc.inc.php
|
||||
- Update version number with x.y.z-w in build/makepack-dolibarr.pl
|
||||
- Update version number with x.y.z-w in build/debian/changelog
|
||||
- Update version number with x.y.z-w in build/exe/doliwamp/doliwamp.iss
|
||||
- Update version number with x.y.z-w in build/rpm/*.spec
|
||||
@ -34,7 +33,6 @@ complete release of Dolibarr, step by step.
|
||||
- Check all files are commited.
|
||||
- Update version/info in ChangeLog
|
||||
- Update version number with x.y.z in htdocs/filefunc.inc.php
|
||||
- Update version number with x.y.z in build/makepack-dolibarr.pl
|
||||
- Update version number with x.y.z in build/debian/changelog
|
||||
- Update version number with x.y.z in build/exe/doliwamp/doliwamp.iss
|
||||
- Update version number with x.y.z in build/rpm/*.spec
|
||||
|
||||
@ -30,7 +30,7 @@ return "Regis Houssin";
|
||||
# script_dolibarr_versions()
|
||||
sub script_dolibarr_versions
|
||||
{
|
||||
return ( "3.6.0", "3.5.1", "3.5.0", "3.4.1", "3.4.0", "3.3.3", "3.3.2", "3.3.1", "3.3.0", "3.2.1", "3.1.1" );
|
||||
return ( "3.6.0", "3.5.2", "3.5.1", "3.5.0", "3.4.1", "3.4.0", "3.3.3", "3.3.2", "3.3.1", "3.3.0", "3.2.1", "3.1.1" );
|
||||
}
|
||||
|
||||
sub script_dolibarr_category
|
||||
|
||||
@ -334,5 +334,11 @@ fi
|
||||
* Fri Feb 7 2014 Laurent Destailleur 3.6.0-0.2.b
|
||||
- Upstream release
|
||||
|
||||
* Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3
|
||||
- Upstream release
|
||||
|
||||
* Fri Feb 7 2014 Laurent Destailleur 3.5.1-0.3
|
||||
- Upstream release
|
||||
|
||||
* Mon Dec 30 2013 Laurent Destailleur 3.5.0-0.3
|
||||
- Initial version (#723326)
|
||||
|
||||
@ -562,5 +562,11 @@ fi
|
||||
* Mon Feb 7 2014 Laurent Destailleur 3.6.0-0.2.b
|
||||
- Upstream release
|
||||
|
||||
* Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3
|
||||
- Upstream release
|
||||
|
||||
* Fri Feb 7 2014 Laurent Destailleur 3.5.1-0.3
|
||||
- Upstream release
|
||||
|
||||
* Mon Dec 30 2013 Laurent Destailleur 3.5.0-0.3
|
||||
- Initial version (#723326)
|
||||
|
||||
@ -339,5 +339,11 @@ fi
|
||||
* Mon Feb 7 2014 Laurent Destailleur 3.6.0-0.2.b
|
||||
- Upstream release
|
||||
|
||||
* Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3
|
||||
- Upstream release
|
||||
|
||||
* Fri Feb 7 2014 Laurent Destailleur 3.5.1-0.3
|
||||
- Upstream release
|
||||
|
||||
* Mon Dec 30 2013 Laurent Destailleur 3.5.0-0.3
|
||||
- Initial version (#723326)
|
||||
|
||||
@ -349,5 +349,11 @@ fi
|
||||
* Mon Feb 7 2014 Laurent Destailleur 3.6.0-0.2.b
|
||||
- Upstream release
|
||||
|
||||
* Fri Feb 14 2014 Laurent Destailleur 3.5.2-0.3
|
||||
- Upstream release
|
||||
|
||||
* Fri Feb 7 2014 Laurent Destailleur 3.5.1-0.3
|
||||
- Upstream release
|
||||
|
||||
* Mon Dec 30 2013 Laurent Destailleur 3.5.0-0.3
|
||||
- Initial version (#723326)
|
||||
|
||||
@ -1,3 +1,6 @@
|
||||
*~
|
||||
.#*
|
||||
Thumbs.db
|
||||
build/exe
|
||||
build/html
|
||||
dev/dbmodel
|
||||
@ -7,58 +10,10 @@ dev/initdata
|
||||
dev/iso-normes
|
||||
dev/licence
|
||||
dev/load
|
||||
dev/skeletons/*socpeople*
|
||||
dev/spec
|
||||
dev/test
|
||||
dev/uml
|
||||
dev/xdebug
|
||||
doc/dev/dolibarr-phpdoc
|
||||
doc/dev/barcode
|
||||
doc/dev/compta
|
||||
doc/dev/dbmodel
|
||||
doc/dev/normes
|
||||
doc/dev/html
|
||||
doc/dev/iso-normes
|
||||
doc/flyer
|
||||
doc/font
|
||||
doc/rollup
|
||||
doc/tshirts
|
||||
doc/wiki
|
||||
document
|
||||
documents
|
||||
htdocs/conf/conf.php
|
||||
htdocs/conf/conf.php.mysql
|
||||
htdocs/conf/conf.php.old
|
||||
htdocs/conf/conf.php.postgres
|
||||
htdocs/avoir
|
||||
htdocs/custom
|
||||
htdocs/custom2
|
||||
htdocs/customleave
|
||||
htdocs/customgoogle
|
||||
htdocs/document
|
||||
htdocs/documents
|
||||
htdocs/includes/fckeditor/_samples
|
||||
htdocs/includes/fckeditor/_testcases
|
||||
htdocs/includes/nusoap/samples
|
||||
htdocs/includes/tcpdf/fonts/utils
|
||||
htdocs/includes/tcpdf/fonts/free*.ctg.z
|
||||
htdocs/includes/tcpdf/fonts/free*.z
|
||||
mssql
|
||||
test
|
||||
CVS
|
||||
*~
|
||||
.#*
|
||||
.buildpath
|
||||
.cache
|
||||
.cvsignore
|
||||
.gitignore
|
||||
.externalToolBuilders
|
||||
.htaccess
|
||||
.settings
|
||||
.project
|
||||
.travis.yml
|
||||
Thumbs.db
|
||||
data_dev.sql
|
||||
doli*.tar.gz
|
||||
doli*.tgz
|
||||
doli*.exe
|
||||
@ -66,5 +21,4 @@ doli*.rpm
|
||||
doli*.deb
|
||||
doli*.zip
|
||||
cvschangelogbuilder_dolibarr*
|
||||
doxygen_warnings.log
|
||||
dolibarr_install.log
|
||||
@ -1,65 +1,19 @@
|
||||
*/build
|
||||
*~
|
||||
*.#*
|
||||
Thumbs.db
|
||||
*/build/exe
|
||||
*/build/html
|
||||
*/dev/dbmodel/*
|
||||
*/dev/fpdf/*
|
||||
*/dev/initdemo/*
|
||||
*/dev/initdata/*
|
||||
*/dev/iso-normes/*
|
||||
*/dev/licence/*
|
||||
*/dev/load/*
|
||||
*/dev/test/*
|
||||
*/dev/uml/*
|
||||
*/dev/xdebug/*
|
||||
*/doc/dev/dolibarr-phpdoc/*
|
||||
*/doc/dev/barcode/*
|
||||
*/doc/dev/compta/*
|
||||
*/doc/dev/dbmodel/*
|
||||
*/doc/dev/normes/*
|
||||
*/doc/dev/html/*
|
||||
*/doc/dev/iso-normes/*
|
||||
*/doc/flyer/*
|
||||
*/doc/font/*
|
||||
*/doc/rollup/*
|
||||
*/doc/tshirt/*
|
||||
*/doc/wiki/*
|
||||
*/document/*
|
||||
*/documents/*
|
||||
*/htdocs/avoir/*
|
||||
*/htdocs/conf/conf.php
|
||||
*/htdocs/conf/conf.php.mysql
|
||||
*/htdocs/conf/conf.php.old
|
||||
*/htdocs/conf/conf.php.postgres
|
||||
*/htdocs/custom/*
|
||||
*/htdocs/custom2/*
|
||||
*/htdocs/document/*
|
||||
*/htdocs/documents/*
|
||||
*/htdocs/includes/ckeditor/_source
|
||||
*/htdocs/includes/ckeditor/*_source.js
|
||||
*/htdocs/includes/fckeditor/_samples/*
|
||||
*/htdocs/includes/fckeditor/_testcases/*
|
||||
*/htdocs/includes/nusoap/samples/*
|
||||
*/htdocs/includes/phplot5/doc/*
|
||||
*/htdocs/includes/phplot5/examples/*
|
||||
*/htdocs/includes/scriptaculous/test/*
|
||||
*/htdocs/includes/treemenu/docs/*
|
||||
*/htdocs/includes/treemenu/images/*
|
||||
*/htdocs/includes/treemenu/imagesAlt/*
|
||||
*/htdocs/includes/treemenu/imagesAlt2/*
|
||||
*/htdocs/includes/tcpdf/fonts/utils/*
|
||||
*/htdocs/includes/tcpdf/fonts/free*.ctg.z
|
||||
*/htdocs/includes/tcpdf/fonts/free*.z
|
||||
*/test
|
||||
*/CVS/*
|
||||
*~
|
||||
*.#*
|
||||
*.buildpath*
|
||||
*.cache*
|
||||
*.cvsignore*
|
||||
*.gitignore*
|
||||
*.htaccess*
|
||||
*.settings*
|
||||
*.project*
|
||||
*.travis.yml*
|
||||
Thumbs.db
|
||||
data_dev.sql
|
||||
dolibarr*.tar.gz
|
||||
dolibarr*.tgz
|
||||
dolibarr*.exe
|
||||
@ -67,5 +21,4 @@ dolibarr*.rpm
|
||||
dolibarr*.deb
|
||||
dolibarr*.zip
|
||||
cvschangelogbuilder_dolibarr*
|
||||
doxygen_warnings.log
|
||||
dolibarr_install.log
|
||||
@ -39,6 +39,11 @@ into
|
||||
// initialize subsetchars
|
||||
$subsetchars = array_fill(0, 256, true);
|
||||
|
||||
* Made freemono the default monotype font because we removed courier
|
||||
In htdocs/includes/tcpdf/tcpdf.php
|
||||
- protected $default_monospaced_font = 'courier';
|
||||
+ protected $default_monospaced_font = 'freemono';
|
||||
|
||||
|
||||
JSGANTT:
|
||||
--------
|
||||
|
||||
@ -16,13 +16,14 @@ fi
|
||||
# To detec
|
||||
if [ "x$1" = "xlist" ]
|
||||
then
|
||||
find . \( -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.txt" \) -exec file "{}" + | grep -v 'htdocs\/includes' | grep CRLF
|
||||
find . \( -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.txt" \) -exec file "{}" + | grep CRLF
|
||||
# find . \( -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.txt" \) -exec file "{}" + | grep -v 'htdocs\/includes' | grep CRLF
|
||||
fi
|
||||
|
||||
# To convert
|
||||
if [ "x$1" = "xfix" ]
|
||||
then
|
||||
for fic in `find . \( -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.txt" \) -exec file "{}" + | grep -v 'htdocs\/includes' | grep CRLF | awk -F':' '{ print $1 }' `
|
||||
for fic in `find . \( -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.txt" \) -exec file "{}" + | grep CRLF | awk -F':' '{ print $1 }' `
|
||||
do
|
||||
echo "Fix file $fic"
|
||||
dos2unix $fic
|
||||
|
||||
7293
dev/initdata/mysqldump_dolibarr_3.6.0.sql
Normal file
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/php
|
||||
<?php
|
||||
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2008-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -50,12 +50,18 @@ print "***** $script_file ($version) *****\n";
|
||||
// -------------------- START OF BUILD_CLASS_FROM_TABLE SCRIPT --------------------
|
||||
|
||||
// Check parameters
|
||||
if (! isset($argv[1]))
|
||||
if (! isset($argv[1]) || (isset($argv[2]) && ! isset($argv[6])))
|
||||
{
|
||||
print "Usage: $script_file tablename\n";
|
||||
print "Usage: $script_file tablename [server port databasename user pass]\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($argv[2]) && isset($argv[3]) && isset($argv[4]) && isset($argv[5]) && isset($argv[6]))
|
||||
{
|
||||
print 'Use specific database ids'."\n";
|
||||
$db=getDoliDBInstance('mysqli',$argv[2],$argv[5],$argv[6],$argv[4],$argv[3]);
|
||||
}
|
||||
|
||||
if ($db->type != 'mysql' && $db->type != 'mysqli')
|
||||
{
|
||||
print "Error: This script works with mysql or mysqli driver only\n";
|
||||
@ -184,7 +190,7 @@ $varprop="\n";
|
||||
$cleanparam='';
|
||||
foreach($property as $key => $prop)
|
||||
{
|
||||
if ($prop['field'] != 'rowid')
|
||||
if ($prop['field'] != 'rowid' && $prop['field'] != 'id')
|
||||
{
|
||||
$varprop.="\tvar \$".$prop['field'];
|
||||
if ($prop['istime']) $varprop.="=''";
|
||||
@ -201,7 +207,7 @@ $varprop="\n";
|
||||
$cleanparam='';
|
||||
foreach($property as $key => $prop)
|
||||
{
|
||||
if ($prop['field'] != 'rowid' && ! $prop['istime'])
|
||||
if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime'])
|
||||
{
|
||||
$varprop.="\t\tif (isset(\$this->".$prop['field'].")) \$this->".$prop['field']."=trim(\$this->".$prop['field'].");";
|
||||
$varprop.="\n";
|
||||
@ -283,7 +289,7 @@ $i=0;
|
||||
foreach($property as $key => $prop)
|
||||
{
|
||||
$i++;
|
||||
if ($prop['field'] != 'rowid')
|
||||
if ($prop['field'] != 'rowid' && $prop['field'] != 'id')
|
||||
{
|
||||
$varprop.="\t\t\$sql.= \" ";
|
||||
$varprop.=$prop['field'].'=';
|
||||
@ -324,7 +330,7 @@ $i=0;
|
||||
foreach($property as $key => $prop)
|
||||
{
|
||||
$i++;
|
||||
if ($prop['field'] != 'rowid')
|
||||
if ($prop['field'] != 'rowid' && $prop['field'] != 'id')
|
||||
{
|
||||
$varprop.="\t\t\t\t\$this->".$prop['field']." = ";
|
||||
if ($prop['istime']) $varprop.='$this->db->jdate(';
|
||||
@ -343,7 +349,7 @@ $varprop="\n";
|
||||
$cleanparam='';
|
||||
foreach($property as $key => $prop)
|
||||
{
|
||||
if ($prop['field'] != 'rowid')
|
||||
if ($prop['field'] != 'rowid' && $prop['field'] != 'id')
|
||||
{
|
||||
$varprop.="\t\t\$this->".$prop['field']."='';";
|
||||
$varprop.="\n";
|
||||
@ -462,6 +468,6 @@ else $error++;
|
||||
|
||||
// -------------------- END OF BUILD_CLASS_FROM_TABLE SCRIPT --------------------
|
||||
|
||||
print "You can now rename generated files by removing the 'out.' prefix in their name and store them in a directory of your choice.\n";
|
||||
print "You can now rename generated files by removing the 'out.' prefix in their name and store them into directory /yourmodule/class.\n";
|
||||
return $error;
|
||||
?>
|
||||
|
||||
@ -28,13 +28,13 @@ That's all you need to do. It will build a brand new VirtalBox machine for you w
|
||||
### Name resolution
|
||||
For easy access to the VM you need to setup name resolution to the machines IP.
|
||||
|
||||
Edit the [hosts](https://fr.wikipedia.org/wiki/Hosts) file on the machine you run Vagrant on to map the virtual machine's IP to it's Vhost name.
|
||||
Edit the [hosts](https://en.wikipedia.org/wiki/Hosts_(file)) file on the machine you run Vagrant on to map the virtual machine's IP to it's Vhost name.
|
||||
|
||||
Example syntax:
|
||||
|
||||
192.168.42.101 dev.dolibarr.org
|
||||
|
||||
Once this is done, you will be able to access your VM's service at <http://dolibarr.dev>
|
||||
Once this is done, you will be able to access your VM's service at <http://dev.dolibarr.org>
|
||||
|
||||
Available boxes
|
||||
---------------
|
||||
@ -58,3 +58,5 @@ Somewhat bleeding edge vagrant box for develop branch related work.
|
||||
- Debugger: XDebug
|
||||
- Profiler: Xhprof
|
||||
- phpMyAdmin: <http://192.168.42.101/phpmyadmin>
|
||||
|
||||
You can access MailCatcher to read all outgoing emails at http://192.168.42.101:1080
|
||||
|
||||
114
dev/vagrant/dolibarrdev/Vagrantfile
vendored
@ -1,42 +1,100 @@
|
||||
require 'yaml'
|
||||
|
||||
dir = File.dirname(File.expand_path(__FILE__))
|
||||
|
||||
configValues = YAML.load_file("#{dir}/puphpet/config.yaml")
|
||||
data = configValues['vagrantfile-local']
|
||||
|
||||
Vagrant.configure("2") do |config|
|
||||
config.vm.box = "debian-wheezy72-x64-vbox43"
|
||||
config.vm.box_url = "https://puphpet.s3.amazonaws.com/debian-wheezy72-x64-vbox43.box"
|
||||
config.vm.box = "#{data['vm']['box']}"
|
||||
config.vm.box_url = "#{data['vm']['box_url']}"
|
||||
|
||||
config.vm.network "private_network", ip: "192.168.42.101"
|
||||
|
||||
|
||||
config.vm.synced_folder "../../../", "/var/www", id: "vagrant-root", :nfs => false, owner: "www-data", group: "www-data"
|
||||
|
||||
config.vm.usable_port_range = (2200..2250)
|
||||
config.vm.provider :virtualbox do |virtualbox|
|
||||
virtualbox.customize ["modifyvm", :id, "--name", "dolibarrdev"]
|
||||
virtualbox.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
|
||||
virtualbox.customize ["modifyvm", :id, "--memory", "512"]
|
||||
virtualbox.customize ["setextradata", :id, "--VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"]
|
||||
if data['vm']['hostname'].to_s != ''
|
||||
config.vm.hostname = "#{data['vm']['hostname']}"
|
||||
end
|
||||
|
||||
config.vm.provision :shell, :path => "shell/initial-setup.sh"
|
||||
config.vm.provision :shell, :path => "shell/update-puppet.sh"
|
||||
config.vm.provision :shell, :path => "shell/librarian-puppet-vagrant.sh"
|
||||
if data['vm']['network']['private_network'].to_s != ''
|
||||
config.vm.network "private_network", ip: "#{data['vm']['network']['private_network']}"
|
||||
end
|
||||
|
||||
data['vm']['network']['forwarded_port'].each do |i, port|
|
||||
if port['guest'] != '' && port['host'] != ''
|
||||
config.vm.network :forwarded_port, guest: port['guest'].to_i, host: port['host'].to_i
|
||||
end
|
||||
end
|
||||
|
||||
data['vm']['synced_folder'].each do |i, folder|
|
||||
if folder['source'] != '' && folder['target'] != '' && folder['id'] != ''
|
||||
nfs = (folder['nfs'] == "true") ? "nfs" : nil
|
||||
config.vm.synced_folder "#{folder['source']}", "#{folder['target']}", id: "#{folder['id']}", type: nfs
|
||||
end
|
||||
end
|
||||
|
||||
config.vm.usable_port_range = (10200..10500)
|
||||
|
||||
if !data['vm']['provider']['virtualbox'].empty?
|
||||
config.vm.provider :virtualbox do |virtualbox|
|
||||
data['vm']['provider']['virtualbox']['modifyvm'].each do |key, value|
|
||||
if key == "natdnshostresolver1"
|
||||
value = value ? "on" : "off"
|
||||
end
|
||||
virtualbox.customize ["modifyvm", :id, "--#{key}", "#{value}"]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
config.vm.provision "shell" do |s|
|
||||
s.path = "puphpet/shell/initial-setup.sh"
|
||||
s.args = "/vagrant/puphpet"
|
||||
end
|
||||
config.vm.provision :shell, :path => "puphpet/shell/update-puppet.sh"
|
||||
config.vm.provision :shell, :path => "puphpet/shell/librarian-puppet-vagrant.sh"
|
||||
|
||||
config.vm.provision :puppet do |puppet|
|
||||
ssh_username = !data['ssh']['username'].nil? ? data['ssh']['username'] : "vagrant"
|
||||
puppet.facter = {
|
||||
"ssh_username" => "vagrant"
|
||||
"ssh_username" => "#{ssh_username}"
|
||||
}
|
||||
puppet.manifests_path = "#{data['vm']['provision']['puppet']['manifests_path']}"
|
||||
puppet.manifest_file = "#{data['vm']['provision']['puppet']['manifest_file']}"
|
||||
|
||||
puppet.manifests_path = "puppet/manifests"
|
||||
puppet.options = ["--verbose", "--hiera_config /vagrant/hiera.yaml", "--parser future"]
|
||||
if !data['vm']['provision']['puppet']['options'].empty?
|
||||
puppet.options = data['vm']['provision']['puppet']['options']
|
||||
end
|
||||
end
|
||||
|
||||
config.vm.provision :shell, :path => "puphpet/shell/execute-files.sh"
|
||||
|
||||
if !data['ssh']['host'].nil?
|
||||
config.ssh.host = "#{data['ssh']['host']}"
|
||||
end
|
||||
if !data['ssh']['port'].nil?
|
||||
config.ssh.port = "#{data['ssh']['port']}"
|
||||
end
|
||||
if !data['ssh']['private_key_path'].nil?
|
||||
config.ssh.private_key_path = "#{data['ssh']['private_key_path']}"
|
||||
end
|
||||
if !data['ssh']['username'].nil?
|
||||
config.ssh.username = "#{data['ssh']['username']}"
|
||||
end
|
||||
if !data['ssh']['guest_port'].nil?
|
||||
config.ssh.guest_port = data['ssh']['guest_port']
|
||||
end
|
||||
if !data['ssh']['shell'].nil?
|
||||
config.ssh.shell = "#{data['ssh']['shell']}"
|
||||
end
|
||||
if !data['ssh']['keep_alive'].nil?
|
||||
config.ssh.keep_alive = data['ssh']['keep_alive']
|
||||
end
|
||||
if !data['ssh']['forward_agent'].nil?
|
||||
config.ssh.forward_agent = data['ssh']['forward_agent']
|
||||
end
|
||||
if !data['ssh']['forward_x11'].nil?
|
||||
config.ssh.forward_x11 = data['ssh']['forward_x11']
|
||||
end
|
||||
if !data['vagrant']['host'].nil?
|
||||
config.vagrant.host = data['vagrant']['host'].gsub(":", "").intern
|
||||
end
|
||||
|
||||
|
||||
config.ssh.username = "vagrant"
|
||||
|
||||
config.ssh.shell = "bash -l"
|
||||
|
||||
config.ssh.keep_alive = true
|
||||
config.ssh.forward_agent = false
|
||||
config.ssh.forward_x11 = false
|
||||
config.vagrant.host = :detect
|
||||
end
|
||||
|
||||
|
||||
@ -1,7 +0,0 @@
|
||||
---
|
||||
:backends: yaml
|
||||
:yaml:
|
||||
:datadir: '/vagrant/puppet/hieradata'
|
||||
:hierarchy:
|
||||
- common
|
||||
:logger: console
|
||||
157
dev/vagrant/dolibarrdev/puphpet/config.yaml
vendored
Normal file
@ -0,0 +1,157 @@
|
||||
---
|
||||
vagrantfile-local:
|
||||
vm:
|
||||
box: debian-wheezy72-x64-vbox43
|
||||
box_url: 'http://box.puphpet.com/debian-wheezy72-x64-vbox43.box'
|
||||
hostname: null
|
||||
network:
|
||||
private_network: 192.168.42.101
|
||||
forwarded_port:
|
||||
jHkzZVuBoVtG:
|
||||
host: '9252'
|
||||
guest: '22'
|
||||
provider:
|
||||
virtualbox:
|
||||
modifyvm:
|
||||
natdnshostresolver1: on
|
||||
memory: '512'
|
||||
setextradata:
|
||||
VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root: 1
|
||||
provision:
|
||||
puppet:
|
||||
manifests_path: puphpet/puppet
|
||||
manifest_file: manifest.pp
|
||||
options:
|
||||
- '--verbose'
|
||||
- '--hiera_config /vagrant/puphpet/puppet/hiera.yaml'
|
||||
- '--parser future'
|
||||
synced_folder:
|
||||
vMRGvEXBrASV:
|
||||
id: vagrant-root
|
||||
source: ../../../
|
||||
target: /var/www
|
||||
nfs: 'false'
|
||||
usable_port_range: 2200..2250
|
||||
ssh:
|
||||
host: null
|
||||
port: null
|
||||
private_key_path: null
|
||||
username: vagrant
|
||||
guest_port: null
|
||||
keep_alive: true
|
||||
forward_agent: false
|
||||
forward_x11: false
|
||||
shell: 'bash -l'
|
||||
vagrant:
|
||||
host: detect
|
||||
server:
|
||||
packages:
|
||||
- nano
|
||||
- ack-grep
|
||||
dot_files:
|
||||
-
|
||||
bash_aliases: null
|
||||
_prevent_empty: ''
|
||||
mailcatcher:
|
||||
install: '1'
|
||||
settings:
|
||||
smtp_ip: 0.0.0.0
|
||||
smtp_port: 1025
|
||||
http_ip: 0.0.0.0
|
||||
http_port: '1080'
|
||||
path: /usr/local/bin
|
||||
log: /var/log/mailcatcher/mailcatcher.log
|
||||
apache:
|
||||
modules:
|
||||
- php
|
||||
- rewrite
|
||||
vhosts:
|
||||
fIrYPRDORtSV:
|
||||
servername: dev.dolibarr.org
|
||||
docroot: /var/www/htdocs
|
||||
port: '80'
|
||||
setenv:
|
||||
- 'APP_ENV dev'
|
||||
override:
|
||||
- All
|
||||
user: www-data
|
||||
group: www-data
|
||||
default_vhost: true
|
||||
mod_pagespeed: 0
|
||||
mod_spdy: 0
|
||||
php:
|
||||
install: '1'
|
||||
version: '55'
|
||||
composer: '1'
|
||||
modules:
|
||||
php:
|
||||
- cli
|
||||
- curl
|
||||
- gd
|
||||
- imagick
|
||||
- intl
|
||||
- mcrypt
|
||||
pear: { }
|
||||
pecl: { }
|
||||
ini:
|
||||
display_errors: On
|
||||
error_reporting: '-1'
|
||||
session.save_path: /var/lib/php/session
|
||||
sendmail_path: '"/usr/bin/env catchmail"'
|
||||
timezone: UTC
|
||||
xdebug:
|
||||
install: '1'
|
||||
settings:
|
||||
xdebug.default_enable: '1'
|
||||
xdebug.remote_autostart: '0'
|
||||
xdebug.remote_connect_back: '1'
|
||||
xdebug.remote_enable: '1'
|
||||
xdebug.remote_handler: dbgp
|
||||
xdebug.remote_port: '9000'
|
||||
xhprof:
|
||||
install: '1'
|
||||
drush:
|
||||
install: 0
|
||||
settings:
|
||||
drush.tag_branch: 6.x
|
||||
mysql:
|
||||
root_password: root
|
||||
phpmyadmin: '1'
|
||||
adminer: 0
|
||||
databases:
|
||||
K7xpd6KqfK3E:
|
||||
grant:
|
||||
- ALTER
|
||||
- CREATE
|
||||
- DELETE
|
||||
- DROP
|
||||
- INDEX
|
||||
- INSERT
|
||||
- SELECT
|
||||
- UPDATE
|
||||
name: dolibarr
|
||||
host: localhost
|
||||
user: user
|
||||
password: user
|
||||
sql_file: /var/www/dev/initdata/mysqldump_dolibarr_3.5.0.sql
|
||||
mongodb:
|
||||
install: 0
|
||||
auth: 1
|
||||
port: '27017'
|
||||
databases: { }
|
||||
beanstalkd:
|
||||
install: 0
|
||||
settings:
|
||||
listenaddress: 0.0.0.0
|
||||
listenport: '13000'
|
||||
maxjobsize: '65535'
|
||||
maxconnections: '1024'
|
||||
binlogdir: /var/lib/beanstalkd/binlog
|
||||
binlogfsync: null
|
||||
binlogsize: '10485760'
|
||||
beanstalk_console: 0
|
||||
binlogdir: /var/lib/beanstalkd/binlog
|
||||
rabbitmq:
|
||||
install: 0
|
||||
port: '5672'
|
||||
|
||||
0
dev/vagrant/dolibarrdev/puphpet/files/exec-always/empty
vendored
Normal file
0
dev/vagrant/dolibarrdev/puphpet/files/exec-once/empty
vendored
Normal file
19
dev/vagrant/dolibarrdev/puphpet/puppet/Puppetfile
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
forge "http://forge.puppetlabs.com"
|
||||
mod 'stdlib', :git => 'https://github.com/puphpet/puppetlabs-stdlib.git'
|
||||
mod 'concat', :git => 'https://github.com/puphpet/puppetlabs-concat.git'
|
||||
mod 'apt', :git => 'https://github.com/puphpet/puppetlabs-apt.git'
|
||||
mod 'yum', :git => 'https://github.com/puphpet/puppet-yum.git'
|
||||
mod 'vcsrepo', :git => 'https://github.com/puphpet/puppetlabs-vcsrepo.git'
|
||||
mod 'ntp', :git => 'https://github.com/puphpet/puppetlabs-ntp.git'
|
||||
mod 'iptables', :git => 'https://github.com/puphpet/puppet-iptables.git'
|
||||
mod 'mailcatcher', :git => 'https://github.com/puphpet/puppet-mailcatcher.git'
|
||||
mod 'supervisord', :git => 'https://github.com/puphpet/puppet-supervisord.git'
|
||||
mod 'apache', :git => 'https://github.com/puphpet/puppetlabs-apache.git'
|
||||
mod 'php', :git => 'https://github.com/puphpet/puppet-php.git'
|
||||
mod 'composer', :git => 'https://github.com/puphpet/puppet-composer.git'
|
||||
mod 'puphpet', :git => 'https://github.com/puphpet/puppet-puphpet.git'
|
||||
mod 'drush', :git => 'https://github.com/puphpet/puppet-drush.git', :ref => 'new'
|
||||
mod 'mysql', :git => 'https://github.com/puphpet/puppetlabs-mysql.git'
|
||||
mod 'mongodb', :git => 'https://github.com/puphpet/puppetlabs-mongodb.git'
|
||||
mod 'beanstalkd', :git => 'https://github.com/puphpet/puppet-beanstalkd.git'
|
||||
mod 'rabbitmq', :git => 'https://github.com/puphpet/puppetlabs-rabbitmq.git'
|
||||
7
dev/vagrant/dolibarrdev/puphpet/puppet/hiera.yaml
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
:backends: yaml
|
||||
:yaml:
|
||||
:datadir: '/vagrant/puphpet'
|
||||
:hierarchy:
|
||||
- config
|
||||
:logger: console
|
||||
993
dev/vagrant/dolibarrdev/puphpet/puppet/manifest.pp
vendored
Normal file
@ -0,0 +1,993 @@
|
||||
## Begin Server manifest
|
||||
|
||||
if $server_values == undef {
|
||||
$server_values = hiera('server', false)
|
||||
}
|
||||
|
||||
# Ensure the time is accurate, reducing the possibilities of apt repositories
|
||||
# failing for invalid certificates
|
||||
include '::ntp'
|
||||
|
||||
Exec { path => [ '/bin/', '/sbin/', '/usr/bin/', '/usr/sbin/' ] }
|
||||
group { 'puppet': ensure => present }
|
||||
group { 'www-data': ensure => present }
|
||||
|
||||
user { $::ssh_username:
|
||||
shell => '/bin/bash',
|
||||
home => "/home/${::ssh_username}",
|
||||
ensure => present
|
||||
}
|
||||
|
||||
user { ['apache', 'nginx', 'httpd', 'www-data']:
|
||||
shell => '/bin/bash',
|
||||
ensure => present,
|
||||
groups => 'www-data',
|
||||
require => Group['www-data']
|
||||
}
|
||||
|
||||
file { "/home/${::ssh_username}":
|
||||
ensure => directory,
|
||||
owner => $::ssh_username,
|
||||
}
|
||||
|
||||
# copy dot files to ssh user's home directory
|
||||
exec { 'dotfiles':
|
||||
cwd => "/home/${::ssh_username}",
|
||||
command => "cp -r /vagrant/puphpet/files/dot/.[a-zA-Z0-9]* /home/${::ssh_username}/ \
|
||||
&& chown -R ${::ssh_username} /home/${::ssh_username}/.[a-zA-Z0-9]* \
|
||||
&& cp -r /vagrant/puphpet/files/dot/.[a-zA-Z0-9]* /root/",
|
||||
onlyif => 'test -d /vagrant/puphpet/files/dot',
|
||||
returns => [0, 1],
|
||||
require => User[$::ssh_username]
|
||||
}
|
||||
|
||||
case $::osfamily {
|
||||
# debian, ubuntu
|
||||
'debian': {
|
||||
class { 'apt': }
|
||||
|
||||
Class['::apt::update'] -> Package <|
|
||||
title != 'python-software-properties'
|
||||
and title != 'software-properties-common'
|
||||
|>
|
||||
|
||||
ensure_packages( ['augeas-tools'] )
|
||||
}
|
||||
# redhat, centos
|
||||
'redhat': {
|
||||
class { 'yum': extrarepo => ['epel'] }
|
||||
|
||||
class { 'yum::repo::rpmforge': }
|
||||
class { 'yum::repo::repoforgeextras': }
|
||||
|
||||
Class['::yum'] -> Yum::Managed_yumrepo <| |> -> Package <| |>
|
||||
|
||||
if defined(Package['git']) == false {
|
||||
package { 'git':
|
||||
ensure => latest,
|
||||
require => Class['yum::repo::repoforgeextras']
|
||||
}
|
||||
}
|
||||
|
||||
exec { 'bash_git':
|
||||
cwd => "/home/${::ssh_username}",
|
||||
command => "curl https://raw.github.com/git/git/master/contrib/completion/git-prompt.sh > /home/${::ssh_username}/.bash_git",
|
||||
creates => "/home/${::ssh_username}/.bash_git"
|
||||
}
|
||||
|
||||
exec { 'bash_git for root':
|
||||
cwd => '/root',
|
||||
command => "cp /home/${::ssh_username}/.bash_git /root/.bash_git",
|
||||
creates => '/root/.bash_git',
|
||||
require => Exec['bash_git']
|
||||
}
|
||||
|
||||
file_line { 'link ~/.bash_git':
|
||||
ensure => present,
|
||||
line => 'if [ -f ~/.bash_git ] ; then source ~/.bash_git; fi',
|
||||
path => "/home/${::ssh_username}/.bash_profile",
|
||||
require => [
|
||||
Exec['dotfiles'],
|
||||
Exec['bash_git'],
|
||||
]
|
||||
}
|
||||
|
||||
file_line { 'link ~/.bash_git for root':
|
||||
ensure => present,
|
||||
line => 'if [ -f ~/.bash_git ] ; then source ~/.bash_git; fi',
|
||||
path => '/root/.bashrc',
|
||||
require => [
|
||||
Exec['dotfiles'],
|
||||
Exec['bash_git'],
|
||||
]
|
||||
}
|
||||
|
||||
file_line { 'link ~/.bash_aliases':
|
||||
ensure => present,
|
||||
line => 'if [ -f ~/.bash_aliases ] ; then source ~/.bash_aliases; fi',
|
||||
path => "/home/${::ssh_username}/.bash_profile",
|
||||
require => File_line['link ~/.bash_git']
|
||||
}
|
||||
|
||||
file_line { 'link ~/.bash_aliases for root':
|
||||
ensure => present,
|
||||
line => 'if [ -f ~/.bash_aliases ] ; then source ~/.bash_aliases; fi',
|
||||
path => '/root/.bashrc',
|
||||
require => File_line['link ~/.bash_git for root']
|
||||
}
|
||||
|
||||
ensure_packages( ['augeas'] )
|
||||
}
|
||||
}
|
||||
|
||||
if $php_values == undef {
|
||||
$php_values = hiera('php', false)
|
||||
}
|
||||
|
||||
case $::operatingsystem {
|
||||
'debian': {
|
||||
include apt::backports
|
||||
|
||||
add_dotdeb { 'packages.dotdeb.org': release => $lsbdistcodename }
|
||||
|
||||
if is_hash($php_values) and has_key($php_values, 'install') and $php_values['install'] == 1 {
|
||||
# Debian Squeeze 6.0 can do PHP 5.3 (default) and 5.4
|
||||
if $lsbdistcodename == 'squeeze' and $php_values['version'] == '54' {
|
||||
add_dotdeb { 'packages.dotdeb.org-php54': release => 'squeeze-php54' }
|
||||
}
|
||||
# Debian Wheezy 7.0 can do PHP 5.4 (default) and 5.5
|
||||
elsif $lsbdistcodename == 'wheezy' and $php_values['version'] == '55' {
|
||||
add_dotdeb { 'packages.dotdeb.org-php55': release => 'wheezy-php55' }
|
||||
}
|
||||
}
|
||||
|
||||
$server_lsbdistcodename = downcase($lsbdistcodename)
|
||||
|
||||
apt::force { 'git':
|
||||
release => "${server_lsbdistcodename}-backports",
|
||||
timeout => 60
|
||||
}
|
||||
}
|
||||
'ubuntu': {
|
||||
apt::key { '4F4EA0AAE5267A6C':
|
||||
key_server => 'hkp://keyserver.ubuntu.com:80'
|
||||
}
|
||||
apt::key { '4CBEDD5A':
|
||||
key_server => 'hkp://keyserver.ubuntu.com:80'
|
||||
}
|
||||
|
||||
apt::ppa { 'ppa:pdoes/ppa': require => Apt::Key['4CBEDD5A'] }
|
||||
|
||||
if is_hash($php_values) and has_key($php_values, 'install') and $php_values['install'] == 1 {
|
||||
# Ubuntu Lucid 10.04, Precise 12.04, Quantal 12.10 and Raring 13.04 can do PHP 5.3 (default <= 12.10) and 5.4 (default <= 13.04)
|
||||
if $lsbdistcodename in ['lucid', 'precise', 'quantal', 'raring'] and $php_values['version'] == '54' {
|
||||
if $lsbdistcodename == 'lucid' {
|
||||
apt::ppa { 'ppa:ondrej/php5-oldstable': require => Apt::Key['4F4EA0AAE5267A6C'], options => '' }
|
||||
} else {
|
||||
apt::ppa { 'ppa:ondrej/php5-oldstable': require => Apt::Key['4F4EA0AAE5267A6C'] }
|
||||
}
|
||||
}
|
||||
# Ubuntu Precise 12.04, Quantal 12.10 and Raring 13.04 can do PHP 5.5
|
||||
elsif $lsbdistcodename in ['precise', 'quantal', 'raring'] and $php_values['version'] == '55' {
|
||||
apt::ppa { 'ppa:ondrej/php5': require => Apt::Key['4F4EA0AAE5267A6C'] }
|
||||
}
|
||||
elsif $lsbdistcodename in ['lucid'] and $php_values['version'] == '55' {
|
||||
err('You have chosen to install PHP 5.5 on Ubuntu 10.04 Lucid. This will probably not work!')
|
||||
}
|
||||
}
|
||||
}
|
||||
'redhat', 'centos': {
|
||||
if is_hash($php_values) and has_key($php_values, 'install') and $php_values['install'] == 1 {
|
||||
if $php_values['version'] == '54' {
|
||||
class { 'yum::repo::remi': }
|
||||
}
|
||||
# remi_php55 requires the remi repo as well
|
||||
elsif $php_values['version'] == '55' {
|
||||
class { 'yum::repo::remi': }
|
||||
class { 'yum::repo::remi_php55': }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if !empty($server_values['packages']) {
|
||||
ensure_packages( $server_values['packages'] )
|
||||
}
|
||||
|
||||
define add_dotdeb ($release){
|
||||
apt::source { $name:
|
||||
location => 'http://packages.dotdeb.org',
|
||||
release => $release,
|
||||
repos => 'all',
|
||||
required_packages => 'debian-keyring debian-archive-keyring',
|
||||
key => '89DF5277',
|
||||
key_server => 'keys.gnupg.net',
|
||||
include_src => true
|
||||
}
|
||||
}
|
||||
|
||||
## Begin MailCatcher manifest
|
||||
|
||||
if $mailcatcher_values == undef {
|
||||
$mailcatcher_values = hiera('mailcatcher', false)
|
||||
}
|
||||
|
||||
if is_hash($mailcatcher_values) and has_key($mailcatcher_values, 'install') and $mailcatcher_values['install'] == 1 {
|
||||
$mailcatcher_path = $mailcatcher_values['settings']['path']
|
||||
$mailcatcher_smtp_ip = $mailcatcher_values['settings']['smtp_ip']
|
||||
$mailcatcher_smtp_port = $mailcatcher_values['settings']['smtp_port']
|
||||
$mailcatcher_http_ip = $mailcatcher_values['settings']['http_ip']
|
||||
$mailcatcher_http_port = $mailcatcher_values['settings']['http_port']
|
||||
$mailcatcher_log = $mailcatcher_values['settings']['log']
|
||||
|
||||
class { 'mailcatcher':
|
||||
mailcatcher_path => $mailcatcher_path,
|
||||
smtp_ip => $mailcatcher_smtp_ip,
|
||||
smtp_port => $mailcatcher_smtp_port,
|
||||
http_ip => $mailcatcher_http_ip,
|
||||
http_port => $mailcatcher_http_port,
|
||||
}
|
||||
|
||||
if $::osfamily == 'redhat' and ! defined(Iptables::Allow["tcp/${mailcatcher_smtp_port}"]) {
|
||||
iptables::allow { "tcp/${mailcatcher_smtp_port}":
|
||||
port => $mailcatcher_smtp_port,
|
||||
protocol => 'tcp'
|
||||
}
|
||||
}
|
||||
|
||||
if $::osfamily == 'redhat' and ! defined(Iptables::Allow["tcp/${mailcatcher_http_port}"]) {
|
||||
iptables::allow { "tcp/${mailcatcher_http_port}":
|
||||
port => $mailcatcher_http_port,
|
||||
protocol => 'tcp'
|
||||
}
|
||||
}
|
||||
|
||||
if ! defined(Class['supervisord']) {
|
||||
class { 'supervisord':
|
||||
install_pip => true,
|
||||
}
|
||||
}
|
||||
|
||||
$supervisord_mailcatcher_options = sort(join_keys_to_values({
|
||||
' --smtp-ip' => $mailcatcher_smtp_ip,
|
||||
' --smtp-port' => $mailcatcher_smtp_port,
|
||||
' --http-ip' => $mailcatcher_http_ip,
|
||||
' --http-port' => $mailcatcher_http_port
|
||||
}, ' '))
|
||||
|
||||
$supervisord_mailcatcher_cmd = "mailcatcher ${supervisord_mailcatcher_options} -f >> ${mailcatcher_log}"
|
||||
|
||||
supervisord::program { 'mailcatcher':
|
||||
command => $supervisord_mailcatcher_cmd,
|
||||
priority => '100',
|
||||
user => 'mailcatcher',
|
||||
autostart => true,
|
||||
autorestart => true,
|
||||
environment => {
|
||||
'PATH' => "/bin:/sbin:/usr/bin:/usr/sbin:${mailcatcher_path}"
|
||||
},
|
||||
require => Package['mailcatcher']
|
||||
}
|
||||
}
|
||||
|
||||
## Begin Apache manifest
|
||||
|
||||
if $yaml_values == undef {
|
||||
$yaml_values = loadyaml('/vagrant/puphpet/config.yaml')
|
||||
}
|
||||
|
||||
if $apache_values == undef {
|
||||
$apache_values = $yaml_values['apache']
|
||||
}
|
||||
|
||||
if $php_values == undef {
|
||||
$php_values = hiera('php', false)
|
||||
}
|
||||
|
||||
if $hhvm_values == undef {
|
||||
$hhvm_values = hiera('hhvm', false)
|
||||
}
|
||||
|
||||
include puphpet::params
|
||||
include apache::params
|
||||
|
||||
$webroot_location = $puphpet::params::apache_webroot_location
|
||||
|
||||
exec { "exec mkdir -p ${webroot_location}":
|
||||
command => "mkdir -p ${webroot_location}",
|
||||
creates => $webroot_location,
|
||||
}
|
||||
|
||||
if ! defined(File[$webroot_location]) {
|
||||
file { $webroot_location:
|
||||
ensure => directory,
|
||||
group => 'www-data',
|
||||
mode => 0775,
|
||||
require => [
|
||||
Exec["exec mkdir -p ${webroot_location}"],
|
||||
Group['www-data']
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
if is_hash($hhvm_values) and has_key($hhvm_values, 'install') and $hhvm_values['install'] == 1 {
|
||||
$mpm_module = 'worker'
|
||||
$disallowed_modules = ['php']
|
||||
$apache_conf_template = 'puphpet/apache/hhvm-httpd.conf.erb'
|
||||
} elsif (is_hash($php_values)) {
|
||||
$mpm_module = 'prefork'
|
||||
$disallowed_modules = []
|
||||
$apache_conf_template = $apache::params::conf_template
|
||||
} else {
|
||||
$mpm_module = 'prefork'
|
||||
$disallowed_modules = []
|
||||
$apache_conf_template = $apache::params::conf_template
|
||||
}
|
||||
|
||||
class { 'apache':
|
||||
user => $apache_values['user'],
|
||||
group => $apache_values['group'],
|
||||
default_vhost => true,
|
||||
mpm_module => $mpm_module,
|
||||
manage_user => false,
|
||||
manage_group => false,
|
||||
conf_template => $apache_conf_template
|
||||
}
|
||||
|
||||
if $::osfamily == 'redhat' and ! defined(Iptables::Allow['tcp/80']) {
|
||||
iptables::allow { 'tcp/80':
|
||||
port => '80',
|
||||
protocol => 'tcp'
|
||||
}
|
||||
}
|
||||
|
||||
if has_key($apache_values, 'mod_pagespeed') and $apache_values['mod_pagespeed'] == 1 {
|
||||
class { 'puphpet::apache::modpagespeed': }
|
||||
}
|
||||
|
||||
if has_key($apache_values, 'mod_spdy') and $apache_values['mod_spdy'] == 1 {
|
||||
class { 'puphpet::apache::modspdy': }
|
||||
}
|
||||
|
||||
if count($apache_values['vhosts']) > 0 {
|
||||
each( $apache_values['vhosts'] ) |$key, $vhost| {
|
||||
exec { "exec mkdir -p ${vhost['docroot']} @ key ${key}":
|
||||
command => "mkdir -p ${vhost['docroot']}",
|
||||
creates => $vhost['docroot'],
|
||||
}
|
||||
|
||||
if ! defined(File[$vhost['docroot']]) {
|
||||
file { $vhost['docroot']:
|
||||
ensure => directory,
|
||||
require => Exec["exec mkdir -p ${vhost['docroot']} @ key ${key}"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
create_resources(apache::vhost, $apache_values['vhosts'])
|
||||
|
||||
define apache_mod {
|
||||
if ! defined(Class["apache::mod::${name}"]) and !($name in $disallowed_modules) {
|
||||
class { "apache::mod::${name}": }
|
||||
}
|
||||
}
|
||||
|
||||
if count($apache_values['modules']) > 0 {
|
||||
apache_mod { $apache_values['modules']: }
|
||||
}
|
||||
|
||||
## Begin PHP manifest
|
||||
|
||||
if $php_values == undef {
|
||||
$php_values = hiera('php', false)
|
||||
}
|
||||
|
||||
if $apache_values == undef {
|
||||
$apache_values = hiera('apache', false)
|
||||
}
|
||||
|
||||
if $nginx_values == undef {
|
||||
$nginx_values = hiera('nginx', false)
|
||||
}
|
||||
|
||||
if is_hash($php_values) and has_key($php_values, 'install') and $php_values['install'] == 1 {
|
||||
Class['Php'] -> Class['Php::Devel'] -> Php::Module <| |> -> Php::Pear::Module <| |> -> Php::Pecl::Module <| |>
|
||||
|
||||
if $php_prefix == undef {
|
||||
$php_prefix = $::operatingsystem ? {
|
||||
/(?i:Ubuntu|Debian|Mint|SLES|OpenSuSE)/ => 'php5-',
|
||||
default => 'php-',
|
||||
}
|
||||
}
|
||||
|
||||
if $php_fpm_ini == undef {
|
||||
$php_fpm_ini = $::operatingsystem ? {
|
||||
/(?i:Ubuntu|Debian|Mint|SLES|OpenSuSE)/ => '/etc/php5/fpm/php.ini',
|
||||
default => '/etc/php.ini',
|
||||
}
|
||||
}
|
||||
|
||||
if is_hash($apache_values) {
|
||||
include apache::params
|
||||
|
||||
if has_key($apache_values, 'mod_spdy') and $apache_values['mod_spdy'] == 1 {
|
||||
$php_webserver_service_ini = 'cgi'
|
||||
} else {
|
||||
$php_webserver_service_ini = 'httpd'
|
||||
}
|
||||
|
||||
$php_webserver_service = 'httpd'
|
||||
$php_webserver_user = $apache::params::user
|
||||
$php_webserver_restart = true
|
||||
|
||||
class { 'php':
|
||||
service => $php_webserver_service
|
||||
}
|
||||
} elsif is_hash($nginx_values) {
|
||||
include nginx::params
|
||||
|
||||
$php_webserver_service = "${php_prefix}fpm"
|
||||
$php_webserver_service_ini = $php_webserver_service
|
||||
$php_webserver_user = $nginx::params::nx_daemon_user
|
||||
$php_webserver_restart = true
|
||||
|
||||
class { 'php':
|
||||
package => $php_webserver_service,
|
||||
service => $php_webserver_service,
|
||||
service_autorestart => false,
|
||||
config_file => $php_fpm_ini,
|
||||
}
|
||||
|
||||
service { $php_webserver_service:
|
||||
ensure => running,
|
||||
enable => true,
|
||||
hasrestart => true,
|
||||
hasstatus => true,
|
||||
require => Package[$php_webserver_service]
|
||||
}
|
||||
} else {
|
||||
$php_webserver_service = undef
|
||||
$php_webserver_service_ini = undef
|
||||
$php_webserver_restart = false
|
||||
|
||||
class { 'php':
|
||||
package => "${php_prefix}cli",
|
||||
service => $php_webserver_service,
|
||||
service_autorestart => false,
|
||||
}
|
||||
}
|
||||
|
||||
class { 'php::devel': }
|
||||
|
||||
if count($php_values['modules']['php']) > 0 {
|
||||
php_mod { $php_values['modules']['php']:; }
|
||||
}
|
||||
if count($php_values['modules']['pear']) > 0 {
|
||||
php_pear_mod { $php_values['modules']['pear']:; }
|
||||
}
|
||||
if count($php_values['modules']['pecl']) > 0 {
|
||||
php_pecl_mod { $php_values['modules']['pecl']:; }
|
||||
}
|
||||
if count($php_values['ini']) > 0 {
|
||||
each( $php_values['ini'] ) |$key, $value| {
|
||||
if is_array($value) {
|
||||
each( $php_values['ini'][$key] ) |$innerkey, $innervalue| {
|
||||
puphpet::ini { "${key}_${innerkey}":
|
||||
entry => "CUSTOM_${innerkey}/${key}",
|
||||
value => $innervalue,
|
||||
php_version => $php_values['version'],
|
||||
webserver => $php_webserver_service_ini
|
||||
}
|
||||
}
|
||||
} else {
|
||||
puphpet::ini { $key:
|
||||
entry => "CUSTOM/${key}",
|
||||
value => $value,
|
||||
php_version => $php_values['version'],
|
||||
webserver => $php_webserver_service_ini
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if $php_values['ini']['session.save_path'] != undef {
|
||||
exec {"mkdir -p ${php_values['ini']['session.save_path']}":
|
||||
onlyif => "test ! -d ${php_values['ini']['session.save_path']}",
|
||||
}
|
||||
|
||||
file { $php_values['ini']['session.save_path']:
|
||||
ensure => directory,
|
||||
group => 'www-data',
|
||||
mode => 0775,
|
||||
require => Exec["mkdir -p ${php_values['ini']['session.save_path']}"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
puphpet::ini { $key:
|
||||
entry => 'CUSTOM/date.timezone',
|
||||
value => $php_values['timezone'],
|
||||
php_version => $php_values['version'],
|
||||
webserver => $php_webserver_service_ini
|
||||
}
|
||||
|
||||
if $php_values['composer'] == 1 {
|
||||
class { 'composer':
|
||||
target_dir => '/usr/local/bin',
|
||||
composer_file => 'composer',
|
||||
download_method => 'curl',
|
||||
logoutput => false,
|
||||
tmp_path => '/tmp',
|
||||
php_package => "${php::params::module_prefix}cli",
|
||||
curl_package => 'curl',
|
||||
suhosin_enabled => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
define php_mod {
|
||||
php::module { $name:
|
||||
service_autorestart => $php_webserver_restart,
|
||||
}
|
||||
}
|
||||
define php_pear_mod {
|
||||
php::pear::module { $name:
|
||||
use_package => false,
|
||||
service_autorestart => $php_webserver_restart,
|
||||
}
|
||||
}
|
||||
define php_pecl_mod {
|
||||
php::pecl::module { $name:
|
||||
use_package => false,
|
||||
service_autorestart => $php_webserver_restart,
|
||||
}
|
||||
}
|
||||
|
||||
## Begin Xdebug manifest
|
||||
|
||||
if $xdebug_values == undef {
|
||||
$xdebug_values = hiera('xdebug', false)
|
||||
}
|
||||
|
||||
if $php_values == undef {
|
||||
$php_values = hiera('php', false)
|
||||
}
|
||||
|
||||
if $apache_values == undef {
|
||||
$apache_values = hiera('apache', false)
|
||||
}
|
||||
|
||||
if $nginx_values == undef {
|
||||
$nginx_values = hiera('nginx', false)
|
||||
}
|
||||
|
||||
if is_hash($apache_values) {
|
||||
$xdebug_webserver_service = 'httpd'
|
||||
} elsif is_hash($nginx_values) {
|
||||
$xdebug_webserver_service = 'nginx'
|
||||
} else {
|
||||
$xdebug_webserver_service = undef
|
||||
}
|
||||
|
||||
if (is_hash($xdebug_values) and has_key($xdebug_values, 'install') and $xdebug_values['install'] == 1)
|
||||
and is_hash($php_values) and has_key($php_values, 'install') and $php_values['install'] == 1 {
|
||||
class { 'puphpet::xdebug':
|
||||
webserver => $xdebug_webserver_service
|
||||
}
|
||||
|
||||
if is_hash($xdebug_values['settings']) and count($xdebug_values['settings']) > 0 {
|
||||
each( $xdebug_values['settings'] ) |$key, $value| {
|
||||
puphpet::ini { $key:
|
||||
entry => "XDEBUG/${key}",
|
||||
value => $value,
|
||||
php_version => $php_values['version'],
|
||||
webserver => $xdebug_webserver_service
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
## Begin Xhprof manifest
|
||||
|
||||
if $xhprof_values == undef {
|
||||
$xhprof_values = hiera('xhprof', false)
|
||||
}
|
||||
|
||||
if $apache_values == undef {
|
||||
$apache_values = hiera('apache', false)
|
||||
}
|
||||
|
||||
if $nginx_values == undef {
|
||||
$nginx_values = hiera('nginx', false)
|
||||
}
|
||||
|
||||
if is_hash($apache_values) or is_hash($nginx_values) {
|
||||
$xhprof_webserver_restart = true
|
||||
} else {
|
||||
$xhprof_webserver_restart = false
|
||||
}
|
||||
|
||||
if (is_hash($xhprof_values) and has_key($xhprof_values, 'install') and $xhprof_values['install'] == 1)
|
||||
and is_hash($php_values) and has_key($php_values, 'install') and $php_values['install'] == 1 {
|
||||
if $::operatingsystem == 'ubuntu' {
|
||||
apt::key { '8D0DC64F':
|
||||
key_server => 'hkp://keyserver.ubuntu.com:80'
|
||||
}
|
||||
|
||||
apt::ppa { 'ppa:brianmercer/php5-xhprof': require => Apt::Key['8D0DC64F'] }
|
||||
}
|
||||
|
||||
$xhprof_package = $puphpet::params::xhprof_package
|
||||
|
||||
if is_hash($apache_values) {
|
||||
$xhprof_webroot_location = $puphpet::params::apache_webroot_location
|
||||
$xhprof_webserver_service = Service['httpd']
|
||||
} elsif is_hash($nginx_values) {
|
||||
$xhprof_webroot_location = $puphpet::params::nginx_webroot_location
|
||||
$xhprof_webserver_service = Service['nginx']
|
||||
} else {
|
||||
$xhprof_webroot_location = $xhprof_values['location']
|
||||
$xhprof_webserver_service = undef
|
||||
}
|
||||
|
||||
if defined(Package[$xhprof_package]) == false {
|
||||
package { $xhprof_package:
|
||||
ensure => installed,
|
||||
require => Package['php'],
|
||||
notify => $xhprof_webserver_service,
|
||||
}
|
||||
}
|
||||
|
||||
ensure_packages( ['graphviz'] )
|
||||
|
||||
exec { 'delete-xhprof-path-if-not-git-repo':
|
||||
command => "rm -rf ${xhprofPath}",
|
||||
onlyif => "test ! -d ${xhprofPath}/.git"
|
||||
}
|
||||
|
||||
vcsrepo { "${xhprof_webroot_location}/xhprof":
|
||||
ensure => present,
|
||||
provider => git,
|
||||
source => 'https://github.com/facebook/xhprof.git',
|
||||
require => Exec['delete-xhprof-path-if-not-git-repo']
|
||||
}
|
||||
|
||||
file { "${xhprofPath}/xhprof_html":
|
||||
ensure => directory,
|
||||
mode => 0775,
|
||||
require => Vcsrepo["${xhprof_webroot_location}/xhprof"]
|
||||
}
|
||||
|
||||
composer::exec { 'xhprof-composer-run':
|
||||
cmd => 'install',
|
||||
cwd => "${xhprof_webroot_location}/xhprof",
|
||||
require => [
|
||||
Class['composer'],
|
||||
File["${xhprofPath}/xhprof_html"]
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
## Begin Drush manifest
|
||||
|
||||
if $drush_values == undef {
|
||||
$drush_values = hiera('drush', false)
|
||||
}
|
||||
|
||||
if is_hash($drush_values) and has_key($drush_values, 'install') and $drush_values['install'] == 1 {
|
||||
if ($drush_values['settings']['drush.tag_branch'] != undef) {
|
||||
$drush_tag_branch = $drush_values['settings']['drush.tag_branch']
|
||||
} else {
|
||||
$drush_tag_branch = ''
|
||||
}
|
||||
|
||||
include drush::git::drush
|
||||
}
|
||||
|
||||
## Begin MySQL manifest
|
||||
|
||||
if $mysql_values == undef {
|
||||
$mysql_values = hiera('mysql', false)
|
||||
}
|
||||
|
||||
if $php_values == undef {
|
||||
$php_values = hiera('php', false)
|
||||
}
|
||||
|
||||
if $apache_values == undef {
|
||||
$apache_values = hiera('apache', false)
|
||||
}
|
||||
|
||||
if $nginx_values == undef {
|
||||
$nginx_values = hiera('nginx', false)
|
||||
}
|
||||
|
||||
if is_hash($apache_values) or is_hash($nginx_values) {
|
||||
$mysql_webserver_restart = true
|
||||
} else {
|
||||
$mysql_webserver_restart = false
|
||||
}
|
||||
|
||||
if (is_hash($php_values) and has_key($php_values, 'install') and $php_values['install'] == 1)
|
||||
or (is_hash($hhvm_values) and has_key($hhvm_values, 'install') and $hhvm_values['install'] == 1)
|
||||
{
|
||||
$mysql_php_installed = true
|
||||
} else {
|
||||
$mysql_php_installed = false
|
||||
}
|
||||
|
||||
if $mysql_values['root_password'] {
|
||||
class { 'mysql::server':
|
||||
root_password => $mysql_values['root_password'],
|
||||
}
|
||||
|
||||
if is_hash($mysql_values['databases']) and count($mysql_values['databases']) > 0 {
|
||||
create_resources(mysql_db, $mysql_values['databases'])
|
||||
}
|
||||
|
||||
if is_hash($php_values) and has_key($php_values, 'install') and $php_values['install'] == 1 and ! defined(Php::Pecl::Module[$mongodb_pecl]) {
|
||||
if $::osfamily == 'redhat' and $php_values['version'] == '53' and ! defined(Php::Module['mysql']) {
|
||||
php::module { 'mysql':
|
||||
service_autorestart => $mysql_webserver_restart,
|
||||
}
|
||||
} elsif ! defined(Php::Module['mysqlnd']) {
|
||||
php::module { 'mysqlnd':
|
||||
service_autorestart => $mysql_webserver_restart,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
define mysql_db (
|
||||
$user,
|
||||
$password,
|
||||
$host,
|
||||
$grant = [],
|
||||
$sql_file = false
|
||||
) {
|
||||
if $name == '' or $password == '' or $host == '' {
|
||||
fail( 'MySQL DB requires that name, password and host be set. Please check your settings!' )
|
||||
}
|
||||
|
||||
mysql::db { $name:
|
||||
user => $user,
|
||||
password => $password,
|
||||
host => $host,
|
||||
grant => $grant,
|
||||
sql => $sql_file,
|
||||
}
|
||||
}
|
||||
|
||||
if has_key($mysql_values, 'phpmyadmin') and $mysql_values['phpmyadmin'] == 1 and $mysql_php_installed {
|
||||
if $::osfamily == 'debian' {
|
||||
if $::operatingsystem == 'ubuntu' {
|
||||
apt::key { '80E7349A06ED541C': key_server => 'hkp://keyserver.ubuntu.com:80' }
|
||||
apt::ppa { 'ppa:nijel/phpmyadmin': require => Apt::Key['80E7349A06ED541C'] }
|
||||
}
|
||||
|
||||
$phpMyAdmin_package = 'phpmyadmin'
|
||||
$phpMyAdmin_folder = 'phpmyadmin'
|
||||
} elsif $::osfamily == 'redhat' {
|
||||
$phpMyAdmin_package = 'phpMyAdmin.noarch'
|
||||
$phpMyAdmin_folder = 'phpMyAdmin'
|
||||
}
|
||||
|
||||
if ! defined(Package[$phpMyAdmin_package]) {
|
||||
package { $phpMyAdmin_package:
|
||||
require => Class['mysql::server']
|
||||
}
|
||||
}
|
||||
|
||||
include puphpet::params
|
||||
|
||||
if is_hash($apache_values) {
|
||||
$mysql_pma_webroot_location = $puphpet::params::apache_webroot_location
|
||||
} elsif is_hash($nginx_values) {
|
||||
$mysql_pma_webroot_location = $puphpet::params::nginx_webroot_location
|
||||
|
||||
mysql_nginx_default_conf { 'override_default_conf':
|
||||
webroot => $mysql_pma_webroot_location
|
||||
}
|
||||
}
|
||||
|
||||
exec { 'cp phpmyadmin to webroot':
|
||||
command => "cp -LR /usr/share/${phpMyAdmin_folder} ${mysql_pma_webroot_location}/phpmyadmin",
|
||||
onlyif => "test ! -d ${mysql_pma_webroot_location}/phpmyadmin",
|
||||
require => [
|
||||
Package[$phpMyAdmin_package],
|
||||
File[$mysql_pma_webroot_location]
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
if has_key($mysql_values, 'adminer') and $mysql_values['adminer'] == 1 and $mysql_php_installed {
|
||||
if is_hash($apache_values) {
|
||||
$mysql_adminer_webroot_location = $puphpet::params::apache_webroot_location
|
||||
} elsif is_hash($nginx_values) {
|
||||
$mysql_adminer_webroot_location = $puphpet::params::nginx_webroot_location
|
||||
} else {
|
||||
$mysql_adminer_webroot_location = $puphpet::params::apache_webroot_location
|
||||
}
|
||||
|
||||
class { 'puphpet::adminer':
|
||||
location => "${mysql_adminer_webroot_location}/adminer",
|
||||
owner => 'www-data'
|
||||
}
|
||||
}
|
||||
|
||||
# @todo update this
|
||||
define mysql_nginx_default_conf (
|
||||
$webroot
|
||||
) {
|
||||
if $php5_fpm_sock == undef {
|
||||
$php5_fpm_sock = '/var/run/php5-fpm.sock'
|
||||
}
|
||||
|
||||
if $fastcgi_pass == undef {
|
||||
$fastcgi_pass = $php_values['version'] ? {
|
||||
undef => null,
|
||||
'53' => '127.0.0.1:9000',
|
||||
default => "unix:${php5_fpm_sock}"
|
||||
}
|
||||
}
|
||||
|
||||
class { 'puphpet::nginx':
|
||||
fastcgi_pass => $fastcgi_pass,
|
||||
notify => Class['nginx::service'],
|
||||
}
|
||||
}
|
||||
|
||||
## Begin MongoDb manifest
|
||||
|
||||
if $mongodb_values == undef {
|
||||
$mongodb_values = hiera('mongodb', false)
|
||||
}
|
||||
|
||||
if $php_values == undef {
|
||||
$php_values = hiera('php', false)
|
||||
}
|
||||
|
||||
if $apache_values == undef {
|
||||
$apache_values = hiera('apache', false)
|
||||
}
|
||||
|
||||
if $nginx_values == undef {
|
||||
$nginx_values = hiera('nginx', false)
|
||||
}
|
||||
|
||||
if is_hash($apache_values) or is_hash($nginx_values) {
|
||||
$mongodb_webserver_restart = true
|
||||
} else {
|
||||
$mongodb_webserver_restart = false
|
||||
}
|
||||
|
||||
if has_key($mongodb_values, 'install') and $mongodb_values['install'] == 1 {
|
||||
case $::osfamily {
|
||||
'debian': {
|
||||
class {'::mongodb::globals':
|
||||
manage_package_repo => true,
|
||||
}->
|
||||
class {'::mongodb::server':
|
||||
auth => $mongodb_values['auth'],
|
||||
port => $mongodb_values['port'],
|
||||
}
|
||||
|
||||
$mongodb_pecl = 'mongo'
|
||||
}
|
||||
'redhat': {
|
||||
class {'::mongodb::globals':
|
||||
manage_package_repo => true,
|
||||
}->
|
||||
class {'::mongodb::server':
|
||||
auth => $mongodb_values['auth'],
|
||||
port => $mongodb_values['port'],
|
||||
}->
|
||||
class {'::mongodb::client': }
|
||||
|
||||
$mongodb_pecl = 'pecl-mongo'
|
||||
}
|
||||
}
|
||||
|
||||
if is_hash($mongodb_values['databases']) and count($mongodb_values['databases']) > 0 {
|
||||
create_resources(mongodb_db, $mongodb_values['databases'])
|
||||
}
|
||||
|
||||
if is_hash($php_values) and has_key($php_values, 'install') and $php_values['install'] == 1 and ! defined(Php::Pecl::Module[$mongodb_pecl]) {
|
||||
php::pecl::module { $mongodb_pecl:
|
||||
service_autorestart => $mariadb_webserver_restart,
|
||||
require => Class['::mongodb::server']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
define mongodb_db (
|
||||
$user,
|
||||
$password
|
||||
) {
|
||||
if $name == '' or $password == '' {
|
||||
fail( 'MongoDB requires that name and password be set. Please check your settings!' )
|
||||
}
|
||||
|
||||
mongodb::db { $name:
|
||||
user => $user,
|
||||
password => $password
|
||||
}
|
||||
}
|
||||
|
||||
# Begin beanstalkd
|
||||
|
||||
if $beanstalkd_values == undef {
|
||||
$beanstalkd_values = hiera('beanstalkd', false)
|
||||
}
|
||||
|
||||
if $php_values == undef {
|
||||
$php_values = hiera('php', false)
|
||||
}
|
||||
|
||||
if $hhvm_values == undef {
|
||||
$hhvm_values = hiera('hhvm', false)
|
||||
}
|
||||
|
||||
if $apache_values == undef {
|
||||
$apache_values = hiera('apache', false)
|
||||
}
|
||||
|
||||
if $nginx_values == undef {
|
||||
$nginx_values = hiera('nginx', false)
|
||||
}
|
||||
|
||||
if is_hash($apache_values) {
|
||||
$beanstalk_console_webroot_location = "${puphpet::params::apache_webroot_location}/beanstalk_console"
|
||||
} elsif is_hash($nginx_values) {
|
||||
$beanstalk_console_webroot_location = "${puphpet::params::nginx_webroot_location}/beanstalk_console"
|
||||
} else {
|
||||
$beanstalk_console_webroot_location = undef
|
||||
}
|
||||
|
||||
if (is_hash($php_values) and has_key($php_values, 'install') and $php_values['install'] == 1)
|
||||
or (is_hash($hhvm_values) and has_key($hhvm_values, 'install') and $hhvm_values['install'] == 1)
|
||||
{
|
||||
$beanstalkd_php_installed = true
|
||||
} else {
|
||||
$beanstalkd_php_installed = false
|
||||
}
|
||||
|
||||
if is_hash($beanstalkd_values) and has_key($beanstalkd_values, 'install') and $beanstalkd_values['install'] == 1 {
|
||||
create_resources(beanstalkd::config, {'beanstalkd' => $beanstalkd_values['settings']})
|
||||
|
||||
if has_key($beanstalkd_values, 'beanstalk_console') and $beanstalkd_values['beanstalk_console'] == 1 and $beanstalk_console_webroot_location != undef and $beanstalkd_php_installed {
|
||||
exec { 'delete-beanstalk_console-path-if-not-git-repo':
|
||||
command => "rm -rf ${beanstalk_console_webroot_location}",
|
||||
onlyif => "test ! -d ${beanstalk_console_webroot_location}/.git"
|
||||
}
|
||||
|
||||
vcsrepo { $beanstalk_console_webroot_location:
|
||||
ensure => present,
|
||||
provider => git,
|
||||
source => 'https://github.com/ptrofimov/beanstalk_console.git',
|
||||
require => Exec['delete-beanstalk_console-path-if-not-git-repo']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Begin rabbitmq
|
||||
|
||||
if $rabbitmq_values == undef {
|
||||
$rabbitmq_values = hiera('rabbitmq', false)
|
||||
}
|
||||
|
||||
if $php_values == undef {
|
||||
$php_values = hiera('php', false)
|
||||
}
|
||||
|
||||
if has_key($rabbitmq_values, 'install') and $rabbitmq_values['install'] == 1 {
|
||||
class { 'rabbitmq':
|
||||
port => $rabbitmq_values['port']
|
||||
}
|
||||
|
||||
if is_hash($php_values) and has_key($php_values, 'install') and $php_values['install'] == 1 and ! defined(Php::Pecl::Module['amqp']) {
|
||||
php_pecl_mod { 'amqp': }
|
||||
}
|
||||
}
|
||||
|
||||
18
dev/vagrant/dolibarrdev/puphpet/shell/execute-files.sh
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
VAGRANT_CORE_FOLDER=$(cat "/.puphpet-stuff/vagrant-core-folder.txt")
|
||||
|
||||
shopt -s nullglob
|
||||
files=("${VAGRANT_CORE_FOLDER}"/files/exec-once/*)
|
||||
|
||||
if [[ ! -f /.puphpet-stuff/exec-once-ran && (${#files[@]} -gt 0) ]]; then
|
||||
echo 'Running files in files/exec-once'
|
||||
find "${VAGRANT_CORE_FOLDER}/files/exec-once" -maxdepth 1 -type f \( ! -iname "empty" \) -exec chmod +x '{}' \; -exec {} \;
|
||||
echo 'Finished running files in files/exec-once'
|
||||
echo 'To run again, delete file /.puphpet-stuff/exec-once-ran'
|
||||
touch /.puphpet-stuff/exec-once-ran
|
||||
fi
|
||||
|
||||
echo 'Running files in files/exec-always'
|
||||
find "${VAGRANT_CORE_FOLDER}/files/exec-always" -maxdepth 1 -type f \( ! -iname "empty" \) -exec chmod +x '{}' \; -exec {} \;
|
||||
echo 'Finished running files in files/exec-always'
|
||||
50
dev/vagrant/dolibarrdev/puphpet/shell/initial-setup.sh
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
|
||||
VAGRANT_CORE_FOLDER=$(echo "$1")
|
||||
|
||||
OS=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" ID)
|
||||
CODENAME=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" CODENAME)
|
||||
|
||||
if [[ ! -d /.puphpet-stuff ]]; then
|
||||
mkdir /.puphpet-stuff
|
||||
|
||||
echo "${VAGRANT_CORE_FOLDER}" > "/.puphpet-stuff/vagrant-core-folder.txt"
|
||||
|
||||
cat "${VAGRANT_CORE_FOLDER}/shell/self-promotion.txt"
|
||||
echo "Created directory /.puphpet-stuff"
|
||||
fi
|
||||
|
||||
if [[ ! -f /.puphpet-stuff/initial-setup-repo-update ]]; then
|
||||
if [ "${OS}" == 'debian' ] || [ "${OS}" == 'ubuntu' ]; then
|
||||
echo "Running initial-setup apt-get update"
|
||||
apt-get update >/dev/null
|
||||
touch /.puphpet-stuff/initial-setup-repo-update
|
||||
echo "Finished running initial-setup apt-get update"
|
||||
elif [[ "${OS}" == 'centos' ]]; then
|
||||
echo "Running initial-setup yum update"
|
||||
yum install yum-plugin-fastestmirror -y >/dev/null
|
||||
yum check-update -y >/dev/null
|
||||
echo "Finished running initial-setup yum update"
|
||||
|
||||
echo "Updating to Ruby 1.9.3"
|
||||
yum install centos-release-SCL >/dev/null
|
||||
yum remove ruby >/dev/null
|
||||
yum install ruby193 facter hiera ruby193-ruby-irb ruby193-ruby-doc ruby193-rubygem-json ruby193-libyaml >/dev/null
|
||||
gem update --system >/dev/null
|
||||
gem install haml >/dev/null
|
||||
echo "Finished updating to Ruby 1.9.3"
|
||||
|
||||
echo "Installing basic development tools (CentOS)"
|
||||
yum -y groupinstall "Development Tools" >/dev/null
|
||||
echo "Finished installing basic development tools (CentOS)"
|
||||
touch /.puphpet-stuff/initial-setup-repo-update
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "${OS}" == 'ubuntu' && ("${CODENAME}" == 'lucid' || "${CODENAME}" == 'precise') && ! -f /.puphpet-stuff/ubuntu-required-libraries ]]; then
|
||||
echo 'Installing basic curl packages (Ubuntu only)'
|
||||
apt-get install -y libcurl3 libcurl4-gnutls-dev curl >/dev/null
|
||||
echo 'Finished installing basic curl packages (Ubuntu only)'
|
||||
|
||||
touch /.puphpet-stuff/ubuntu-required-libraries
|
||||
fi
|
||||
89
dev/vagrant/dolibarrdev/puphpet/shell/librarian-puppet-vagrant.sh
vendored
Normal file
@ -0,0 +1,89 @@
|
||||
#!/bin/bash
|
||||
|
||||
VAGRANT_CORE_FOLDER=$(cat "/.puphpet-stuff/vagrant-core-folder.txt")
|
||||
|
||||
OS=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" ID)
|
||||
CODENAME=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" CODENAME)
|
||||
|
||||
# Directory in which librarian-puppet should manage its modules directory
|
||||
PUPPET_DIR=/etc/puppet/
|
||||
|
||||
$(which git > /dev/null 2>&1)
|
||||
FOUND_GIT=$?
|
||||
|
||||
if [ "${FOUND_GIT}" -ne '0' ] && [ ! -f /.puphpet-stuff/librarian-puppet-installed ]; then
|
||||
$(which apt-get > /dev/null 2>&1)
|
||||
FOUND_APT=$?
|
||||
$(which yum > /dev/null 2>&1)
|
||||
FOUND_YUM=$?
|
||||
|
||||
echo 'Installing git'
|
||||
|
||||
if [ "${FOUND_YUM}" -eq '0' ]; then
|
||||
yum -q -y makecache
|
||||
yum -q -y install git
|
||||
else
|
||||
apt-get -q -y install git-core >/dev/null
|
||||
fi
|
||||
|
||||
echo 'Finished installing git'
|
||||
fi
|
||||
|
||||
if [[ ! -d "${PUPPET_DIR}" ]]; then
|
||||
mkdir -p "${PUPPET_DIR}"
|
||||
echo "Created directory ${PUPPET_DIR}"
|
||||
fi
|
||||
|
||||
cp "${VAGRANT_CORE_FOLDER}/puppet/Puppetfile" "${PUPPET_DIR}"
|
||||
echo "Copied Puppetfile"
|
||||
|
||||
if [ "${OS}" == 'debian' ] || [ "${OS}" == 'ubuntu' ]; then
|
||||
if [[ ! -f /.puphpet-stuff/librarian-base-packages ]]; then
|
||||
echo 'Installing base packages for librarian'
|
||||
apt-get install -y build-essential ruby-dev >/dev/null
|
||||
echo 'Finished installing base packages for librarian'
|
||||
|
||||
touch /.puphpet-stuff/librarian-base-packages
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "${OS}" == 'ubuntu' ]; then
|
||||
if [[ ! -f /.puphpet-stuff/librarian-libgemplugin-ruby ]]; then
|
||||
echo 'Updating libgemplugin-ruby (Ubuntu only)'
|
||||
apt-get install -y libgemplugin-ruby >/dev/null
|
||||
echo 'Finished updating libgemplugin-ruby (Ubuntu only)'
|
||||
|
||||
touch /.puphpet-stuff/librarian-libgemplugin-ruby
|
||||
fi
|
||||
|
||||
if [ "${CODENAME}" == 'lucid' ] && [ ! -f /.puphpet-stuff/librarian-rubygems-update ]; then
|
||||
echo 'Updating rubygems (Ubuntu Lucid only)'
|
||||
echo 'Ignore all "conflicting chdir" errors!'
|
||||
gem install rubygems-update >/dev/null
|
||||
/var/lib/gems/1.8/bin/update_rubygems >/dev/null
|
||||
echo 'Finished updating rubygems (Ubuntu Lucid only)'
|
||||
|
||||
touch /.puphpet-stuff/librarian-rubygems-update
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ! -f /.puphpet-stuff/librarian-puppet-installed ]]; then
|
||||
echo 'Installing librarian-puppet'
|
||||
gem install librarian-puppet >/dev/null
|
||||
echo 'Finished installing librarian-puppet'
|
||||
|
||||
echo 'Running initial librarian-puppet'
|
||||
cd "${PUPPET_DIR}" && librarian-puppet install --clean >/dev/null
|
||||
echo 'Finished running initial librarian-puppet'
|
||||
|
||||
touch /.puphpet-stuff/librarian-puppet-installed
|
||||
else
|
||||
echo 'Running update librarian-puppet'
|
||||
cd "${PUPPET_DIR}" && librarian-puppet update >/dev/null
|
||||
echo 'Finished running update librarian-puppet'
|
||||
fi
|
||||
|
||||
echo "Replacing puppetlabs-git module with custom"
|
||||
rm -rf /etc/puppet/modules/git
|
||||
git clone https://github.com/puphpet/puppetlabs-git.git /etc/puppet/modules/git
|
||||
echo "Finished replacing puppetlabs-git module with custom"
|
||||
@ -9,7 +9,7 @@ ID="unknown"
|
||||
CODENAME="unknown"
|
||||
RELEASE="unknown"
|
||||
|
||||
if [ "$OS" == "Linux" ]; then
|
||||
if [ "${OS}" == "Linux" ]; then
|
||||
# detect centos
|
||||
grep "centos" /etc/issue -i -q
|
||||
if [ $? = '0' ]; then
|
||||
@ -36,12 +36,12 @@ fi
|
||||
|
||||
declare -A info
|
||||
|
||||
info[id]=$(echo "$ID" | tr '[A-Z]' '[a-z]')
|
||||
info[codename]=$(echo "$CODENAME" | tr '[A-Z]' '[a-z]')
|
||||
info[release]=$(echo "$RELEASE" | tr '[A-Z]' '[a-z]')
|
||||
info[id]=$(echo "${ID}" | tr '[A-Z]' '[a-z]')
|
||||
info[codename]=$(echo "${CODENAME}" | tr '[A-Z]' '[a-z]')
|
||||
info[release]=$(echo "${RELEASE}" | tr '[A-Z]' '[a-z]')
|
||||
|
||||
if [ "$TYPE" ] ; then
|
||||
echo "${info[$TYPE]}"
|
||||
echo "${info[${TYPE}]}"
|
||||
else
|
||||
echo -e "ID\t${info[id]}"
|
||||
echo -e "CODENAME\t${info[codename]}"
|
||||
45
dev/vagrant/dolibarrdev/puphpet/shell/update-puppet.sh
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
#!/bin/bash
|
||||
|
||||
VAGRANT_CORE_FOLDER=$(cat "/.puphpet-stuff/vagrant-core-folder.txt")
|
||||
|
||||
OS=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" ID)
|
||||
RELEASE=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" RELEASE)
|
||||
CODENAME=$(/bin/bash "${VAGRANT_CORE_FOLDER}/shell/os-detect.sh" CODENAME)
|
||||
|
||||
if [[ ! -f /.puphpet-stuff/update-puppet ]]; then
|
||||
if [ "${OS}" == 'debian' ] || [ "${OS}" == 'ubuntu' ]; then
|
||||
echo "Downloading http://apt.puppetlabs.com/puppetlabs-release-${CODENAME}.deb"
|
||||
wget --quiet --tries=5 --connect-timeout=10 -O "/.puphpet-stuff/puppetlabs-release-${CODENAME}.deb" "http://apt.puppetlabs.com/puppetlabs-release-${CODENAME}.deb"
|
||||
echo "Finished downloading http://apt.puppetlabs.com/puppetlabs-release-${CODENAME}.deb"
|
||||
|
||||
dpkg -i "/.puphpet-stuff/puppetlabs-release-${CODENAME}.deb" >/dev/null
|
||||
|
||||
echo "Running update-puppet apt-get update"
|
||||
apt-get update >/dev/null
|
||||
echo "Finished running update-puppet apt-get update"
|
||||
|
||||
echo "Updating Puppet to latest version"
|
||||
apt-get -y install puppet >/dev/null
|
||||
PUPPET_VERSION=$(puppet help | grep 'Puppet v')
|
||||
echo "Finished updating puppet to latest version: ${PUPPET_VERSION}"
|
||||
|
||||
touch /.puphpet-stuff/update-puppet
|
||||
echo "Created empty file /.puphpet-stuff/update-puppet"
|
||||
elif [ "${OS}" == 'centos' ]; then
|
||||
echo "Downloading http://yum.puppetlabs.com/el/${RELEASE}/products/x86_64/puppetlabs-release-6-7.noarch.rpm"
|
||||
yum -y --nogpgcheck install "http://yum.puppetlabs.com/el/${RELEASE}/products/x86_64/puppetlabs-release-6-7.noarch.rpm" >/dev/null
|
||||
echo "Finished downloading http://yum.puppetlabs.com/el/${RELEASE}/products/x86_64/puppetlabs-release-6-7.noarch.rpm"
|
||||
|
||||
echo "Running update-puppet yum update"
|
||||
yum -y update >/dev/null
|
||||
echo "Finished running update-puppet yum update"
|
||||
|
||||
echo "Installing/Updating Puppet to latest version"
|
||||
yum -y install puppet >/dev/null
|
||||
PUPPET_VERSION=$(puppet help | grep 'Puppet v')
|
||||
echo "Finished installing/updating puppet to latest version: ${PUPPET_VERSION}"
|
||||
|
||||
touch /.puphpet-stuff/update-puppet
|
||||
echo "Created empty file /.puphpet-stuff/update-puppet"
|
||||
fi
|
||||
fi
|
||||
@ -1,13 +0,0 @@
|
||||
forge "http://forge.puppetlabs.com"
|
||||
mod 'stdlib', :git => 'git://github.com/puphpet/puppetlabs-stdlib.git'
|
||||
mod 'concat', :git => 'git://github.com/puphpet/puppetlabs-concat.git'
|
||||
mod 'apt', :git => 'git://github.com/puphpet/puppetlabs-apt.git'
|
||||
mod 'yum', :git => 'git://github.com/puphpet/puppet-yum.git'
|
||||
mod 'vcsrepo', :git => 'git://github.com/puphpet/puppetlabs-vcsrepo.git'
|
||||
mod 'ntp', :git => 'git://github.com/puphpet/puppetlabs-ntp.git'
|
||||
mod 'iptables', :git => 'git://github.com/puphpet/puppet-iptables.git'
|
||||
mod 'apache', :git => 'git://github.com/puphpet/puppetlabs-apache.git'
|
||||
mod 'php', :git => 'git://github.com/puphpet/puppet-php.git'
|
||||
mod 'composer', :git => 'git://github.com/puphpet/puppet-composer.git'
|
||||
mod 'puphpet', :git => 'git://github.com/puphpet/puppet-puphpet.git'
|
||||
mod 'mysql', :git => 'git://github.com/puphpet/puppetlabs-mysql.git'
|
||||
@ -1,121 +0,0 @@
|
||||
---
|
||||
vagrantfile-local:
|
||||
vm:
|
||||
box: debian-wheezy72-x64-vbox43
|
||||
box_url: 'https://puphpet.s3.amazonaws.com/debian-wheezy72-x64-vbox43.box'
|
||||
hostname: null
|
||||
network:
|
||||
private_network: 192.168.42.101
|
||||
forwarded_port:
|
||||
IoUPe5V4KFVe:
|
||||
host: ''
|
||||
guest: ''
|
||||
provider:
|
||||
virtualbox:
|
||||
modifyvm:
|
||||
name: dolibarrdev
|
||||
natdnshostresolver1: on
|
||||
memory: '512'
|
||||
setextradata:
|
||||
VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root: 1
|
||||
provision:
|
||||
puppet:
|
||||
manifests_path: puppet/manifests
|
||||
options:
|
||||
- --verbose
|
||||
- '--hiera_config /vagrant/hiera.yaml'
|
||||
- '--parser future'
|
||||
synced_folder:
|
||||
w8TR2T1V5h4o:
|
||||
id: vagrant-root
|
||||
source: ../../../
|
||||
target: /var/www
|
||||
nfs: 'false'
|
||||
usable_port_range: 2200..2250
|
||||
ssh:
|
||||
host: null
|
||||
port: null
|
||||
private_key_path: null
|
||||
username: vagrant
|
||||
guest_port: null
|
||||
keep_alive: true
|
||||
forward_agent: false
|
||||
forward_x11: false
|
||||
shell: 'bash -l'
|
||||
vagrant:
|
||||
host: ':detect'
|
||||
server:
|
||||
packages:
|
||||
- nano
|
||||
- ack-grep
|
||||
dot_files:
|
||||
-
|
||||
bash_aliases: null
|
||||
_prevent_empty: ''
|
||||
apache:
|
||||
modules:
|
||||
- php
|
||||
- rewrite
|
||||
vhosts:
|
||||
vkJFW364QjeN:
|
||||
servername: dev.dolibarr.org
|
||||
docroot: /var/www/htdocs
|
||||
port: '80'
|
||||
setenv:
|
||||
- 'APP_ENV dev'
|
||||
override:
|
||||
- All
|
||||
user: www-data
|
||||
group: www-data
|
||||
default_vhost: true
|
||||
mpm_module: prefork
|
||||
php:
|
||||
version: '55'
|
||||
composer: '1'
|
||||
modules:
|
||||
php:
|
||||
- cli
|
||||
- intl
|
||||
- mcrypt
|
||||
- curl
|
||||
- imagick
|
||||
- gd
|
||||
pear: { }
|
||||
pecl: { }
|
||||
ini:
|
||||
display_errors: On
|
||||
error_reporting: '-1'
|
||||
session.save_path: /var/lib/php/session
|
||||
timezone: UTC
|
||||
xdebug:
|
||||
install: '1'
|
||||
settings:
|
||||
xdebug.default_enable: '1'
|
||||
xdebug.remote_autostart: '0'
|
||||
xdebug.remote_connect_back: '1'
|
||||
xdebug.remote_enable: '1'
|
||||
xdebug.remote_handler: dbgp
|
||||
xdebug.remote_port: '9000'
|
||||
xhprof:
|
||||
install: '1'
|
||||
location: /var/www/xhprof
|
||||
mysql:
|
||||
root_password: root
|
||||
phpmyadmin: '1'
|
||||
databases:
|
||||
4TUR1gNNdrQV:
|
||||
grant:
|
||||
- ALTER
|
||||
- CREATE
|
||||
- DELETE
|
||||
- DROP
|
||||
- INDEX
|
||||
- INSERT
|
||||
- SELECT
|
||||
- UPDATE
|
||||
name: dolibarr
|
||||
host: localhost
|
||||
user: user
|
||||
password: user
|
||||
sql_file: /var/www/dev/initdata/mysqldump_dolibarr_3.5.0.sql
|
||||
|
||||
@ -1,541 +0,0 @@
|
||||
## Begin Server manifest
|
||||
|
||||
if $server_values == undef {
|
||||
$server_values = hiera('server', false)
|
||||
}
|
||||
|
||||
# Ensure the time is accurate, reducing the possibilities of apt repositories
|
||||
# failing for invalid certificates
|
||||
include '::ntp'
|
||||
|
||||
Exec { path => [ '/bin/', '/sbin/', '/usr/bin/', '/usr/sbin/' ] }
|
||||
File { owner => 0, group => 0, mode => 0644 }
|
||||
|
||||
group { 'puppet': ensure => present }
|
||||
group { 'www-data': ensure => present }
|
||||
|
||||
user { $::ssh_username:
|
||||
shell => '/bin/bash',
|
||||
home => "/home/${::ssh_username}",
|
||||
ensure => present
|
||||
}
|
||||
|
||||
user { ['apache', 'nginx', 'httpd', 'www-data']:
|
||||
shell => '/bin/bash',
|
||||
ensure => present,
|
||||
groups => 'www-data',
|
||||
require => Group['www-data']
|
||||
}
|
||||
|
||||
file { "/home/${::ssh_username}":
|
||||
ensure => directory,
|
||||
owner => $::ssh_username,
|
||||
}
|
||||
|
||||
# copy dot files to ssh user's home directory
|
||||
exec { 'dotfiles':
|
||||
cwd => "/home/${::ssh_username}",
|
||||
command => "cp -r /vagrant/files/dot/.[a-zA-Z0-9]* /home/${::ssh_username}/ && chown -R ${::ssh_username} /home/${::ssh_username}/.[a-zA-Z0-9]*",
|
||||
onlyif => "test -d /vagrant/files/dot",
|
||||
require => User[$::ssh_username]
|
||||
}
|
||||
|
||||
case $::osfamily {
|
||||
# debian, ubuntu
|
||||
'debian': {
|
||||
class { 'apt': }
|
||||
|
||||
Class['::apt::update'] -> Package <|
|
||||
title != 'python-software-properties'
|
||||
and title != 'software-properties-common'
|
||||
|>
|
||||
|
||||
ensure_packages( ['augeas-tools'] )
|
||||
}
|
||||
# redhat, centos
|
||||
'redhat': {
|
||||
class { 'yum': extrarepo => ['epel'] }
|
||||
|
||||
Class['::yum'] -> Yum::Managed_yumrepo <| |> -> Package <| |>
|
||||
|
||||
exec { 'bash_git':
|
||||
cwd => "/home/${::ssh_username}",
|
||||
command => "curl https://raw.github.com/git/git/master/contrib/completion/git-prompt.sh > /home/${::ssh_username}/.bash_git",
|
||||
creates => "/home/${::ssh_username}/.bash_git"
|
||||
}
|
||||
|
||||
file_line { 'link ~/.bash_git':
|
||||
ensure => present,
|
||||
line => 'if [ -f ~/.bash_git ] ; then source ~/.bash_git; fi',
|
||||
path => "/home/${::ssh_username}/.bash_profile",
|
||||
require => [
|
||||
Exec['dotfiles'],
|
||||
Exec['bash_git'],
|
||||
]
|
||||
}
|
||||
|
||||
file_line { 'link ~/.bash_aliases':
|
||||
ensure => present,
|
||||
line => 'if [ -f ~/.bash_aliases ] ; then source ~/.bash_aliases; fi',
|
||||
path => "/home/${::ssh_username}/.bash_profile",
|
||||
require => [
|
||||
File_line['link ~/.bash_git'],
|
||||
]
|
||||
}
|
||||
|
||||
ensure_packages( ['augeas'] )
|
||||
}
|
||||
}
|
||||
|
||||
if $php_values == undef {
|
||||
$php_values = hiera('php', false)
|
||||
}
|
||||
|
||||
case $::operatingsystem {
|
||||
'debian': {
|
||||
add_dotdeb { 'packages.dotdeb.org': release => $lsbdistcodename }
|
||||
|
||||
if is_hash($php_values) {
|
||||
# Debian Squeeze 6.0 can do PHP 5.3 (default) and 5.4
|
||||
if $lsbdistcodename == 'squeeze' and $php_values['version'] == '54' {
|
||||
add_dotdeb { 'packages.dotdeb.org-php54': release => 'squeeze-php54' }
|
||||
}
|
||||
# Debian Wheezy 7.0 can do PHP 5.4 (default) and 5.5
|
||||
elsif $lsbdistcodename == 'wheezy' and $php_values['version'] == '55' {
|
||||
add_dotdeb { 'packages.dotdeb.org-php55': release => 'wheezy-php55' }
|
||||
}
|
||||
}
|
||||
}
|
||||
'ubuntu': {
|
||||
apt::key { '4F4EA0AAE5267A6C': }
|
||||
|
||||
if is_hash($php_values) {
|
||||
# Ubuntu Lucid 10.04, Precise 12.04, Quantal 12.10 and Raring 13.04 can do PHP 5.3 (default <= 12.10) and 5.4 (default <= 13.04)
|
||||
if $lsbdistcodename in ['lucid', 'precise', 'quantal', 'raring'] and $php_values['version'] == '54' {
|
||||
if $lsbdistcodename == 'lucid' {
|
||||
apt::ppa { 'ppa:ondrej/php5-oldstable': require => Apt::Key['4F4EA0AAE5267A6C'], options => '' }
|
||||
} else {
|
||||
apt::ppa { 'ppa:ondrej/php5-oldstable': require => Apt::Key['4F4EA0AAE5267A6C'] }
|
||||
}
|
||||
}
|
||||
# Ubuntu Precise 12.04, Quantal 12.10 and Raring 13.04 can do PHP 5.5
|
||||
elsif $lsbdistcodename in ['precise', 'quantal', 'raring'] and $php_values['version'] == '55' {
|
||||
apt::ppa { 'ppa:ondrej/php5': require => Apt::Key['4F4EA0AAE5267A6C'] }
|
||||
}
|
||||
elsif $lsbdistcodename in ['lucid'] and $php_values['version'] == '55' {
|
||||
err('You have chosen to install PHP 5.5 on Ubuntu 10.04 Lucid. This will probably not work!')
|
||||
}
|
||||
}
|
||||
}
|
||||
'redhat', 'centos': {
|
||||
if is_hash($php_values) {
|
||||
if $php_values['version'] == '54' {
|
||||
class { 'yum::repo::remi': }
|
||||
}
|
||||
# remi_php55 requires the remi repo as well
|
||||
elsif $php_values['version'] == '55' {
|
||||
class { 'yum::repo::remi': }
|
||||
class { 'yum::repo::remi_php55': }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if !empty($server_values['packages']) {
|
||||
ensure_packages( $server_values['packages'] )
|
||||
}
|
||||
|
||||
define add_dotdeb ($release){
|
||||
apt::source { $name:
|
||||
location => 'http://packages.dotdeb.org',
|
||||
release => $release,
|
||||
repos => 'all',
|
||||
required_packages => 'debian-keyring debian-archive-keyring',
|
||||
key => '89DF5277',
|
||||
key_server => 'keys.gnupg.net',
|
||||
include_src => true
|
||||
}
|
||||
}
|
||||
|
||||
## Begin Apache manifest
|
||||
|
||||
if $yaml_values == undef {
|
||||
$yaml_values = loadyaml('/vagrant/puppet/hieradata/common.yaml')
|
||||
}
|
||||
|
||||
if $apache_values == undef {
|
||||
$apache_values = $yaml_values['apache']
|
||||
}
|
||||
|
||||
include puphpet::params
|
||||
|
||||
$webroot_location = $puphpet::params::apache_webroot_location
|
||||
|
||||
exec { "exec mkdir -p ${webroot_location}":
|
||||
command => "mkdir -p ${webroot_location}",
|
||||
onlyif => "test -d ${webroot_location}",
|
||||
}
|
||||
|
||||
if ! defined(File[$webroot_location]) {
|
||||
file { $webroot_location:
|
||||
ensure => directory,
|
||||
group => 'www-data',
|
||||
mode => 0775,
|
||||
require => [
|
||||
Exec["exec mkdir -p ${webroot_location}"],
|
||||
Group['www-data']
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
class { 'apache':
|
||||
user => $apache_values['user'],
|
||||
group => $apache_values['group'],
|
||||
default_vhost => $apache_values['default_vhost'],
|
||||
mpm_module => $apache_values['mpm_module'],
|
||||
manage_user => false,
|
||||
manage_group => false
|
||||
}
|
||||
|
||||
if $::osfamily == 'debian' {
|
||||
case $apache_values['mpm_module'] {
|
||||
'prefork': { ensure_packages( ['apache2-mpm-prefork'] ) }
|
||||
'worker': { ensure_packages( ['apache2-mpm-worker'] ) }
|
||||
'event': { ensure_packages( ['apache2-mpm-event'] ) }
|
||||
}
|
||||
} elsif $::osfamily == 'redhat' and ! defined(Iptables::Allow['tcp/80']) {
|
||||
iptables::allow { 'tcp/80':
|
||||
port => '80',
|
||||
protocol => 'tcp'
|
||||
}
|
||||
}
|
||||
|
||||
create_resources(apache::vhost, $apache_values['vhosts'])
|
||||
|
||||
define apache_mod {
|
||||
if ! defined(Class["apache::mod::${name}"]) {
|
||||
class { "apache::mod::${name}": }
|
||||
}
|
||||
}
|
||||
|
||||
if count($apache_values['modules']) > 0 {
|
||||
apache_mod { $apache_values['modules']: }
|
||||
}
|
||||
|
||||
## Begin PHP manifest
|
||||
|
||||
if $php_values == undef {
|
||||
$php_values = hiera('php', false)
|
||||
}
|
||||
|
||||
if $apache_values == undef {
|
||||
$apache_values = hiera('apache', false)
|
||||
}
|
||||
|
||||
if $nginx_values == undef {
|
||||
$nginx_values = hiera('nginx', false)
|
||||
}
|
||||
|
||||
Class['Php'] -> Class['Php::Devel'] -> Php::Module <| |> -> Php::Pear::Module <| |> -> Php::Pecl::Module <| |>
|
||||
|
||||
if $php_prefix == undef {
|
||||
$php_prefix = $::operatingsystem ? {
|
||||
/(?i:Ubuntu|Debian|Mint|SLES|OpenSuSE)/ => 'php5-',
|
||||
default => 'php-',
|
||||
}
|
||||
}
|
||||
|
||||
if $php_fpm_ini == undef {
|
||||
$php_fpm_ini = $::operatingsystem ? {
|
||||
/(?i:Ubuntu|Debian|Mint|SLES|OpenSuSE)/ => '/etc/php5/fpm/php.ini',
|
||||
default => '/etc/php.ini',
|
||||
}
|
||||
}
|
||||
|
||||
if is_hash($apache_values) {
|
||||
include apache::params
|
||||
|
||||
$php_webserver_service = 'httpd'
|
||||
$php_webserver_user = $apache::params::user
|
||||
|
||||
class { 'php':
|
||||
service => $php_webserver_service
|
||||
}
|
||||
} elsif is_hash($nginx_values) {
|
||||
include nginx::params
|
||||
|
||||
$php_webserver_service = "${php_prefix}fpm"
|
||||
$php_webserver_user = $nginx::params::nx_daemon_user
|
||||
|
||||
class { 'php':
|
||||
package => $php_webserver_service,
|
||||
service => $php_webserver_service,
|
||||
service_autorestart => false,
|
||||
config_file => $php_fpm_ini,
|
||||
}
|
||||
|
||||
service { $php_webserver_service:
|
||||
ensure => running,
|
||||
enable => true,
|
||||
hasrestart => true,
|
||||
hasstatus => true,
|
||||
require => Package[$php_webserver_service]
|
||||
}
|
||||
}
|
||||
|
||||
class { 'php::devel': }
|
||||
|
||||
if count($php_values['modules']['php']) > 0 {
|
||||
php_mod { $php_values['modules']['php']:; }
|
||||
}
|
||||
if count($php_values['modules']['pear']) > 0 {
|
||||
php_pear_mod { $php_values['modules']['pear']:; }
|
||||
}
|
||||
if count($php_values['modules']['pecl']) > 0 {
|
||||
php_pecl_mod { $php_values['modules']['pecl']:; }
|
||||
}
|
||||
if count($php_values['ini']) > 0 {
|
||||
$php_values['ini'].each { |$key, $value|
|
||||
puphpet::ini { $key:
|
||||
entry => "CUSTOM/${key}",
|
||||
value => $value,
|
||||
php_version => $php_values['version'],
|
||||
webserver => $php_webserver_service
|
||||
}
|
||||
}
|
||||
|
||||
if $php_values['ini']['session.save_path'] != undef {
|
||||
exec {"mkdir -p ${php_values['ini']['session.save_path']}":
|
||||
onlyif => "test ! -d ${php_values['ini']['session.save_path']}",
|
||||
}
|
||||
|
||||
file { $php_values['ini']['session.save_path']:
|
||||
ensure => directory,
|
||||
group => 'www-data',
|
||||
mode => 0775,
|
||||
require => Exec["mkdir -p ${php_values['ini']['session.save_path']}"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
puphpet::ini { $key:
|
||||
entry => 'CUSTOM/date.timezone',
|
||||
value => $php_values['timezone'],
|
||||
php_version => $php_values['version'],
|
||||
webserver => $php_webserver_service
|
||||
}
|
||||
|
||||
define php_mod {
|
||||
php::module { $name: }
|
||||
}
|
||||
define php_pear_mod {
|
||||
php::pear::module { $name: use_package => false }
|
||||
}
|
||||
define php_pecl_mod {
|
||||
php::pecl::module { $name: use_package => false }
|
||||
}
|
||||
|
||||
if $php_values['composer'] == 1 {
|
||||
class { 'composer':
|
||||
target_dir => '/usr/local/bin',
|
||||
composer_file => 'composer',
|
||||
download_method => 'curl',
|
||||
logoutput => false,
|
||||
tmp_path => '/tmp',
|
||||
php_package => "${php::params::module_prefix}cli",
|
||||
curl_package => 'curl',
|
||||
suhosin_enabled => false,
|
||||
}
|
||||
}
|
||||
|
||||
if $xdebug_values == undef {
|
||||
$xdebug_values = hiera('xdebug', false)
|
||||
}
|
||||
|
||||
if is_hash($apache_values) {
|
||||
$xdebug_webserver_service = 'httpd'
|
||||
} elsif is_hash($nginx_values) {
|
||||
$xdebug_webserver_service = 'nginx'
|
||||
} else {
|
||||
$xdebug_webserver_service = undef
|
||||
}
|
||||
|
||||
if $xdebug_values['install'] != undef and $xdebug_values['install'] == 1 {
|
||||
class { 'puphpet::xdebug':
|
||||
webserver => $xdebug_webserver_service
|
||||
}
|
||||
|
||||
if is_hash($xdebug_values['settings']) and count($xdebug_values['settings']) > 0 {
|
||||
$xdebug_values['settings'].each { |$key, $value|
|
||||
puphpet::ini { $key:
|
||||
entry => "XDEBUG/${key}",
|
||||
value => $value,
|
||||
php_version => $php_values['version'],
|
||||
webserver => $xdebug_webserver_service
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
## Begin Xhprof manifest
|
||||
|
||||
if $xhprof_values == undef {
|
||||
$xhprof_values = hiera('xhprof', false)
|
||||
}
|
||||
|
||||
if is_hash($xhprof_values) and $xhprof_values['install'] == 1 {
|
||||
$xhprofPath = $xhprof_values['location']
|
||||
|
||||
php::pecl::module { 'xhprof':
|
||||
use_package => false,
|
||||
preferred_state => 'beta',
|
||||
}
|
||||
|
||||
exec { 'delete-xhprof-path-if-not-git-repo':
|
||||
command => "rm -rf ${xhprofPath}",
|
||||
onlyif => "test ! -d ${xhprofPath}/.git"
|
||||
}
|
||||
|
||||
vcsrepo { $xhprofPath:
|
||||
ensure => present,
|
||||
provider => git,
|
||||
source => 'https://github.com/facebook/xhprof.git',
|
||||
require => Exec['delete-xhprof-path-if-not-git-repo']
|
||||
}
|
||||
|
||||
file { "${xhprofPath}/xhprof_html":
|
||||
ensure => directory,
|
||||
mode => 0775,
|
||||
require => Vcsrepo[$xhprofPath]
|
||||
}
|
||||
|
||||
composer::exec { 'xhprof-composer-run':
|
||||
cmd => 'install',
|
||||
cwd => $xhprofPath,
|
||||
require => [
|
||||
Class['composer'],
|
||||
File["${xhprofPath}/xhprof_html"]
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
## Begin MySQL manifest
|
||||
|
||||
if $mysql_values == undef {
|
||||
$mysql_values = hiera('mysql', false)
|
||||
}
|
||||
|
||||
if $php_values == undef {
|
||||
$php_values = hiera('php', false)
|
||||
}
|
||||
|
||||
if $apache_values == undef {
|
||||
$apache_values = hiera('apache', false)
|
||||
}
|
||||
|
||||
if $nginx_values == undef {
|
||||
$nginx_values = hiera('nginx', false)
|
||||
}
|
||||
|
||||
if $mysql_values['root_password'] {
|
||||
class { 'mysql::server':
|
||||
root_password => $mysql_values['root_password'],
|
||||
}
|
||||
|
||||
if is_hash($mysql_values['databases']) and count($mysql_values['databases']) > 0 {
|
||||
create_resources(mysql_db, $mysql_values['databases'])
|
||||
}
|
||||
|
||||
if is_hash($php_values) {
|
||||
if $::osfamily == 'redhat' and $php_values['version'] == '53' and ! defined(Php::Module['mysql']) {
|
||||
php::module { 'mysql': }
|
||||
} elsif ! defined(Php::Module['mysqlnd']) {
|
||||
php::module { 'mysqlnd': }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
define mysql_db (
|
||||
$user,
|
||||
$password,
|
||||
$host,
|
||||
$grant = [],
|
||||
$sql_file = false
|
||||
) {
|
||||
if $name == '' or $password == '' or $host == '' {
|
||||
fail( 'MySQL DB requires that name, password and host be set. Please check your settings!' )
|
||||
}
|
||||
|
||||
mysql::db { $name:
|
||||
user => $user,
|
||||
password => $password,
|
||||
host => $host,
|
||||
grant => $grant,
|
||||
sql => $sql_file,
|
||||
}
|
||||
}
|
||||
|
||||
if $mysql_values['phpmyadmin'] == 1 and is_hash($php_values) {
|
||||
if $::osfamily == 'debian' {
|
||||
if $::operatingsystem == 'ubuntu' {
|
||||
apt::key { '80E7349A06ED541C': }
|
||||
apt::ppa { 'ppa:nijel/phpmyadmin': require => Apt::Key['80E7349A06ED541C'] }
|
||||
}
|
||||
|
||||
$phpMyAdmin_package = 'phpmyadmin'
|
||||
$phpMyAdmin_folder = 'phpmyadmin'
|
||||
} elsif $::osfamily == 'redhat' {
|
||||
$phpMyAdmin_package = 'phpMyAdmin.noarch'
|
||||
$phpMyAdmin_folder = 'phpMyAdmin'
|
||||
}
|
||||
|
||||
if ! defined(Package[$phpMyAdmin_package]) {
|
||||
package { $phpMyAdmin_package:
|
||||
require => Class['mysql::server']
|
||||
}
|
||||
}
|
||||
|
||||
include puphpet::params
|
||||
|
||||
if is_hash($apache_values) {
|
||||
$mysql_webroot_location = $puphpet::params::apache_webroot_location
|
||||
} elsif is_hash($nginx_values) {
|
||||
$mysql_webroot_location = $puphpet::params::nginx_webroot_location
|
||||
|
||||
mysql_nginx_default_conf { 'override_default_conf':
|
||||
webroot => $mysql_webroot_location
|
||||
}
|
||||
}
|
||||
|
||||
file { "${mysql_webroot_location}/phpmyadmin":
|
||||
target => "/usr/share/${phpMyAdmin_folder}",
|
||||
ensure => link,
|
||||
replace => 'no',
|
||||
require => [
|
||||
Package[$phpMyAdmin_package],
|
||||
File[$mysql_webroot_location]
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
define mysql_nginx_default_conf (
|
||||
$webroot
|
||||
) {
|
||||
if $php5_fpm_sock == undef {
|
||||
$php5_fpm_sock = '/var/run/php5-fpm.sock'
|
||||
}
|
||||
|
||||
if $fastcgi_pass == undef {
|
||||
$fastcgi_pass = $php_values['version'] ? {
|
||||
undef => null,
|
||||
'53' => '127.0.0.1:9000',
|
||||
default => "unix:${php5_fpm_sock}"
|
||||
}
|
||||
}
|
||||
|
||||
class { 'puphpet::nginx':
|
||||
fastcgi_pass => $fastcgi_pass,
|
||||
notify => Class['nginx::service'],
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,36 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
OS=$(/bin/bash /vagrant/shell/os-detect.sh ID)
|
||||
CODENAME=$(/bin/bash /vagrant/shell/os-detect.sh CODENAME)
|
||||
|
||||
if [[ ! -d /.puphpet-stuff ]]; then
|
||||
cat /vagrant/shell/self-promotion.txt
|
||||
mkdir /.puphpet-stuff
|
||||
echo "Created directory /.puphpet-stuff"
|
||||
fi
|
||||
|
||||
if [[ ! -f /.puphpet-stuff/initial-setup-repo-update ]]; then
|
||||
if [ "$OS" == 'debian' ] || [ "$OS" == 'ubuntu' ]; then
|
||||
echo "Running initial-setup apt-get update"
|
||||
apt-get update >/dev/null
|
||||
touch /.puphpet-stuff/initial-setup-repo-update
|
||||
echo "Finished running initial-setup apt-get update"
|
||||
elif [[ "$OS" == 'centos' ]]; then
|
||||
echo "Running initial-setup yum update"
|
||||
yum update -y >/dev/null
|
||||
echo "Finished running initial-setup yum update"
|
||||
|
||||
echo "Installing basic development tools (CentOS)"
|
||||
yum -y groupinstall "Development Tools" >/dev/null
|
||||
echo "Finished installing basic development tools (CentOS)"
|
||||
touch /.puphpet-stuff/initial-setup-repo-update
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$OS" == 'ubuntu' && ("$CODENAME" == 'lucid' || "$CODENAME" == 'precise') && ! -f /.puphpet-stuff/ubuntu-required-libraries ]]; then
|
||||
echo 'Installing basic curl packages (Ubuntu only)'
|
||||
apt-get install -y libcurl3 libcurl4-gnutls-dev >/dev/null
|
||||
echo 'Finished installing basic curl packages (Ubuntu only)'
|
||||
|
||||
touch /.puphpet-stuff/ubuntu-required-libraries
|
||||
fi
|
||||
@ -1,82 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
OS=$(/bin/bash /vagrant/shell/os-detect.sh ID)
|
||||
CODENAME=$(/bin/bash /vagrant/shell/os-detect.sh CODENAME)
|
||||
|
||||
# Directory in which librarian-puppet should manage its modules directory
|
||||
PUPPET_DIR=/etc/puppet/
|
||||
|
||||
$(which git > /dev/null 2>&1)
|
||||
FOUND_GIT=$?
|
||||
|
||||
if [ "$FOUND_GIT" -ne '0' ] && [ ! -f /.puphpet-stuff/librarian-puppet-installed ]; then
|
||||
$(which apt-get > /dev/null 2>&1)
|
||||
FOUND_APT=$?
|
||||
$(which yum > /dev/null 2>&1)
|
||||
FOUND_YUM=$?
|
||||
|
||||
echo 'Installing git'
|
||||
|
||||
if [ "${FOUND_YUM}" -eq '0' ]; then
|
||||
yum -q -y makecache
|
||||
yum -q -y install git
|
||||
else
|
||||
apt-get -q -y install git-core >/dev/null
|
||||
fi
|
||||
|
||||
echo 'Finished installing git'
|
||||
fi
|
||||
|
||||
if [[ ! -d "$PUPPET_DIR" ]]; then
|
||||
mkdir -p "$PUPPET_DIR"
|
||||
echo "Created directory $PUPPET_DIR"
|
||||
fi
|
||||
|
||||
cp "/vagrant/puppet/Puppetfile" "$PUPPET_DIR"
|
||||
echo "Copied Puppetfile"
|
||||
|
||||
if [ "$OS" == 'debian' ] || [ "$OS" == 'ubuntu' ]; then
|
||||
if [[ ! -f /.puphpet-stuff/librarian-base-packages ]]; then
|
||||
echo 'Installing base packages for librarian'
|
||||
apt-get install -y build-essential ruby-dev >/dev/null
|
||||
echo 'Finished installing base packages for librarian'
|
||||
|
||||
touch /.puphpet-stuff/librarian-base-packages
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$OS" == 'ubuntu' ]; then
|
||||
if [[ ! -f /.puphpet-stuff/librarian-libgemplugin-ruby ]]; then
|
||||
echo 'Updating libgemplugin-ruby (Ubuntu only)'
|
||||
apt-get install -y libgemplugin-ruby >/dev/null
|
||||
echo 'Finished updating libgemplugin-ruby (Ubuntu only)'
|
||||
|
||||
touch /.puphpet-stuff/librarian-libgemplugin-ruby
|
||||
fi
|
||||
|
||||
if [ "$CODENAME" == 'lucid' ] && [ ! -f /.puphpet-stuff/librarian-rubygems-update ]; then
|
||||
echo 'Updating rubygems (Ubuntu Lucid only)'
|
||||
echo 'Ignore all "conflicting chdir" errors!'
|
||||
gem install rubygems-update >/dev/null
|
||||
/var/lib/gems/1.8/bin/update_rubygems >/dev/null
|
||||
echo 'Finished updating rubygems (Ubuntu Lucid only)'
|
||||
|
||||
touch /.puphpet-stuff/librarian-rubygems-update
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ! -f /.puphpet-stuff/librarian-puppet-installed ]]; then
|
||||
echo 'Installing librarian-puppet'
|
||||
gem install librarian-puppet >/dev/null
|
||||
echo 'Finished installing librarian-puppet'
|
||||
|
||||
echo 'Running initial librarian-puppet'
|
||||
cd "$PUPPET_DIR" && librarian-puppet install --clean >/dev/null
|
||||
echo 'Finished running initial librarian-puppet'
|
||||
|
||||
touch /.puphpet-stuff/librarian-puppet-installed
|
||||
else
|
||||
echo 'Running update librarian-puppet'
|
||||
cd "$PUPPET_DIR" && librarian-puppet update >/dev/null
|
||||
echo 'Finished running update librarian-puppet'
|
||||
fi
|
||||
@ -1,43 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
OS=$(/bin/bash /vagrant/shell/os-detect.sh ID)
|
||||
RELEASE=$(/bin/bash /vagrant/shell/os-detect.sh RELEASE)
|
||||
CODENAME=$(/bin/bash /vagrant/shell/os-detect.sh CODENAME)
|
||||
|
||||
if [[ ! -f /.puphpet-stuff/update-puppet ]]; then
|
||||
if [ "$OS" == 'debian' ] || [ "$OS" == 'ubuntu' ]; then
|
||||
echo "Downloading http://apt.puppetlabs.com/puppetlabs-release-${CODENAME}.deb"
|
||||
wget --quiet --tries=5 --timeout=10 -O "/.puphpet-stuff/puppetlabs-release-${CODENAME}.deb" "http://apt.puppetlabs.com/puppetlabs-release-${CODENAME}.deb"
|
||||
echo "Finished downloading http://apt.puppetlabs.com/puppetlabs-release-${CODENAME}.deb"
|
||||
|
||||
dpkg -i "/.puphpet-stuff/puppetlabs-release-${CODENAME}.deb" >/dev/null
|
||||
|
||||
echo "Running update-puppet apt-get update"
|
||||
apt-get update >/dev/null
|
||||
echo "Finished running update-puppet apt-get update"
|
||||
|
||||
echo "Updating Puppet to latest version"
|
||||
apt-get -y install puppet >/dev/null
|
||||
PUPPET_VERSION=$(puppet help | grep 'Puppet v')
|
||||
echo "Finished updating puppet to latest version: $PUPPET_VERSION"
|
||||
|
||||
touch /.puphpet-stuff/update-puppet
|
||||
echo "Created empty file /.puphpet-stuff/update-puppet"
|
||||
elif [ "$OS" == 'centos' ]; then
|
||||
echo "Downloading http://yum.puppetlabs.com/el/${RELEASE}/products/x86_64/puppetlabs-release-6-7.noarch.rpm"
|
||||
yum -y --nogpgcheck install "http://yum.puppetlabs.com/el/${RELEASE}/products/x86_64/puppetlabs-release-6-7.noarch.rpm" >/dev/null
|
||||
echo "Finished downloading http://yum.puppetlabs.com/el/${RELEASE}/products/x86_64/puppetlabs-release-6-7.noarch.rpm"
|
||||
|
||||
echo "Running update-puppet yum update"
|
||||
yum -y update >/dev/null
|
||||
echo "Finished running update-puppet yum update"
|
||||
|
||||
echo "Installing/Updating Puppet to latest version"
|
||||
yum -y install puppet >/dev/null
|
||||
PUPPET_VERSION=$(puppet help | grep 'Puppet v')
|
||||
echo "Finished installing/updating puppet to latest version: $PUPPET_VERSION"
|
||||
|
||||
touch /.puphpet-stuff/update-puppet
|
||||
echo "Created empty file /.puphpet-stuff/update-puppet"
|
||||
fi
|
||||
fi
|
||||
|
Before Width: | Height: | Size: 223 KiB |
BIN
doc/images/dolibarr_screenshot1_1280x800.png
Normal file
|
After Width: | Height: | Size: 254 KiB |
|
Before Width: | Height: | Size: 121 KiB |
|
Before Width: | Height: | Size: 221 KiB |
BIN
doc/images/dolibarr_screenshot2_1280x800.png
Normal file
|
After Width: | Height: | Size: 249 KiB |
|
Before Width: | Height: | Size: 167 KiB |
BIN
doc/images/dolibarr_screenshot3_1280x800.png
Normal file
|
After Width: | Height: | Size: 154 KiB |
|
Before Width: | Height: | Size: 166 KiB |
BIN
doc/images/dolibarr_screenshot4_1280x800.png
Normal file
|
After Width: | Height: | Size: 171 KiB |
|
Before Width: | Height: | Size: 175 KiB |
BIN
doc/images/dolibarr_screenshot9_1280x800.png
Normal file
|
After Width: | Height: | Size: 174 KiB |
@ -63,7 +63,7 @@ class AccountancyAccount
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."accountingaccount";
|
||||
$sql.= " (date_creation, fk_user_author, numero,intitule)";
|
||||
$sql.= " VALUES (".$this->db->idate($now).",".$user->id.",'".$this->numero."','".$this->intitule."')";
|
||||
$sql.= " VALUES ('".$this->db->idate($now)."',".$user->id.",'".$this->numero."','".$this->intitule."')";
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
|
||||
@ -62,7 +62,7 @@ class AccountancySystem
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."accounting_system";
|
||||
$sql.= " (date_creation, fk_user_author, numero,intitule)";
|
||||
$sql.= " VALUES (".$this->db->idate($now).",".$user->id.",'".$this->numero."','".$this->intitule."')";
|
||||
$sql.= " VALUES ('".$this->db->idate($now)."',".$user->id.",'".$this->numero."','".$this->intitule."')";
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
|
||||
@ -115,7 +115,7 @@ print_fiche_titre($langs->trans("MembersSetup"),$linkback,'setup');
|
||||
|
||||
$head = member_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'general', $langs->trans("Member"), 0, 'user');
|
||||
dol_fiche_head($head, 'general', $langs->trans("Members"), 0, 'user');
|
||||
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
@ -84,7 +84,7 @@ print_fiche_titre($langs->trans("MembersSetup"),$linkback,'setup');
|
||||
|
||||
$head = member_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'public', $langs->trans("Member"), 0, 'user');
|
||||
dol_fiche_head($head, 'public', $langs->trans("Members"), 0, 'user');
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
@ -206,7 +206,7 @@ if (! empty($conf->paybox->enabled) || ! empty($conf->paypal->enabled))
|
||||
print '</table>';
|
||||
|
||||
print '<center>';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||
print '<br><input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||
print '</center>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
@ -115,7 +115,7 @@ dol_htmloutput_errors($this->control->tpl['error'],$this->control->tpl['errors']
|
||||
|
||||
<?php echo $this->control->tpl['showend']; ?>
|
||||
|
||||
<?php if (! $user->societe_id) { ?>
|
||||
<?php if (empty($user->societe_id)) { ?>
|
||||
<div class="tabsAction">
|
||||
|
||||
<?php if ($user->rights->adherent->creer) { ?>
|
||||
|
||||
@ -338,7 +338,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
|
||||
}
|
||||
|
||||
// Create draft invoice
|
||||
$invoice->type=0;
|
||||
$invoice->type= Facture::TYPE_STANDARD;
|
||||
$invoice->cond_reglement_id=$customer->cond_reglement_id;
|
||||
if (empty($invoice->cond_reglement_id))
|
||||
{
|
||||
|
||||
@ -101,8 +101,8 @@ $now=dol_now();
|
||||
$sql = "SELECT count(*) as somme , d.fk_adherent_type";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t";
|
||||
$sql.= " WHERE d.entity IN (".getEntity().")";
|
||||
//$sql.= " AND d.statut = 1 AND ((t.cotisation = 0 AND d.datefin IS NULL) OR d.datefin >= ".$db->idate($now).')';
|
||||
$sql.= " AND d.statut = 1 AND d.datefin >= ".$db->idate($now);
|
||||
//$sql.= " AND d.statut = 1 AND ((t.cotisation = 0 AND d.datefin IS NULL) OR d.datefin >= '".$db->idate($now)."')";
|
||||
$sql.= " AND d.statut = 1 AND d.datefin >= '".$db->idate($now)."'";
|
||||
$sql.= " AND t.rowid = d.fk_adherent_type";
|
||||
$sql.= " GROUP BY d.fk_adherent_type";
|
||||
|
||||
|
||||
@ -411,11 +411,11 @@ if ($rowid > 0)
|
||||
}
|
||||
if ($filter == 'uptodate')
|
||||
{
|
||||
$sql.=" AND datefin >= ".$db->idate($now);
|
||||
$sql.=" AND datefin >= '".$db->idate($now)."'";
|
||||
}
|
||||
if ($filter == 'outofdate')
|
||||
{
|
||||
$sql.=" AND datefin < ".$db->idate($now);
|
||||
$sql.=" AND datefin < '".$db->idate($now)."'";
|
||||
}
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = 0;
|
||||
|
||||
@ -137,7 +137,7 @@ print "<br>\n";
|
||||
|
||||
$head=agenda_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'autoactions', $langs->trans("Agenda"));
|
||||
dol_fiche_head($head, 'autoactions', $langs->trans("Agenda"), 0, 'action');
|
||||
|
||||
print $langs->trans("AgendaAutoActionDesc")."<br>\n";
|
||||
print $langs->trans("OnlyActiveElementsAreShown").'<br>';
|
||||
|
||||
@ -74,7 +74,7 @@ print "<br>\n";
|
||||
|
||||
$head=agenda_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'attributes', $langs->trans("Agenda"));
|
||||
dol_fiche_head($head, 'attributes', $langs->trans("Agenda"), 0, 'action');
|
||||
|
||||
print $langs->trans("DefineHereComplementaryAttributes", $langs->transnoentitiesnoconv("Agenda")).'<br>'."\n";
|
||||
print '<br>';
|
||||
|
||||
@ -125,7 +125,7 @@ print '<br>';
|
||||
|
||||
$head=agenda_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'extsites', $langs->trans("Agenda"));
|
||||
dol_fiche_head($head, 'extsites', $langs->trans("Agenda"), 0, 'action');
|
||||
|
||||
print $langs->trans("AgendaExtSitesDesc")."<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
@ -84,7 +84,7 @@ print "<br>\n";
|
||||
|
||||
$head=agenda_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'other', $langs->trans("Agenda"));
|
||||
dol_fiche_head($head, 'other', $langs->trans("Agenda"), 0, 'action');
|
||||
|
||||
print_titre($langs->trans("OtherOptions"));
|
||||
|
||||
|
||||
@ -79,7 +79,7 @@ print '<br>';
|
||||
|
||||
$head=agenda_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'xcal', $langs->trans("Agenda"));
|
||||
dol_fiche_head($head, 'xcal', $langs->trans("Agenda"), 0, 'action');
|
||||
|
||||
print $langs->trans("AgendaSetupOtherDesc")."<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
@ -88,15 +88,6 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
|
||||
print_fiche_titre($langs->trans("BankSetupModule"),$linkback,'setup');
|
||||
print '<br>';
|
||||
|
||||
$h = 0;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/bank.php";
|
||||
$head[$h][1] = $langs->trans("Miscellaneous");
|
||||
$head[$h][2] = 'general';
|
||||
$hselected=$h;
|
||||
$h++;
|
||||
|
||||
dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
@ -218,7 +218,7 @@ print '<br>';
|
||||
|
||||
$head = order_admin_prepare_head(null);
|
||||
|
||||
dol_fiche_head($head, 'general', $langs->trans("ModuleSetup"), 0, 'order');
|
||||
dol_fiche_head($head, 'general', $langs->trans("Orders"), 0, 'order');
|
||||
|
||||
/*
|
||||
* Orders Numbering model
|
||||
|
||||
@ -139,7 +139,7 @@ if ( ($action == 'update' && empty($_POST["cancel"]))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MANAGERS",$_POST["MAIN_INFO_SOCIETE_MANAGERS"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_CAPITAL",$_POST["capital"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FORME_JURIDIQUE",$_POST["forme_juridique_code"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SIREN",$_POST["siren"],'chaine',0,'',$conf->entity);
|
||||
@ -377,6 +377,11 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
|
||||
$langs->load("companies");
|
||||
|
||||
// Managing Director(s)
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("ManagingDirectors").'</td><td>';
|
||||
print '<input name="MAIN_INFO_SOCIETE_MANAGERS" size="80" value="' . $conf->global->MAIN_INFO_SOCIETE_MANAGERS . '"></td></tr>';
|
||||
|
||||
// Capital
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("Capital").'</td><td>';
|
||||
@ -500,9 +505,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print '</table>';
|
||||
|
||||
|
||||
/*
|
||||
* Debut d'annee fiscale
|
||||
*/
|
||||
// Fiscal year start
|
||||
print '<br>';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
@ -517,9 +520,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print "</table>";
|
||||
|
||||
|
||||
/*
|
||||
* Options fiscale
|
||||
*/
|
||||
// Fiscal options
|
||||
print '<br>';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
@ -741,6 +742,11 @@ else
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("CompanyIds").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
$var=true;
|
||||
|
||||
// Managing Director(s)
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("ManagingDirectors").'</td><td>';
|
||||
print $conf->global->MAIN_INFO_SOCIETE_MANAGERS . '</td></tr>';
|
||||
|
||||
// Capital
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("Capital").'</td><td>';
|
||||
|
||||
@ -104,16 +104,6 @@ print_fiche_titre($langs->trans('ComptaSetup'),$linkback,'setup');
|
||||
|
||||
print '<br>';
|
||||
|
||||
$h = 0;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/compta.php";
|
||||
$head[$h][1] = $langs->trans("Accountancy");
|
||||
$head[$h][2] = 'Compta';
|
||||
$hselected=$h;
|
||||
$h++;
|
||||
|
||||
dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
// Cas du parametre COMPTA_MODE
|
||||
|
||||
@ -204,7 +204,7 @@ print "<br>";
|
||||
|
||||
$head=contract_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'contract', $langs->trans("ModuleSetup"));
|
||||
dol_fiche_head($head, 'contract', $langs->trans("Contracts"), 0, 'contract');
|
||||
|
||||
/*
|
||||
* Contracts Numbering model
|
||||
|
||||
@ -120,18 +120,6 @@ llxHeader('',$langs->trans("DonationsSetup"),'DonConfiguration');
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print_fiche_titre($langs->trans("DonationsSetup"),$linkback,'setup');
|
||||
print '<br>';
|
||||
|
||||
$h = 0;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/dons.php";
|
||||
$head[$h][1] = $langs->trans("Donations");
|
||||
$head[$h][2] = 'Donation';
|
||||
$hselected=$h;
|
||||
$h++;
|
||||
|
||||
dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
|
||||
|
||||
|
||||
// Document templates
|
||||
print '<br>';
|
||||
@ -167,6 +155,7 @@ print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td align="center" width="60">'.$langs->trans("Activated").'</td>';
|
||||
print '<td align="center" width="60">'.$langs->trans("Default").'</td>';
|
||||
print '<td align="center" width="80">'.$langs->trans("ShortInfo").'</td>';
|
||||
print '<td align="center" width="80">'.$langs->trans("Preview").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
clearstatcache();
|
||||
@ -245,10 +234,14 @@ if (is_resource($handle))
|
||||
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
||||
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
|
||||
$htmltooltip.='<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1);
|
||||
$text='<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'" target="specimen">'.img_object($langs->trans("Preview"),'generic').'</a>';
|
||||
print '<td align="center">';
|
||||
print $form->textwithpicto(' '.$text,$htmltooltip,-1,0);
|
||||
print $form->textwithpicto('',$htmltooltip,-1,0);
|
||||
print '</td>';
|
||||
|
||||
// Preview
|
||||
print '<td align="center">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'" target="specimen">'.img_object($langs->trans("Preview"),'generic').'</a>';
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
@ -72,16 +72,6 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
|
||||
print_fiche_titre($langs->trans("ECMSetup"),$linkback,'setup');
|
||||
print '<br>';
|
||||
|
||||
$h = 0;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/ecm.php";
|
||||
$head[$h][1] = $langs->trans("Miscellaneous");
|
||||
$head[$h][2] = 'general';
|
||||
$hselected=$h;
|
||||
$h++;
|
||||
|
||||
dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
|
||||
@ -32,6 +32,13 @@ $langs->load("admin");
|
||||
$langs->load("fckeditor");
|
||||
|
||||
$action = GETPOST('action','alpha');
|
||||
// Possible modes are:
|
||||
// dolibarr_details
|
||||
// dolibarr_notes
|
||||
// dolibarr_readonly
|
||||
// dolibarr_mailings
|
||||
// Full (not sure this one is used)
|
||||
$mode=GETPOST('mode')?GETPOST('mode','alpha'):'dolibarr_notes';
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
@ -152,10 +159,12 @@ else
|
||||
print '</table>'."\n";
|
||||
|
||||
print '<br>'."\n";
|
||||
print_fiche_titre($langs->trans("TestSubmitForm"),'','');
|
||||
print_fiche_titre($langs->trans("TestSubmitForm"),'(mode='.$mode.')','');
|
||||
print '<form name="formtest" method="POST" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
print '<input type="hidden" name="mode" value="'.dol_escape_htmltag($mode).'">';
|
||||
$uselocalbrowser=true;
|
||||
$editor=new DolEditor('formtestfield',isset($conf->global->FCKEDITOR_TEST)?$conf->global->FCKEDITOR_TEST:'Test','',200,'dolibarr_notes','In', true, $uselocalbrowser);
|
||||
$readonly=($mode=='dolibarr_readonly'?1:0);
|
||||
$editor=new DolEditor('formtestfield',isset($conf->global->FCKEDITOR_TEST)?$conf->global->FCKEDITOR_TEST:'Test','',200,$mode,'In', true, $uselocalbrowser, 1, 120, 8, $readonly);
|
||||
$editor->Create();
|
||||
print '<center><br><input class="button" type="submit" name="save" value="'.$langs->trans("Save").'"></center>'."\n";
|
||||
print '</form>'."\n";
|
||||
|
||||
@ -412,7 +412,7 @@ foreach ($dirmodels as $reldir)
|
||||
// Info
|
||||
$htmltooltip = ''.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
|
||||
$htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
||||
$htmltooltip.='<br><br>'.$langs->trans("FeaturesSupported").':';
|
||||
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").'</u>:';
|
||||
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
|
||||
print '<td align="center">';
|
||||
print $form->textwithpicto('',$htmltooltip,1,0);
|
||||
|
||||
@ -80,16 +80,6 @@ llxHeader('',$langs->trans("MailingSetup"));
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print_fiche_titre($langs->trans("MailingSetup"),$linkback,'setup');
|
||||
|
||||
$h = 0;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/mailing.php";
|
||||
$head[$h][1] = $langs->trans("Miscellaneous");
|
||||
$head[$h][2] = 'general';
|
||||
$hselected=$h;
|
||||
$h++;
|
||||
|
||||
dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
|
||||
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
{
|
||||
print "\n".'<script type="text/javascript">';
|
||||
|
||||
@ -75,7 +75,7 @@ print "<br>\n";
|
||||
|
||||
$head = order_admin_prepare_head(null);
|
||||
|
||||
dol_fiche_head($head, 'attributes', $langs->trans("ModuleSetup"), 0, 'order');
|
||||
dol_fiche_head($head, 'attributes', $langs->trans("Orders"), 0, 'order');
|
||||
|
||||
|
||||
print $langs->trans("DefineHereComplementaryAttributes",$textobject).'<br>'."\n";
|
||||
|
||||
@ -76,7 +76,7 @@ print "<br>\n";
|
||||
|
||||
$head = order_admin_prepare_head(null);
|
||||
|
||||
dol_fiche_head($head, 'attributeslines', $langs->trans("ModuleSetup"), 0, 'order');
|
||||
dol_fiche_head($head, 'attributeslines', $langs->trans("Orders"), 0, 'order');
|
||||
|
||||
|
||||
print $langs->trans("DefineHereComplementaryAttributes",$textobject).'<br>'."\n";
|
||||
|
||||
@ -119,16 +119,6 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
|
||||
print_fiche_titre($langs->trans("WithdrawalsSetup"),$linkback,'setup');
|
||||
print '<br>';
|
||||
|
||||
$h = 0;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/prelevement.php";
|
||||
$head[$h][1] = $langs->trans("Withdrawals");
|
||||
$head[$h][2] = 'Withdrawal';
|
||||
$hselected=$h;
|
||||
$h++;
|
||||
|
||||
dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
|
||||
|
||||
print '<form method="post" action="prelevement.php?action=set">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
@ -165,12 +155,16 @@ print '<center><input type="submit" class="button" value="'.$langs->trans("Save"
|
||||
|
||||
print '</form>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
/*
|
||||
* Notifications
|
||||
*/
|
||||
|
||||
/* Disable this, there is no trigger with elementtype 'withdraw'
|
||||
if (! empty($conf->global->MAIN_MODULE_NOTIFICATION))
|
||||
{
|
||||
$langs->load("mails");
|
||||
@ -242,41 +236,43 @@ if (! empty($conf->global->MAIN_MODULE_NOTIFICATION))
|
||||
print '</td>';
|
||||
|
||||
print '<td align="right"><input type="submit" class="button" value="'.$langs->trans("Add").'"></td></tr>';
|
||||
|
||||
// List of current notifications for objet_type='withdraw'
|
||||
$sql = "SELECT u.lastname, u.firstname,";
|
||||
$sql.= " nd.rowid, ad.code, ad.label";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."notify_def as nd,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."c_action_trigger as ad";
|
||||
$sql.= " WHERE u.rowid = nd.fk_user";
|
||||
$sql.= " AND nd.fk_action = ad.rowid";
|
||||
$sql.= " AND u.entity IN (0,".$conf->entity.")";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
$var = false;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
$var=!$var;
|
||||
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td>'.dolGetFirstLastname($obj->firstname,$obj->lastname).'</td>';
|
||||
$label=($langs->trans("Notify_".$obj->code)!="Notify_".$obj->code?$langs->trans("Notify_".$obj->code):$obj->label);
|
||||
print '<td>'.$label.'</td>';
|
||||
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=deletenotif&notif='.$obj->rowid.'">'.img_delete().'</a></td>';
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
$db->free($resql);
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
}
|
||||
// List of current notifications for objet_type='withdraw'
|
||||
$sql = "SELECT u.lastname, u.firstname,";
|
||||
$sql.= " nd.rowid, ad.code, ad.label";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."notify_def as nd,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."c_action_trigger as ad";
|
||||
$sql.= " WHERE u.rowid = nd.fk_user";
|
||||
$sql.= " AND nd.fk_action = ad.rowid";
|
||||
$sql.= " AND u.entity IN (0,".$conf->entity.")";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
$var = false;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
$var=!$var;
|
||||
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td>'.dolGetFirstLastname($obj->firstname,$obj->lastname).'</td>';
|
||||
$label=($langs->trans("Notify_".$obj->code)!="Notify_".$obj->code?$langs->trans("Notify_".$obj->code):$obj->label);
|
||||
print '<td>'.$label.'</td>';
|
||||
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=deletenotif&notif='.$obj->rowid.'">'.img_delete().'</a></td>';
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
$db->free($resql);
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
*/
|
||||
|
||||
$db->close();
|
||||
|
||||
|
||||
@ -77,6 +77,16 @@ if($action)
|
||||
if($action == 'STOCK_USE_VIRTUAL_STOCK') {
|
||||
$res = dolibarr_set_const($db, "STOCK_USE_VIRTUAL_STOCK", GETPOST('STOCK_USE_VIRTUAL_STOCK','alpha'),'chaine',0,'',$conf->entity);
|
||||
}
|
||||
|
||||
if($action == 'STOCK_MUST_BE_ENOUGH_FOR_INVOICE') {
|
||||
$res = dolibarr_set_const($db, "STOCK_MUST_BE_ENOUGH_FOR_INVOICE", GETPOST('STOCK_MUST_BE_ENOUGH_FOR_INVOICE','alpha'),'chaine',0,'',$conf->entity);
|
||||
}
|
||||
if($action == 'STOCK_MUST_BE_ENOUGH_FOR_ORDER') {
|
||||
$res = dolibarr_set_const($db, "STOCK_MUST_BE_ENOUGH_FOR_ORDER", GETPOST('STOCK_MUST_BE_ENOUGH_FOR_ORDER','alpha'),'chaine',0,'',$conf->entity);
|
||||
}
|
||||
if($action == 'STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT') {
|
||||
$res = dolibarr_set_const($db, "STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT", GETPOST('STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT','alpha'),'chaine',0,'',$conf->entity);
|
||||
}
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
@ -101,17 +111,6 @@ llxHeader('',$langs->trans("StockSetup"));
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print_fiche_titre($langs->trans("StockSetup"),$linkback,'setup');
|
||||
print '<br>';
|
||||
|
||||
$h = 0;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/stock.php";
|
||||
$head[$h][1] = $langs->trans("Miscellaneous");
|
||||
$head[$h][2] = 'general';
|
||||
$hselected=$h;
|
||||
$h++;
|
||||
|
||||
dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
|
||||
|
||||
$form=new Form($db);
|
||||
$var=true;
|
||||
@ -247,6 +246,60 @@ if (! empty($conf->fournisseur->enabled))
|
||||
|
||||
print '</table>';
|
||||
|
||||
// Optio to force stock to be enough before adding a line into document
|
||||
print '<br>';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print " <td>".$langs->trans("RuleForStockAvailability")."</td>\n";
|
||||
print " <td align=\"right\" width=\"160\"> </td>\n";
|
||||
print '</tr>'."\n";
|
||||
|
||||
if($conf->invoice->enabled) {
|
||||
$var = !$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td width="60%">'.$langs->trans("StockMustBeEnoughForInvoice").'</td>';
|
||||
print '<td width="160" align="right">';
|
||||
print "<form method=\"post\" action=\"stock.php\">";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_MUST_BE_ENOUGH_FOR_INVOICE\">";
|
||||
print $form->selectyesno("STOCK_MUST_BE_ENOUGH_FOR_INVOICE",$conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE,1);
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||
print '</form>';
|
||||
print "</td>\n";
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
if($conf->order->enabled) {
|
||||
$var = !$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td width="60%">'.$langs->trans("StockMustBeEnoughForOrder").'</td>';
|
||||
print '<td width="160" align="right">';
|
||||
print "<form method=\"post\" action=\"stock.php\">";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_MUST_BE_ENOUGH_FOR_ORDER\">";
|
||||
print $form->selectyesno("STOCK_MUST_BE_ENOUGH_FOR_ORDER",$conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER,1);
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||
print '</form>';
|
||||
print "</td>\n";
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
if($conf->expedition->enabled) {
|
||||
$var = !$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td width="60%">'.$langs->trans("StockMustBeEnoughForShipment").'</td>';
|
||||
print '<td width="160" align="right">';
|
||||
print "<form method=\"post\" action=\"stock.php\">";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT\">";
|
||||
print $form->selectyesno("STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT",$conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT,1);
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||
print '</form>';
|
||||
print "</td>\n";
|
||||
print "</tr>\n";
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
|
||||
$virtualdiffersfromphysical=0;
|
||||
if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)
|
||||
|
||||
@ -200,7 +200,7 @@ print "<br>";
|
||||
|
||||
$head = supplierorder_admin_prepare_head(null);
|
||||
|
||||
dol_fiche_head($head, 'invoice', $langs->trans("ModuleSetup"));
|
||||
dol_fiche_head($head, 'invoice', $langs->trans("Suppliers"), 0, 'company');
|
||||
|
||||
|
||||
// Supplier invoice numbering module
|
||||
|
||||
@ -200,7 +200,7 @@ print "<br>";
|
||||
|
||||
$head = supplierorder_admin_prepare_head(null);
|
||||
|
||||
dol_fiche_head($head, 'order', $langs->trans("ModuleSetup"));
|
||||
dol_fiche_head($head, 'order', $langs->trans("Suppliers"), 0, 'company');
|
||||
|
||||
|
||||
// Supplier order numbering module
|
||||
|
||||
@ -37,7 +37,7 @@ if (!$user->admin)
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("other");
|
||||
$langs->load("orders");
|
||||
$langs->load("bills");
|
||||
$langs->load("suppliers");
|
||||
|
||||
$extrafields = new ExtraFields($db);
|
||||
@ -67,7 +67,7 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
|
||||
* View
|
||||
*/
|
||||
|
||||
$textobject=$langs->transnoentitiesnoconv("SuppliersInvoices");
|
||||
$textobject=$langs->transnoentitiesnoconv("BillsSuppliers");
|
||||
|
||||
llxHeader('',$langs->trans("SuppliersSetup"));
|
||||
|
||||
@ -77,7 +77,7 @@ print "<br>\n";
|
||||
|
||||
$head = supplierorder_admin_prepare_head(null);
|
||||
|
||||
dol_fiche_head($head, 'supplierinvoice', $langs->trans("ModuleSetup"), 0, 'invoice');
|
||||
dol_fiche_head($head, 'supplierinvoice', $langs->trans("Suppliers"), 0, 'company');
|
||||
|
||||
|
||||
print $langs->trans("DefineHereComplementaryAttributes",$textobject).'<br>'."\n";
|
||||
|
||||
@ -75,7 +75,7 @@ print "<br>\n";
|
||||
|
||||
$head = supplierorder_admin_prepare_head(null);
|
||||
|
||||
dol_fiche_head($head, 'supplierorder', $langs->trans("ModuleSetup"), 0, 'order');
|
||||
dol_fiche_head($head, 'supplierorder', $langs->trans("Suppliers"), 0, 'company');
|
||||
|
||||
|
||||
print $langs->trans("DefineHereComplementaryAttributes",$textobject).'<br>'."\n";
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
*
|
||||
@ -63,33 +63,17 @@ print '<tr '.$bc[0].'><td width="300"><a href="'.DOL_URL_ROOT.'/admin/system/dat
|
||||
print '</table>';
|
||||
|
||||
|
||||
$base=0;
|
||||
$sqls = array();
|
||||
if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli')
|
||||
{
|
||||
$sqls[0] = "SHOW VARIABLES"; // TODO Use function getServerParametersValues
|
||||
$sqls[1] = "SHOW STATUS"; // TODO Use function getServerStatusValues
|
||||
$base=1;
|
||||
}
|
||||
else if ($conf->db->type == 'pgsql')
|
||||
{
|
||||
$sqls[0] = "select name,setting from pg_settings"; // TODO function getServerParametersValues
|
||||
//$sqls[1] = ""; // TODO Use function getServerStatusValues
|
||||
$base=2;
|
||||
}
|
||||
else if ($conf->db->type == 'mssql')
|
||||
{
|
||||
//$sqls[0] = "";
|
||||
//$base=3;
|
||||
}
|
||||
$listofvars=$db->getServerParametersValues();
|
||||
$listofstatus=$db->getServerStatusValues();
|
||||
$arraylist=array('listofvars','listofstatus');
|
||||
|
||||
if (! $base)
|
||||
if (! count($listofvars) && ! count($listofstatus))
|
||||
{
|
||||
print $langs->trans("FeatureNotAvailableWithThisDatabaseDriver");
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach($sqls as $sql)
|
||||
foreach($arraylist as $listname)
|
||||
{
|
||||
print '<br>';
|
||||
print '<table class="noborder" width="100%">';
|
||||
@ -97,7 +81,7 @@ else
|
||||
print '<td width="300">'.$langs->trans("Parameters").'</td>';
|
||||
print '<td>'.$langs->trans("Value").'</td>';
|
||||
print '</tr>'."\n";
|
||||
|
||||
|
||||
// arraytest is an array of test to do
|
||||
$arraytest=array();
|
||||
if (preg_match('/mysql/i',$db->type))
|
||||
@ -107,38 +91,37 @@ else
|
||||
'collation_database'=>array('var'=>'dolibarr_main_db_collation','valifempty'=>'utf8_general_ci')
|
||||
);
|
||||
}
|
||||
|
||||
$listtouse=array();
|
||||
if ($listname == 'listofvars') $listtouse=$listofvars;
|
||||
if ($listname == 'listofstatus') $listtouse=$listofstatus;
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
$var=true;
|
||||
foreach($listtouse as $param => $paramval)
|
||||
{
|
||||
$var=True;
|
||||
while ($row = $db->fetch_row($resql))
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>';
|
||||
print $param;
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
$show=0;$text='';
|
||||
foreach($arraytest as $key => $val)
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>';
|
||||
print $row[0];
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
$show=0;$text='';
|
||||
foreach($arraytest as $key => $val)
|
||||
{
|
||||
if ($key != $row[0]) continue;
|
||||
$val2=${$val['var']};
|
||||
$text='Should be in line with value of param <b>'.$val['var'].'</b> thas is <b>'.($val2?$val2:"'' (=".$val['valifempty'].")").'</b>';
|
||||
$show=1;
|
||||
}
|
||||
if ($show==0) print $row[1];
|
||||
if ($show==1) print $form->textwithpicto($row[1],$text);
|
||||
if ($show==2) print $form->textwithpicto($row[1],$text,1,'warning');
|
||||
print '</td>';
|
||||
print '</tr>'."\n";
|
||||
if ($key != $param) continue;
|
||||
$val2=${$val['var']};
|
||||
$text='Should be in line with value of param <b>'.$val['var'].'</b> thas is <b>'.($val2?$val2:"'' (=".$val['valifempty'].")").'</b>';
|
||||
$show=1;
|
||||
}
|
||||
$db->free($resql);
|
||||
if ($show==0) print $paramval;
|
||||
if ($show==1) print $form->textwithpicto($paramval,$text);
|
||||
if ($show==2) print $form->textwithpicto($paramval,$text,1,'warning');
|
||||
print '</td>';
|
||||
print '</tr>'."\n";
|
||||
}
|
||||
print '</table>'."\n";
|
||||
}
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
?>
|
||||
?>
|
||||