The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

App::Padadoy - Simply deploy PSGI applications

VERSION

version 0.122

SYNOPSIS

Create a new application and start it locally on your development machine:

  $ padadoy create Your::Module
  $ plackup app/app.psgi

Start application locally as deamon with bundled dependencies

  $ padadoy cartontest
  $ padadoy start

Show status of your running application and stop it $ padadoy status $ padadoy stop

Deploy the application at dotCloud

  $ dotcloud create nameoryourapp
  $ dotcloud push nameofyourapp

Collect your application files in a git repository

  $ git init
  $ git add * logs/.gitignore
  $ git add -f logs/.gitignore
  $ git commit -m "inial commit"

Prepare your deployment machine

  $ padadoy init

Add your deployment machine as git remote and deploy

  $ git remote add ...
  $ git push prod master

DESCRIPTION

padadoy is a simple script to facilitate deployment of Plack and/or Dancer applications, inspired by http://dotcloud.com. It is based on Carton module dependency manager, Starman webserver, and git.

Your application must be managed in a git repository with following structure:

    app/
       app.psgi      - application startup script
       lib/          - local perl modules (at least the actual application)
       t/            - unit tests
       Makefile.PL   - used to determine required modules and to run tests
       deplist.txt   - a list of perl modules required to run (o)
      
    data/            - persistent data (o)

    dotcloud.yml     - basic configuration for dotCloud (o)
    
    libs -> app/lib                - symlink for OpenShift (o)
    deplist.txt -> app/deplist.txt - symlink for OpenShift (o)

    .openshift/      - hooks for OpenShift (o)
       action_hooks/ - scripts that get run every git push (o)

    logs/            - logfiles (access and error)

This structure can quickly be created with padadoy create or padadoy create Your::App::Module. Files and directories marked by `(o)` are optional, depending on whether you also want to deploy at dotcloud and/or OpenShift.

After some initalization, you can simply deploy new versions with `git push`.

For each deployment machine you create a remote repository and initialize it:

  $ padadoy init

You may then edit the file padadoy.conf to adjust the port and other settings. Back on another machine you can simply push to the deployment repository with git push. padadoy init installs some hooks in the deployment repository so new code is first tested before activation.

This is an early preview release, be warned!

METHODS

new ( [$configfile] [%configvalues] )

Start padadoy, optionally with some configuration. The command line client used ./padadoy.conf or ~/padadoy.conf as config files.

create

Create an application boilerplate.

deplist

List dependencies (not implemented yet).

init

Initialize on your deployment machine.

config

Show configuration values.

restart

Start or gracefully restart the application if running.

start

Start starman webserver with carton.

stop

Stop starman webserver.

status

Show some status information.

method cartontest

Update dependencies with carton and run tests.

DEPLOYMENT

Actually, you don't need padadoy if you only deploy at some PaaS provider, but deployment at dotCloud and OpenShift is also documented below for convenience.

On your own server

The following should work at least with a fresh Ubuntu installation and Perl >= 5.10. First you need to install git, a build toolchain, and cpanminus:

  $ sudo apt-get install git-core build-essential lbssl-dev
  $ wget -O - http://cpanmin.us | sudo perl - --self-upgrade

Now you can install padadoy from CPAN:

  $ sudo cpanm App::Padadoy

Depending on the Perl modules your application requires, you may need some additional packages, such as libexpat1-dev for XML. For instance for HTTPS you need LWP::Protocol::https that requires libnet-ssleay-perl to build:

  $ sudo apt-get install libnet-ssleay-perl
  $ sudo cpanm LWP::Protocol::https

On dotCloud

Create a dotCloud account and install the command line client as documented at https://docloud.com.

On OpenShift

Create an OpenShift account, install the command line client, and create a domain, as documented at https://openshift.redhat.com/app/getting_started (you may need to sudo apt-get install libopenssl-ruby, and to find and fiddle around the client at /var/lib/gems/1.8/bin/rhc to actually make use of it). Actually, I have not manage to deploy at OpenShift as seamless as at dotCloud.

SEE ALSO

There are many ways to deploy PSGI applications. See this presentation by Tatsuhiko Miyagawa for an overview:

http://www.slideshare.net/miyagawa/deploying-plack-web-applications-oscon-2011-8706659

By now, padadoy only supports Starman web server, but it might be easy to support more.

This should also work on Amazon EC2 but I have not tested yet. See for instance http://www.deepakg.com/prog/2011/01/deploying-a-perl-dancer-application-on-amazon-ec2/.

FAQ

What does "padadoy" mean? The funny name was derived from "PlAck DAncer DeplOYment" but it does not mean anything.

AUTHOR

Jakob Voß

COPYRIGHT AND LICENSE

This software is copyright (c) 2012 by Jakob Voß.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 568:

Non-ASCII character seen before =encoding in 'Voß'. Assuming UTF-8