2017 © Pedro Peláez
 

library client

Zero downtime deployment using just FTP and PHP

image

atomic-deploy/client

Zero downtime deployment using just FTP and PHP

  • Thursday, December 28, 2017
  • by neon64
  • Repository
  • 1 Watchers
  • 0 Stars
  • 17 Installations
  • Shell
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 12 Versions
  • 0 % Grown

The README.md

AtomicDeploy

Latest Stable Version License, (*1)

This command utility connects with atomic-deploy/server in order to deploy websites atomically to hosting without SSH access., (*2)

Why? Its 2020, there's DigitalOcean, Docker, microservices, Azure, Heroku. Why do I need this? Well the unfortunate reality is many clients are still stuck on ancient shared web hosting. This gives a slightly nicer experience for the developer whilst still working without SSH access., (*3)

How? Though there are FTP components built into this client, namely GitFtpCommand and ComposerTransferInstalledCommand, the current recommended way is to pull each deployment from scratch from a Git repository. atomic-deploy/server will then facilitate running things like composer install, despite not having any SSH access to the server itself., (*4)

AtomicDeploy will allow you to have multiple deployments of your website on the server at the same time, and they can be switched between using an atomic rename file operation which just switches a symlink over. In the ideal world, this will allow for zero-downtime deployments., (*5)

Security

Of course, the atomic-deploy/server installation needs to be placed behind some form of password barrier, as it is basically as powerful as cPanel when it comes to wreaking havoc on a shared webhosting installation., (*6)

Usage

To see a list of current deployments, run, (*7)

$ adp ls

To push the latest version, (*8)

$ adp push

To switch between versions, (*9)

$ adp use [desired_git_commit]

Configuration file

The adp command should be run from the directory of your website. That directory should contain a deploy.php file which stores configuration for the deployment. He is an example configuration file:, (*10)

<?php

return [
    'ftp' => [
        'username' => getenv('FTP_USERNAME'),
        'password' => getenv('FTP_PASSWORD'),
        'host' => getenv('FTP_HOST'),
        'port' => 21,
        'timeout' => 90,
        'passive' => true
    ],

    'server' => [
        'url' => 'http://secure.example.com/deploy/index.php',
        'username' => getenv('DEPLOY_SERVER_USERNAME'),
        'password' => getenv('DEPLOY_SERVER_PASSWORD')
    ],

    'path' => [
        'shared' => 'shared',
        'current' => 'current',
        'next' => 'next'
    ],

    'basePath' => [
        /**
         * The path to the deployments folder, relative to this file.
         */
        'server' => '/path/on/server/to/website_deployments',

        /**
         * The path to the deployments folder, relative to the FTP root
         */
        'ftp' => 'website_deployments',
    ],

    'shared' => [
        '.env',
        'storage/framework',
        'storage/backups',
        'storage/logs',
        'storage/marketplace',
        'storage/proxies',
        'public/content',
        'public/deploy'
    ],

    'copy' => [
        'excludePaths' => [
            'storage',
            'public/vendor'
        ],

        'excludeNames' => [
            'tests',
            'test',
            'docs',
            'doc',
            '.git'
        ]
    ]
];

The Versions

28/12 2017

dev-master

9999999-dev

Zero downtime deployment using just FTP and PHP

  Sources   Download

MIT

The Requires

 

by Chris Chamberlain

28/12 2017

0.1.10

0.1.10.0

Zero downtime deployment using just FTP and PHP

  Sources   Download

MIT

The Requires

 

by Chris Chamberlain

04/04 2017

0.1.9

0.1.9.0

Zero downtime deployment using just FTP and PHP

  Sources   Download

MIT

The Requires

 

by Chris Chamberlain

04/04 2017

0.1.8

0.1.8.0

Zero downtime deployment using just FTP and PHP

  Sources   Download

MIT

The Requires

 

by Chris Chamberlain

04/04 2017

0.1.7

0.1.7.0

Zero downtime deployment using just FTP and PHP

  Sources   Download

MIT

The Requires

 

by Chris Chamberlain

09/07 2016

0.1.6

0.1.6.0

Zero downtime deployment using just FTP and PHP

  Sources   Download

MIT

The Requires

 

by Chris Chamberlain

08/07 2016

0.1.5

0.1.5.0

Zero downtime deployment using just FTP and PHP

  Sources   Download

MIT

The Requires

 

by Chris Chamberlain

08/07 2016

0.1.4

0.1.4.0

Zero downtime deployment using just FTP and PHP

  Sources   Download

MIT

The Requires

 

by Chris Chamberlain

08/07 2016

0.1.3

0.1.3.0

Zero downtime deployment using just FTP and PHP

  Sources   Download

MIT

The Requires

 

by Chris Chamberlain

08/07 2016

0.1.2

0.1.2.0

Zero downtime deployment using just FTP and PHP

  Sources   Download

MIT

The Requires

 

by Chris Chamberlain

08/07 2016

0.1.1

0.1.1.0

Zero downtime deployment using just FTP and PHP

  Sources   Download

MIT

The Requires

 

by Chris Chamberlain

08/07 2016

0.1.0

0.1.0.0

Zero downtime deployment using just FTP and PHP

  Sources   Download

MIT

The Requires

 

by Chris Chamberlain