{"id":17111063,"url":"https://github.com/nickfan/envoy-deployscript","last_synced_at":"2025-04-13T02:32:05.688Z","repository":{"id":82206125,"uuid":"39385843","full_name":"nickfan/envoy-deployscript","owner":"nickfan","description":"Laravel Envoy Deployment Script","archived":false,"fork":false,"pushed_at":"2018-04-01T22:30:45.000Z","size":1510,"stargazers_count":157,"open_issues_count":4,"forks_count":32,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-26T20:21:16.147Z","etag":null,"topics":["deployment","envoy-script","laravel"],"latest_commit_sha":null,"homepage":"http://nickfan.github.io/envoy-deployscript/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nickfan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-07-20T13:36:49.000Z","updated_at":"2025-02-13T22:09:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"c7663259-8d7d-4506-88e8-cc8e2eec117f","html_url":"https://github.com/nickfan/envoy-deployscript","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickfan%2Fenvoy-deployscript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickfan%2Fenvoy-deployscript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickfan%2Fenvoy-deployscript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickfan%2Fenvoy-deployscript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nickfan","download_url":"https://codeload.github.com/nickfan/envoy-deployscript/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248657793,"owners_count":21140842,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deployment","envoy-script","laravel"],"created_at":"2024-10-14T16:48:47.512Z","updated_at":"2025-04-13T02:32:05.676Z","avatar_url":"https://github.com/nickfan.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# envoy-deployscript\nLaravel Envoy Deployment Script\n\nBase on [papertank/envoy-deploy](https://github.com/papertank/envoy-deploy)\n\nInspired by\n\n* [papertank/envoy-deploy](https://github.com/papertank/envoy-deploy)\n* [Deploying with Envoy (Cast)](https://serversforhackers.com/video/deploying-with-envoy-cast)\n* [Enhancing Envoy Deployment](https://serversforhackers.com/video/enhancing-envoy-deployment)\n* [An Envoyer-like deployment script using Envoy](https://iatstuti.net/blog/an-envoyer-like-deployment-script-using-envoy)\n* [Rocketeer](http://rocketeer.autopergamene.eu/)\n* [Deploy your app to DigitialOcean from Codeship using Envoy](http://laravelista.com/deploy-your-app-to-digitialocean-from-codeship-using-envoy/)\n\n\nThis repository includes an Envoy.blade.php script that is designed to provide a very basic \"zero-downtime\" deployment option using the open-source [Laravel Envoy](http://laravel.com/docs/5.1/envoy) tool.\n\n## Requirements\n\nThis Envoy script is designed to be used with Laravel 5 projects,however you could modify for other type of projects.\n\nNotice that your local server/machine should configured to use [SSH Key-Based Authentication](https://www.digitalocean.com/community/tutorials/how-to-configure-ssh-key-based-authentication-on-a-linux-server).\n\n## Installation\n\nYour must have Envoy installed using the Composer global command:\n\n\u003ecomposer global require \"laravel/envoy=~1.0\"\n\n## Usage\n\n### Setup\n\n1. Download or clone this repository\n\n2. then copy envoy.config.example.php and Envoy.blade.php to your laravel project root directory.(e.g ~/code/mysite)\n\n3. then rename(or symbolic link) envoy.config.example.php to envoy.config.php and edit the envoy.config.php file with the ssh login info, Git repository, server path for your app.\nThe `$deploy_basepath` (server base path) should already be created in your server with right permissions(e.g owner:www-data,read/write).\nYou should set your website root directory (in vhost / server config) to `$deploy_basepath/$appname`/current/public (e.g /var/www/mysite/current/public)\n\n4. add `.envoydeploy/` directory to your .gitignore file in your laravel project root if you use git as your source control software.\n\n5. you should create a .env.production file (dot env settings file ) in your laravel project root directory that will deploy to remote server\notherwise if you specify the Laravel environment (e.g development/testing) create or symbolic the corresponding env file (e.g .env.development/.env.testing)\nand you could add the dot env settings file to your .gitignore file.\n\n6. you could create an directory `extra/custom/` in your laravel project root, the deploy script will copy every directories and files in it to overwrite the files in target server.\n\n\u003efor example:\n\n\u003eyour created file:\n\n\u003e`extra/custom/node_modules/laravel-elixir/Config.js`\n\n\u003eafter deploy it will copy and overwrite to\n\n\u003e`($deployed_project_root)/node_modules/laravel-elixir/Config.js`\n\n\u003eit's usually we use this for custom laravel-elixir config setting and other staff.\n\n### Configuration\n\nYou could tweak your **envoy.config.php** for your application situation.\n\n#### $pack_mode\n\t\n\u003e **local** : checkout code and prepare the app code package locally,then pack and rsync/scp packed files to remote and extract on remote (good for small vps but scp cost bandwidth)\n\n\u003e **remote** : checkout code and prepare the app code package on remote server (fast for your server have good network connection)\n\n#### $deploy_mode\n\n\u003e **incr** : sync new code to current running path (if you have lot of code and resource files in your project ,you may choose this mode)\n\n\u003e **link** : link new release path to current running path (if you want light and quick code deployment, you may choose this mode)\n\n\n### Deploy-Init\n\nWhen you're ready with the config, run the init task on your local machine by running the following in the repository directory\n\n\u003eenvoy run deploy_init\n\nYou can specify the Laravel environment (for artisan:migrate command) and git branch as options\n\n\u003eenvoy run deploy_init --branch=develop --env=development\n\nYou only need to run the init task once.\n\nThe init task creates a `.env` file in your app root path (e.g /var/www/mysite/.env )- make sure and update the environment variables appropriately.\n\n### Deploy\n\nEach time you want to deploy simply run the deploy task on your local machine in the repository direcory\n\n\u003eenvoy run deploy\n\nYou can specify the Laravel environment (for artisan:migrate command) and git branch as options\n\n\u003eenvoy run deploy --branch=develop --env=development\n\n### Rollback\nIf you found your last deployment likely have some errors,you could simply run the rollback task on your local machine in the repository direcory\n\n\u003eenvoy run rollback\n\nnotice that will only relink your *current* release to previous release,\nit will NOT do the database migrate rollback.\n\nif you wanna rollback database migration you could run **BEFORE** you run *rollback* task:\n\u003eenvoy run dbrollback --branch=master --env=production\n\nif you run *rollback* task twice ,you will got *current* release still symbolic link to last release.\n\n## How it Works\n\nYour `$deploy_basepath` directory will look something like this.\n```\n\tmysite/\n\tmysite2/\n\tmysite3/\n```\nYour `$deploy_basepath/$app_name` directory will look something like this after you init and then deploy.\n\n```\n\treleases/release_20150717032737/\n\treleases/release_20150717034646/\n\tcurrent -\u003e ./releases/release_20150717034646\n\tshared/storage/\n\ttmp/\n\t.env\n```\n\nAs you can see, the *current* directory is symlinked to the latest deployment folder\n\nInside one of your deployment folders looks like the following (excluded some laravel folders for space)\n\n```\n\tapp/\n\tartisan\n\tboostrap/\n\tpublic/index.php\n\tcomposer.json\n\t.env -\u003e ../../.env\n\tstorage -\u003e ../../shared/storage\n\tvendor/\n```\n\nThe deployment folder .env file and storage directory are symlinked to the parent folders in the main (parent) path.\n\n## Feature\n\n* You could deploy multi projects with different $app_name and config settings on same target server.\n\n* To explore more feature by RTFC, and custom task as you wish in your project.\n\n## Notice\n\n* http/https protocol might be ask for password for your private repos\nand that will break the git clone progress,\nuse git protocol and setup a deploy key on your server and SCM service instead\n(e.g github repo -\u003esettings-\u003eDeploy keys and set `$source_repo = 'git@github.com:user/mysite.git'` in your *envoy.config.php*)\n\n* the Task `cleanupoldreleases_on_remote` sometime may couldn't clean up all old release since your project contains too many files.\nand you could tweak keeps releases by change the config settings var `$release_keep_count`.\n\n\n## Example Usage\n\nyou could [Deploy your app to DigitialOcean from Codeship using Envoy](http://laravelista.com/deploy-your-app-to-digitialocean-from-codeship-using-envoy/)\nwith this Envoy.blade.php and envoy.config.php script :\n\n\u003e~/.composer/vendor/bin/envoy run deploy\n\n\nif your laravel project runs on a small RAM (e.g 512MB) droplet.\n\nyou could change config settings `$pack_mode = 'local';`.\n\n\n## Todo\n\n* Make backup faster.\n\n## Contributing\n\nPlease submit improvements and fixes :)\n\n## Author\n\n[Nick Fan](http://axiong.me)\n\n\n## Support on Beerpay\nHey dude! Help me out for a couple of :beers:!\n\n[![Beerpay](https://beerpay.io/nickfan/envoy-deployscript/badge.svg?style=beer-square)](https://beerpay.io/nickfan/envoy-deployscript)  [![Beerpay](https://beerpay.io/nickfan/envoy-deployscript/make-wish.svg?style=flat-square)](https://beerpay.io/nickfan/envoy-deployscript?focus=wish)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickfan%2Fenvoy-deployscript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnickfan%2Fenvoy-deployscript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickfan%2Fenvoy-deployscript/lists"}