GitFTP-Deploy



Deployment of web applications is a process where application is uploaded fromyour development machine or the source code repository (Git) to a web server andis made accessible to users.

Gitftp-deploy Serial

GitFTP-Deploy; PaaS. Platform as a Service include 3rd party services such as Heroku, Zeit, Azure and others. To explore more about deployments, check also. Follow this project on twitter @gitftp. Deploy with Git-ftp and Bitbucket Pipelines (video tutorial). Windows and OS X: I am very limited in testing on Windows and OS X. Thanks for helping me out fixing bugs on these platforms. Git-ftp as deployment tool: git-ftp was not designed as centralized deployment tool.

Deploying PHP application to production or staging environment might not be soobvious task at first and requires some additional attention.

What does the deployment include?

During deployment, the source code files are transferred with some of thefollowing additional steps:

  • Checking out specific version of the application from the code repository
  • Dependencies are installed with Composer
  • Web assets (JavaScript, CSS, images) are generated, minified, concatenated…
  • Database schema is migrated
  • Cache is cleared
  • Web server gets restarted

Modern deployments should be as simple, fast and be able to made often during theapplication life time to meet the requirements. For example, if you change onlysmall portion of your code, only the changed files should be uploaded and notall others. One of the modern deployment approaches is also atomic deployment. Itprovides switching ability between different deployed versions and web serveruses symbolic link to the latest version location.

Quality

When uploading application from the development to production you also want toensure that tests pass and that application works as expected. This step addsdeploying application to another step, for example, a stage.

Application life cycle management (ALM)

GitFTP-Deploy

Application life cycle generally consists of the following steps:

GitFTP-Deploy
  • Development

    This is where you locally write code, integrate functionality, fix bugs, runtests, commit and push code to a versioning system such as Git.

  • Build
  • Test
  • Deploy

How to choose the right deployment strategy?

Pick the tools that you and your team find comfortable to work with and inspectthe available infrastructure options. You will not be able to use a singleapproach for all of your projects. Many projects have their own edge cases andlimits which you must take into account when picking the build and deploymentstrategy.

FTP

FTP is the most basic file transfer approach you might have started with. It isthe easiest way of transferring application files to a web server by using FTPprotocol with some FTP client such as FileZillaor similar. FTP is simple and convenient, but has many weaknesses such as securityrisks, lack of versioning options and also it can be slow with a lot of files.Most shared hosting options provide FTP to upload files to production.

The git-ftp provides Git version controlsystem with FTP deployment.

Moving on

Below are listed some more advanced and convenient deployment methods. You willneed some prerequisite knowledge to link the basic deployment such as FTP andfurther explained methods:

Git Ftp Deploy

  • Be able to use command line a lot. There is a really nice introduction availablein the art-of-command-line
  • Be familiar with some basic DevOps skills.

System administration is often a very large chapter of its own and will not becovered here in details.

GitFTP-Deploy

GIT + SSH

When working with Git, you can use it to deploy your application as well.

In short the deployment procedure is the following:

  • Local application development with Git
  • Via SSH access you git pull and checkout possible specific application version

If using GitHub, Bitbucket, GitLab or similar Git hosting service, you can add thedeployment SSH key in the repository.

Deployer

Deployer is a PHP cli application which can deploy yourPHP application over multiple protocols, SSH being widely used. After installation,a separate project specific deploy.php file is used to deploy the applicationfrom the Git repository to server via command line.

Pros:

  • Completely customizable
  • Fast
  • Secure

Fabric

  • Fabric is a widely used deployment tool written inPython. It works similar as above explained Deployer, it is completely customizable,solid, fast and secure.

Docker

Pros:

  • Very modular
  • Easier server management

Cons:

Mac
  • Very high level DevOps knowledge is required to successfully deploy projectswith Docker.

Docker deployment strategy can be used in two ways:

  • By building custom images with application code in the images and deployingthem to Docker Registry.

    This is probably the most convenient way to use Docker in production. HoweverDocker Registry with custom images needs to be used.

  • By using Git on the production server and using volumes for code. Images can bebuild on the server itself or downloaded from Docker Registry.

Some useful resources to run Docker in production:

Git Ftp Deployed

Jenkins

Jenkins provides continuous integration and can be used todeploy application into production. The Jenkins ecosystem provides a multitude ofplugins to adjust your application life cycle to your needs. It can be even usedtogether with Docker to build images and run tasks in containers.

Git Ftp-deploy Mac App

Other deployment options

  • Envoy - A tool to run SSH tasks with PHP.
  • Rocketeer - Deployment tool in PHP.
  • Capistrano - Remote server automation and deploymenttool in Ruby.
  • Apache Ant - Java library and command line tool.
  • Phing - PHP port of the Apache Ant.

Paid services

Some limited free and paid options you might want to check out if you want tohave more elegant and less “hacky” solutions:

  • TeamCity - Proprietary deployment tool.
  • DeployHQ - Web based GUI deployment service.

PaaS

Platform as a Service include 3rd party services such as Heroku,Zeit, Azure and others.

See also

To explore more about deployments, check also some of the following resources: