eZ Launchpad

An tool that will help you build an eZ Platform project on top of Docker in less than 5 minutes.

Demo

This is a demo of an initialization. Starting from scratch you will get everything ready to code, commit and push!

This is a demo of a creation. Starting from a git repository you will get everything ready to code, commit and push!

Installation


If you have curl installed:

$ curl -LSs https://ezsystems.github.io/launchpad/install_curl.bash | bash

If you have wget installed:

$ wget -O - "https://ezsystems.github.io/launchpad/install_wget.bash" | bash

Usage

When you have installed eZ Launchpad (~/ez) you can start enjoying the feature.

eZ Launchpad provides 2 mains features:

  • Initialization of a brand new eZ Platform Stack (on top of Docker)
  • Create the Docker Stack related to the current directory.
$ export BLACKFIRE_CLIENT_ID=xxxx-xxxx-xxxx-xxxx-xxxxx
export BLACKFIRE_CLIENT_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
export BLACKFIRE_SERVER_ID=xxxx-xxxx-xxxx-xxxx-xxxxx
export BLACKFIRE_SERVER_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Initialization

That is the from scratch installation. You need to do that when you have nothing and you want to start a new project with eZ Platform.

$ ~/ez init

From here eZ Launchpad will ask you a bunch of question to configure your project.

At the end of the procedure those steps will be done for you:

  • Configuration your project locally.
  • Download(pull) the correct image on your Docker Daemon.
  • Set up a eZ compliant docker-compose.yml.
  • Create and start the containers required.(depending of the choices you made)
  • Install Composer in the Engine container.(where PHP is executed in your Stack)
  • Install eZ Platform through Composer inside the stack.

Once the Initialization is finished, the project is up, you can check doing:

$ ~/ez ps

You are now ready dump the database and storage, git commit and push to share the project to your teams.

$ ~/ez dumpdata; git init; git add .; git commit -m "First Initial Commit"
$ git remote add origin https://gitorigin.com/xxx/xxxx-xxx.git; git push -u origin master

eZ Platform Enterprise

Whether you want to use an entreprise version or a non-stable, you have the choice! Look at the help. There is an example:

$ ~/ez init ezsystems/ezplatform-ee v1.9.0-rc1

When eZ Launchpad will ask you about HTTP-BASIC, then you have to provide the Installation Key and the Token.

Create

In this context you have already a project somewhere, someone already did a ~/ez init

Then it most likely that you did

$ git clone https://SOMETHING.git

If you want to know if your project is eZ Launchpad ready, you can just check the existance of .ezlaunchpad.yml at the root directory of your project.

To create the local stack the command is then

$ ~/ez create

Here eZ Launchpad will pull the images, create the containers of your stack as well a importing the database/storage.

Deployment

eZ Launchpad can help you to deploy as well. Even if it is optional and you can deploy the way you want we wanted to provide simplifications.

Setup

Platform.sh is a PaaS (Platform as a Service)
With Platform.sh there is no real deployment process to run manually. Platform.sh will just create and synchronize environments based on your git repository!

eZ Launchpad provides you a way to set up your eZ Project to be Platform.sh ready.

$ ~/ez platformsh:setup

This command will create and generate files required by Platform.sh. Because eZ Launchpad knows your project and the services you need it will adapt the Plaftorm.sh configuration files to it.

Here is the list of files that are going to be created.

.platform/services.yaml
.platform/routes.yaml
.platform.app.yaml
ezplatform/app/config/env/platformsh.php

Because you will need to initialize the database and the storage on Platform.sh (the first time), eZ Launchpad will also create a dump.

Deploy

As mentioned there is not real "deployment" process, this command will just display some documentation.

$ ~/ez platformsh:deploy

Coming soon...

Stack

At anytime you can get information on your stack by running

$ ~/ez info

Depending on the initialization, you might have more or less services, but here are the most common stack.

LEMP: Linux Nginx Mysql/MariaDB PHP-FPM

LAMP: Linux Apache Mysql/MariaDB PHP(mod_php)

Common Commands

eZ Launchpad is done to help you with a local Docker stack.

To do so, here is the command available to you:

$ ~/ez
                
Usage:
  command [options] [arguments]

Available commands:
  help               Displays help for a command
  list               Lists commands
  rollback           Rollback an update.
  self-update        Self Update
 docker
  docker:build       [build] Build all the services (or just one).
  docker:clean       [docker:down|clean|down] Clean all the services.
  docker:comprun     [comprun] Run Composer command in the engine.
  docker:create      [create] Create all the services.
  docker:dumpdata    [dumpdata] Dump Database and Storage.
  docker:enter       [enter|docker:exec|exec] Enter in a container.
  docker:importdata  [importdata] Import Database and Storage.
  docker:initialize  [docker:init|initialize|init] Initialize the project and all the services.
  docker:logs        [logs|log] Display the logs.
  docker:sfrun       [sfrun] Run a Symfony command in the engine.
  docker:start       [start] Start all the services (or just one).
  docker:status      [docker:ps|docker:info|ps|info] Obtaining the project information.
  docker:stop        [stop] Stop all the services (or just one).
  docker:up          [up] Up all the services (or just one).
  docker:update      Update to last images.
 platformsh
  platformsh:deploy  [psh:deploy] Deploy with Platformsh integration.
  platformsh:setup   [psh:setup] Set up the Platformsh integration.

Global configuration

Because every project can share stuff and because you might want the same configuration everywhere. eZ Launchpad read a configuration file in your HOME directory.

This configuration file is ~/ezlaunchpad/ez.yml. Here is a full example:

docker:
    host_machine_mapping: "/Users/bob/MyProjects:/data/MYPROJECTS"
    host_composer_cache_dir: "/data/MYPROJECTS/.composer_cache"

provisioning:
    folder_name: "myprovisioningfoldername"

composer:
    http_basic:
        hostname:
            host: www.hostname.com
            login: login
            password: pass
    token:
        github:
            host: github.com
            value: tokenvalue

Note that this configuration is global and won't be including in the project (i.e in the CVS repository). But it will be including in your local stack.

docker section is described in the next section.

Mac OS X optimizations with D4M

When it comes to share folder from the Host(your mac) to containers Docker for Mac is slow. (at least for now). Then to manage this performance issue, there is a workaround.

This workaround is called D4M. Without entering into the details, D4M uses the MobbyVM that runs beside Docker for Mac and NFS mounts your mac.

Note: It might be odd, but yes NFS is faster than the default mount.

Still when you use D4M, you can set it up:

  • in a transparent way: Then no configuration is required with eZ Launchpad
  • limitating the folder that you export: In this case, you need to tell it to eZ Launchpad

If you have customized the D4M configuration, let's say, that you have exported

# /etc/exports
/Users/bob/MyProjects -mapall=bob:staff localhost
            

And you have mounted this exported folder in /data/MYPROJECTS in the MobyVM (through D4M). Then you need to add this configuration for eZ Launchpad

# ~/.ezlaunchpad/ez.yml
docker:
    host_machine_mapping: "/Users/bob/MyProjects:/data/MYPROJECTS"
    host_composer_cache_dir: "/data/MYPROJECTS/.composer_cache"
            

host_composer_cache_dir will allow you to share the composer cache for all your projects.