SWF-2071 : reorder columns
SWF-2071 : Add a column in the list with the status of the server (running or not based on the pid check)
SWF-2071 : Use functions to setup vars
SWF-2071 :
* Major refactoring to simplify patches management
* Better DL management
* Usage of env vars instead of parameters

New doc and options (default behavior is more oriented for developers - no apache, no awstats, no ufw, no mysql)

This project is a set of tools used to automate the deployment of eXo products for testing purpose.

How to use ?
============

Prerequisites
------------------------

Mandatory :

* A Java 6 JVM available in the PATH

Optional :

  * A mysql server with a local configuration (~/.my.cnf) that allows the current system user to create databases and grant rights. You can activate the usage of MySQL with the environment variable : DEPLOYMENT_DATABASE_TYPE=MYSQL
  * An apache server to display the list of instances and to create a reverse proxy for all instances. Deactivated by default you can activate this feature with the environment variable : DEPLOYMENT_SETUP_APACHE=true
  * An UFW firewall to protect your (ubuntu server). The script will automatically open or close required ports (HTTP, JMX, ...). Deactivated by default you can activate this feature with the environment variable : DEPLOYMENT_SETUP_UFM=true
  * An awstats instance to keep statistics of usage. Deactivated by default you can activate this feature with the environment variable : DEPLOYMENT_SETUP_AWSTATS=true

Prepare your environment
------------------------
Fork this project :

    git clone git://github.com/exoplatform/adt.git

Define the environment variable ADT_DATA, which will be the path to a working directory used by ADT.

    export ADT_DATA=$HOME/adt_data

You can also define your settings in $HOME/.adtrc or in /etc/default/adt

You're ready to go
------------------

Deploy a server : download and configure it

    # adt.sh deploy social 1.3.0-SNAPSHOT

Start a server : start a deployed instance

    # adt.sh start social 1.3.0-SNAPSHOT

Stop a server : stop a deployed instance

    # adt.sh stop social 1.3.0-SNAPSHOT

Restart a server : restart a deployed instance

    # adt.sh restart social 1.3.0-SNAPSHOT

Undeploy a server : stop a deployed instance if already running and delete it.

    # adt.sh undeploy social 1.3.0-SNAPSHOT

List all deployed instances

    # adt.sh list

Usage
-----

    usage: ./adt.sh <action>

    This script manages automated deployment of eXo products for testing purpose.

    Action :
      deploy       Deploys (Download+Configure) the server
      start        Starts the server
      stop         Stops the server
      restart      Restarts the server
      undeploy     Undeploys (deletes) the server

      start-all    Starts all deployed servers
      stop-all     Stops all deployed servers
      restart-all  Restarts all deployed servers
      undeploy-all Undeploys (deletes) all deployed servers
      list         Lists all deployed servers

    Environment Variables :

      They may be configured in the current shell environment or /etc/default/adt or $HOME/.adtrc

      PRODUCT_NAME                  : The product you want to manage. Possible values are :
        gatein       GateIn Community edition
        exogtn       GateIn eXo edition
        webos        eXo WebOS
        social       eXo Social
        ecms         eXo Content
        ks           eXo Knowledge
        cs           eXo Collaboration
        plf          eXo Platform
        plfcom       eXo Platform Community
        plftrial     eXo Platform Trial
        compint      eXo Company Intranet
        docs         eXo Platform Documentations Website
        android      eXo Mobile Android
      PRODUCT_VERSION               : The version of the product. Can be either a release, a snapshot (the latest one) or a timestamped snapshot

      ADT_DATA                      : The path where data have to be stored (default: under the script path - /Users/arnaud/Code/eXo/adt)
      DEPLOYMENT_SETUP_APACHE       : Do you want to setup the apache configuration (default: false)
      DEPLOYMENT_SETUP_AWSTATS      : Do you want to setup the awstats configuration (default: false)
      DEPLOYMENT_SETUP_UFW          : Do you want to setup the ufw firewall configuration (default: false)
      DEPLOYMENT_AJP_PORT           : AJP Port (default: 8009)
      DEPLOYMENT_HTTP_PORT          : HTTP Port (default: 8080)
      DEPLOYMENT_SHUTDOWN_PORT      : SHUTDOWN Port (default: 8005)
      DEPLOYMENT_RMI_REG_PORT       : RMI Registry Port for JMX (default: 10001)
      DEPLOYMENT_RMI_SRV_PORT       : RMI Server Port for JMX (default: 10002)
      DEPLOYMENT_DATABASE_TYPE      : Which database do you want to use for your deployment ? (default: HSQLDB, values : HSQLDB | MYSQL)
      ACCEPTANCE_HOST               : The hostname (vhost) where is deployed the acceptance server (default: acceptance.exoplatform.org)
      CROWD_ACCEPTANCE_APP_NAME     : The crowd application used to authenticate the front-end (default: none)
      CROWD_ACCEPTANCE_APP_PASSWORD : The crowd application''s password used to authenticate the front-end (default: none)
      KEEP_DB                       : Keep the current database content for MYSQL. By default the deployment process drops the database if it already exists. (default: false)

      REPOSITORY_SERVER_BASE_URL    : The Maven repository URL used to download artifacts (default: https://repository.exoplatform.org)
      REPOSITORY_USERNAME           : The username to logon on $REPOSITORY_SERVER_BASE_URL if necessary (default: none)
      REPOSITORY_PASSWORD           : The password to logon on $REPOSITORY_SERVER_BASE_URL if necessary (default: none)

      ADT_DEBUG                     : Display debug details (default: false)
Fix possible empty vars
Fix versions