Skip to content

Laravel package for zero-downtime deployments

License

Notifications You must be signed in to change notification settings

arcanedev-maroc/deploy

 
 

Repository files navigation

Deploy

Build Status Total Downloads

Introduction

Deploy provides a dasboard for existing Laravel applications to manage zero-downtime deployments.

Server Requirements

  • openssh-clients (To establish ssh connections)

Installation

Prior to installing this package, it is assumed you have already configured an auth gaurd with the App\User model for your Laravel application.

Using composer, install the package into your Laravel project:

composer require itsjeffro/deploy

Next, you will need to register the package's service provider class under the providers array in the config/app.php configuration file.

Deploy\DeployServiceProvider::class

Publish the package's config and assets:

php artisan vendor:publish --tag=deploy-config
php artisan vendor:publish --tag=deploy-assets

When you update to a new release of deploy package, you should make sure you update the assets using the command below.

php artisan vendor:publish --tag=deploy-assets --force

Run the package's migrations:

php artisan migrate

Configuration

After publishing the assets, the primary config file will be located at config/deploy.php.

Before using the deploy application, you will need to set up your repository provider and a proper queue driver.

Available Providers

Update your .env file to include a provider of your choice. A minimum of one provider is required.

Bitbucket

https://confluence.atlassian.com/bitbucket/oauth-on-bitbucket-cloud-238027431.html

BITBUCKET_OAUTH_KEY=client_id
BITBUCKET_OAUTH_SECRET=client_secret

Github

https://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app/

GITHUB_OAUTH_KEY=client_id
GITHUB_OAUTH_SECRET=client_secret

Queue connection

In your .env file, QUEUE_CONNECTION should be changed to another connection other than "sync". This way the process workers can correctly work on the server hosting the deployment package.

With the connection updated, paths such as /home/user/.ssh/known_hosts will be used instead of /var/www/.ssh/known_hosts.

Worker roles also handle:

  • Creating individual SSH private keys for each project`s server

  • Handling deployments

  • Managing the projects .env file

  • Testing server connections

Broadcasting

To allow real-time feedback when a deployment or server connection has started or finished, you may set up the application to utlise Laravel's broadcasting feature.

Publish Resources

TBA

Publish Views

TBA

Configuration

TBA

Note: You may need to restart the queue worker to pick up on your configuration updates.

Deployments

Given that the deployment process uses symlinks. The user performing the deployment actions will be required to have the ability to reload the php-fpm service on the server. You may create a deployment hook which does this after the "Clean Up" action.

Further reading

About

Laravel package for zero-downtime deployments

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 50.7%
  • JavaScript 46.7%
  • CSS 2.4%
  • HTML 0.2%