Giter VIP home page Giter VIP logo

phploy's Introduction

PHPloy

PHPloy is a little PHP script that allows you to deploy files through FTP to a server. It makes use of Git to know which files it should upload and which one it should delete. It is a real time-saver. PHPloy supports deployments of submodules and sub-submodules.

Usage

As any script, you can use PHPloy globally, from your bin directory or locally, from your project directory:

Using PHPloy Globally

  1. Drop phploy into /usr/local/bin and make it executable by running sudo chmod +x phploy.
  2. Create the deploy.ini file.
  3. Run phploy in terminal.

Using PHPloy Locally

  1. Drop phploy into your project.
  2. Create the deploy.ini file.
  3. Run php phploy in terminal.

deploy.ini

The deploy.ini file hold your credentials and it must be in the root directory of your project. Use as many servers as you need and whichever configuration type you prefer.

; This is a sample deploy.ini file.
; You can specify as many servers as you need
; and use whichever configuration way you like.

[staging]

user = example
pass = password
host = staging-example.com
path = /path/to/installation
port = 21
passive = true

[production]

user = example
pass = password
host = production-example.com
path = /path/to/installation
port = 21
passive = true

; If that seemed too long for you, you can use quickmode instead:
[quickmode]
    staging = ftp://example:[email protected]:21/path/to/installation
    production = ftp://example:[email protected]:21/path/to/installation

The first time it's executed, PHPloy will assume that your deployment server is empty, and will upload all the files of your project.

Multiple Servers

PHPloy allows you to configure multilple servers in the deploy file and deploy to any of them with ease. By default it will deploy to all specified servers. To specify one server run:

phploy -s servername

Or:

phploy --server servername

servername stands for the name you have given to the server in the deploy.ini configuration file.

Rollbacks

PHPloy allows you to roll back to an earlier version when you need to. Rolling back is very easy.

To roll back to the previous commit, you just run:

phploy --rollback

To roll back to whatever commit you want to, you run:

phploy --rollback="commit-hash-goes-here"

Note that there is not a short version of --rollback and also that when you run a rollback your files will revert temporarely to the version of the rollback you are running. When the deploymnet is finished, everything will go back as it was.

View files

PHPloy allows you to check out what are going to be uploaded/deleted before you actually push them. Just run:

phploy -l

Or:

phploy --list

Sync Revision

If you want to sync the .revision file on the server with the current revision you are currently on locally, run:

phploy --sync

If you want to set it to another previous commit revision, you just repecify the revision like this:

phploy --sync="your-revision-hash-here"

How It Works

PHPloy stores a file called .revision on your server. This file contains the hash of the commit that you have deployed to that server. When you run phploy, it downloads that file and compares the commit reference in it with the commit you are trying to deploy to find out which files to upload.

PHPloy also stores a .revision file for each submodule in your repository.

##Contribute

If you've got any suggestions, questions, or anything else about PHPloy, you should create an issue here.

Credits

PHPloy is developed by Baki Goxhaj, a freelance WordPress and Laravel developer from Albania. It is based on the work of Bruno De Barros. This project was taken further because the original project did not suport Git Submodues.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.