PHPackages                             alexeyplodenko/mydeploy - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. alexeyplodenko/mydeploy

ActiveLibrary

alexeyplodenko/mydeploy
=======================

My deploy tool.

00PHP

Since Mar 7Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/AlexeyPlodenko/myDeploy)[ Packagist](https://packagist.org/packages/alexeyplodenko/mydeploy)[ RSS](/packages/alexeyplodenko-mydeploy/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

myDeploy
========

[](#mydeploy)

This tool purpose is to run a build process in the local/development environment using a Docker container, for isolation, and without relying on 3rd party services.

The purpose of the PHP script, rather than a plain Dockerfile, is to have access to variables at all stages of the build process.

How the build process works?
----------------------------

[](#how-the-build-process-works)

The code from the `deploy.php` file writes a Dockerfile. The build is happening based on the Dockerfile, which is being executed inside Docker in an isolated environment.

To start
--------

[](#to-start)

Create a `/deploy.php` file in the root of the project and use the following code as boilerplate for that file. Here I am building a Laravel project on PHP 8.1 from GitHub, using Ubuntu as a build OS, installing Composer and NPM packages, and deploying the files to the hosting environment via an FTPs connection.

Run the file `php deploy.php`.

Variables
---------

[](#variables)

You can define the variables in the `deploy.php` script, using PHP `$app->setVariable('$ENV', 'production');` or you can use system environment variables explicitly in the code, without setting the variable with the `$app->setVariable()` method.

Any variable that is defined using the `$app->setVariable()` method or exists as a system variable can be used in the `$app->addRunCommand('mkdir $PATH')` command or applied to a file `$app->applyVariablesToFile('/app/.env');`.

```
