Code Monkey home page Code Monkey logo

phploy's Introduction

PHPloy

Version 4.9.2

PHPloy is an incremental Git FTP and SFTP deployment tool. By keeping track of the state of the remote server(s) it deploys only the files that were committed since the last deployment. PHPloy supports submodules, sub-submodules, deploying to multiple servers and rollbacks. PHPloy requires PHP 7.3+ and Git 1.8+.

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.

Install

Via Composer

If you have composer installed in your machine, you can pull PHPloy globally like this:

composer global require "banago/phploy"

Make sure to place the $HOME/.composer/vendor/bin directory (or the equivalent directory for your OS) in your $PATH so the PHPloy executable can be located by your system.

Via Phar Archive

You can install PHPloy Phar globally, in your /usr/local/bin directory or, locally, in your project directory. Rename phploy.phar to phploy for ease of use.

  1. Globally: Move phploy into /usr/local/bin. Make it executable by running sudo chmod +x phploy.
  2. Locally Move phploy into your project directory.

Usage

When using PHPloy locally, proceed the command with php

  1. Run phploy --init in the terminal to create the phploy.ini file or create one manually.
  2. Run phploy in terminal to deploy.

Windows Users: Installing PHPloy globally on Windows

phploy.ini

The phploy.ini file holds your project configuration. It should be located in the root directory of the project. phploy.ini is never uploaded to server. Check the sample below for all available options:

; This is a sample deploy.ini file. You can specify as many
; servers as you need and use normal or quickmode configuration.
;
; NOTE: If a value in the .ini file contains any non-alphanumeric 
; characters it needs to be enclosed in double-quotes (").

[staging]
    scheme = sftp
    user = example
    ; When connecting via SFTP, you can opt for password-based authentication:
    pass = password
    ; Or private key-based authentication:
    privkey = 'path/to/or/contents/of/privatekey'
    host = staging-example.com
    path = /path/to/installation
    port = 22
    ; You can specify a branch to deploy from
    branch = develop
    ; File permission set on the uploaded files/directories
    permissions = 0700
    ; File permissions set on newly created directories
    directoryPerm = 0775
    ; Deploy only this directory as base directory
    base = 'directory-name/'
    ; Files that should be ignored and not uploaded to your server, but still tracked in your repository
    exclude[] = 'src/*.scss'
    exclude[] = '*.ini'
    ; Files that are ignored by Git, but you want to send the the server
    include[] = 'js/scripts.min.js'
    include[] = 'directory-name/'
    ; conditional include - if source file has changed, include file
    include[] = 'css/style.min.css:src/style.css' 
    ; Directories that should be copied after deploy, from->to
    copy[] = 'public->www'
    ; Directories that should be purged before deploy
    purge-before[] = "dist/"
    ; Directories that should be purged after deploy
    purge[] = "cache/"
    ; Pre- and Post-deploy hooks
    ; Use "DQOUTE" inside your double-quoted strings to insert a literal double quote
    ; Use 'QUOTE' inside your qouted strings to insert a literal quote
    ; For example pre-deploy[] = 'echo "that'QUOTE's nice"' to get a literal "that's".
    ; That workaround is based on http://php.net/manual/de/function.parse-ini-file.php#70847
    pre-deploy[] = "wget http://staging-example.com/pre-deploy/test.php --spider --quiet"
    post-deploy[] = "wget http://staging-example.com/post-deploy/test.php --spider --quiet"
    ; Works only via SSH2 connection
    pre-deploy-remote[] = "touch .maintenance"
    post-deploy-remote[] = "mv cache cache2"
    post-deploy-remote[] = "rm .maintenance"
    ; You can specify a timeout for the underlying connection which might be useful for long running remote 
    ; operations (cache clear, dependency update, etc.)
    timeout = 60

[production]
    quickmode = ftp://example:[email protected]:21/path/to/installation
    passive = true
    ssl = false
    ; You can specify a branch to deploy from
    branch = master
    ; File permission set on the uploaded files/directories
    permissions = 0774
    ; File permissions set on newly created directories
    directoryPerm = 0755
    ; Files that should be ignored and not uploaded to your server, but still tracked in your repository
    exclude[] = 'libs/*'
    exclude[] = 'config/*'
    exclude[] = 'src/*.scss'
    ; Files that are ignored by Git, but you want to send the the server
    include[] = 'js/scripts.min.js'
    include[] = 'js/style.min.css'
    include[] = 'directory-name/'
    purge-before[] = "dist/" 
    purge[] = "cache/" 
    pre-deploy[] = "wget http://staging-example.com/pre-deploy/test.php --spider --quiet"
    post-deploy[] = "wget http://staging-example.com/post-deploy/test.php --spider --quiet"

If your password is missing in the phploy.ini file or the PHPLOY_PASS environment variable, PHPloy will interactively ask you for your password. There is also an option to store the user and password in a file called .phploy.

[staging]
    user="theUser"
    pass="thePassword"
    
[production]
    user="theUser"
    pass="thePassword"

This feature is especially useful if you would like to share your phploy.ini via Git but hide your password from the public.

You can also use environment variables to deploy without storing your credentials in a file. These variables will be used if they do not exist in the phploy.ini file:

PHPLOY_HOST
PHPLOY_PORT
PHPLOY_PASS
PHPLOY_PATH
PHPLOY_USER
PHPLOY_PRIVKEY

These variables can be used like this;

$ PHPLOY_PORT="21" PHPLOY_HOST="myftphost.com" PHPLOY_USER="ftp" PHPLOY_PASS="ftp-password" PHPLOY_PATH="/home/user/public_html/example.com" phploy -s servername

Or export them like this, the script will automatically use them:

$ export PHPLOY_PORT="21"
$ export PHPLOY_HOST="myftphost.com"
$ export PHPLOY_USER="ftp"
$ export PHPLOY_PASS="ftp-password"
$ export PHPLOY_PATH="/home/user/public_html/example.com"
$ export PHPLOY_PRIVKEY="path/to/or/contents/of/privatekey"
$ phploy -s servername

Multiple servers

PHPloy allows you to configure multiple servers in the deploy file and deploy to any of them with ease.

By default PHPloy will deploy to ALL specified servers. Alternatively, if an entry named 'default' exists in your server configuration, PHPloy will default to that server configuration. To specify one single server, run:

phploy -s servername

or:

phploy --server servername

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

If you have a 'default' server configured, you can specify to deploy to all configured servers by running:

phploy --all

Shared configuration (custom defaults)

If you specify a server configuration named *, all options configured in this section will be shared with other servers. This basically allows you to inject custom default values.

; The special '*' configuration is shared between all other configurations (think include)
[*]
    exclude[] = 'src/*'
    include[] = "dist/app.css"

; As a result both shard1 and shard2 will have the same exclude[] and include[] "default" values
[shard1]
    quickmode = ftp://example:[email protected]:21/path/to/installation

[shard2]
    quickmode = ftp://example:[email protected]:21/path/to/installation

Rollbacks

Warning: the --rollback option does not currently update your submodules correctly.

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, you run:

phploy --rollback commit-hash-goes-here

When you run a rollback, the files in your working copy will revert temporarily to the version of the rollback you are deploying. When the deployment has finished, everything will go back as it was.

Note that there is not a short version of --rollback.

Listing changed files

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

phploy -l

Or:

phploy --list

Updating or "syncing" the remote revision

If you want to update the .revision file on the server to match your current local revision, run:

phploy --sync

If you want to set it to a previous commit revision, just specify the revision like this:

phploy --sync your-revision-hash-here

Creating deployment directory on first deploy

If the deployment directory does not exits, you can instruct PHPloy to create it for you:

phploy --force

Manual fresh upload

If you want to do a fresh upload, even if you have deployed earlier, use the --fresh argument like this:

phploy --fresh

Submodules

Submodules are supported, but are turned off by default since you don't expect them to change very often and you only update them once in a while. To run a deployment with submodule scanning, add the --submodules parameter to the command:

phploy --submodules

Purging

In many cases, we need to purge the contents of a directory after a deployment. This can be achieved by specifying the directories in phploy.ini like this:

; relative to the deployment path
purge[] = "cache/"

To purge a directory before deployment, specify the directories in phploy.ini like this:

; relative to the deployment path
purge-before[] = "dist/"

Hooks

PHPloy allows you to execute commands before and after the deployment. For example you can use wget call a script on my server to execute a composer update.

; To execute before deployment
pre-deploy[] = "wget http://staging-example.com/pre-deploy/test.php --spider --quiet"
; To execute after deployment
post-deploy[] = "wget http://staging-example.com/post-deploy/test.php --spider --quiet"

Logging

PHPloy supports simple logging of the activity. Logging is saved in a phploy.log file in your project in the following format:

2016-03-28 08:12:37+02:00 --- INFO: [SHA: 59a387c26641f731df6f0d1098aaa86cd55f4382] Deployment to server: "default" from branch "master". 2 files uploaded; 0 files deleted.

To turn logging on, add this to phploy.ini:

[production]
    logger = on

Contribute

Contributions are very welcome; PHPloy is great because of the contributors. Please check out the issues.

Credits

Version history

Please check release history for details.

License

PHPloy is licensed under the MIT License (MIT).

phploy's People

Contributors

baldurpan avatar banago avatar bastien-boussouf avatar bkarstaedt avatar craftpip avatar decanus avatar dependabot[bot] avatar dl1ely avatar dreadnaut avatar dsturm avatar euphorbium avatar fabwu avatar fadion avatar fsalomon avatar guidohendriks avatar jarbitlira avatar jaybizzle avatar jjeaton avatar lewisvgd avatar martin-sucha avatar martinkryl avatar mbrugger avatar mikaelz avatar ogrosko avatar peterbrinck avatar plashenkov avatar saibotd avatar schnoop avatar thyyppa avatar vstelmakh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

phploy's Issues

Add commit hashes to output

It would be great if the output in the CLI would display the commit hashes that the files are being deployed from/to. Sometimes when you deploy and you have multiple commits in between and you want to rollback quickly, it can take a while to find which commit to rollback to. If you could just look in the CLI history to see what you just deployed that would be great.

Also a command to retrieve the current commit hash that is on the server would be great too.

Unknown git-diff status: T

It seems PHPloy doesn't know how to handle a scenario where the type of a file has changed. This means that it blocks any further deployments with the error:

Oh Snap: Unknown git-diff status: T

An example would be to have a directory in the local repository which is removed and then replaced with file of the same name.

Is quickmode necessary?

Varied options are a good thing as long as they're complementary and don't confuse users. I believe quickmode doesn't classify. Except for being confusing, it's difficult to read and can lead to incorrect parsing if certain characters (colon, slashes) that break the url scheme are present.

I'd suggest keeping the "long" server configs only. They're even easier to write!

Problem uploading files with special chars

I have found a bug in the script. I'have tried to upload a file in my test environment.

Failed to upload "...../02 Vollmacht (f\303\274r Dritte).pdf". Retrying (attempt 2/10)...
PHP Warning: ftp_put("......../02 Vollmacht (f\303\274r Dritte).pdf"): failed to open stream: No such file or directory in /usr/local/bin/phploy on line 698

So there are special chars like รค or รผ and so in the name of the files. In this cases its not working.

After running the script i have two folders in the ftp folder.

"web and web without the quote.

FTPS settings

I don't know if this is the right place to ask, but here it is. I've been getting the error: "Unable to connect." I should be using FTPS, and In FileZilla I use the setting: "require explicit ftp over tls." I also have the following settings:

user = [email protected]
pass = mypassword
host = ftp.me.com
path = /
port = 21
passive = true

I am using Windows, so I am worried that something is missing from my PHP build. Is there anything I am leaving out?

Deploying to single server by default

The current behaviour is to deploy to every defined server, unless one specifies it via the --server argument. Personally, I think this leads to problems.

If I have a staging and production server, I want to upload selectively. First to staging, test it, then to production. The problem is that it's quite easy to forget the --server argument and upload to both, while the intention was to deploy to staging.

As most of the time deployment is aimed at a single server, I'd suggest making that the default. It would need an additional config option, default = server_name, that defines the default server where deployment is done when running just phploy. If the default option isn't set, it can use the first server automatically.

For deploying to aspecific or multiple servers, the --server argument could be an array. Ie: phploy --server=name for single (as it currently is) and phploy --server=name1 --server=name2 for multiple.

What do you guys think?

No upload on fresh repo

It doesn't seem to upload on a freshly started repo with no revision on the server. Have made a few tests and the regression must have been introduced in a3e55e6.

I'm running phploy with no parameters, on a repo with the same exact files and a single server configured. Tried a few versions of phploy before a3e55e6 and uploading worked fine. After a3e55e6, I'm just getting No files to upload, even though there are files to upload.

PHPloy v3

Hi guys,

I have some exciting news to share. I took a good chunk of time to add a feature that I was needing a lot lately and that is sFTP support: https://github.com/banago/PHPloy/tree/feature/secure

To do that, I made use of this great library here: https://github.com/tangervu/Connection.php (1) which I ended up forking to make several improvements to play well with PHPloy and to make it a composer package. You can fine it here: https://github.com/banago/Bridge

This means PHPloy will be a Phar in the future, much like composer. To load depencencies, (only Brige for now) please run composer install. To build the phar, all you need to do is run: php build.

Things seem to work fine, expect the fact that the phar won't work globally on my laptop. It only works locally. A lot of testing is needed. And a lot of further work and fine-tuning too.

@fadion can you help with overall architecture of PHPloy package. Perhaps bring some work from Maneuver over and then you can just drop PHPloy as a dependency on Maneuver. I know you are the right guy for this. ๐Ÿ˜ธ

@SimonEast your Windows testing and development is indispensable ๐Ÿ‘

@JayBizzle could you please add those improvements you added to master branch to feature/secure branch too. That would be awesome.

@oxodesign, @reinink, @rupaheizu and everybody else your contributions are more then welcome and very appreciated.

Thanks everyone.

(1) Connection.php is now a composer package too. Was updated after this was posted.

Manage branches

hi,

is it possible to manage several branches ?
i mean a way to upload changes from dev branch to a dev branch server configuration and master branch changes to a master branch server configuration ?

Test Suite

I had some time the other day to get back involved in writing some more updates but then I remembered what a pain it was to do any kind of testing the last time I contributed.

I just wondered how you or any other contributors test their contributions, and have you thought about putting some kind of test suite together to facilitate automated testing? Im no expert in this field, but it is something most projects have these days, and definitely something i'd like to get involved with to further my own knowledge in this area.

Windows Issues

Following installation instructions word for word, yet running phploy within project prompts that phploy is not a recognized command. This is after adding php.exe and path to phploy to environment variables.

It does work if I place phploy and phploy.bat in my project folder, but it would be nice to not have to do this with each project, as that is what the installation instructions indicate by using it globally.

Web interface

It does not need to be implemented now but why developing thing about this. A powerful deploy tool need to have a web interface.

password problem

Hi I have a password like ]or~%H]Q%&75 this in my deploy.ini but its showing error telling me unexpected ~

can you help??

Pre/Post deployment commands

Just noting this down as a discussion point for a possible future feature.

My current deployment workflow, using dploy.io, allows me to run shell commands on my server after the deployment has complete. I usually have a minimum of composer install getting executed after my deployments. It would be nice for PHPloy to have such a feature.

Thoughts?

Possibility to first deploy without upload all files

Feature request: possibility to first deploy without uplod all files

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

My server is NOT empty and i don't want to send again ALL files on start, only last commit.

Logging PHPloy Output

I often want to check when I last made a deployment, and a log file would be really handy. It's a relatively easy patch to enable logging to a text file (in addition to output on the screen), which I'm keen to write soon. But my only question is how it should be configured in deploy.ini.

  • Should you specify a log file per environment? Or one overall?
  • How can we make configuration work with both quickmode and verbose mode?
  • Should the filename accept strftime-compatible date variables, perhaps like: deployments %y %m.log?
  • Should you be able to specify the level of detail/verbosity written to the log file?

Turn off submodules by default

Hey @SimonEast,

I find myself that submodules are actually updates very rarely and the checks are kind of in vain on every single deploy.

What do you think about turning it off by default and adding a --submodules options if we want to run a check for submodules too.

Add Support for Rollbacks

Support for rollback to earlier version is being developed. You can view progress on the rollbacks branch.

It is expect to allow you to rollback to previous version by running:

phploy --rollback

Or to a more earlier version by running:

phploy --rollback revision-id

Suggestions are welcome.

Problem with the new version (feature to SFTP

I am trying to connect to an SFTP Server..

PHP Fatal error: Call to a member function exists() on a non-object in phar:///var/www/mysite/phploy.phar/src/PHPloy.php on line 480
PHP Stack trace:
PHP 1. {main}() /var/www/mysite/phploy.phar:0
PHP 2. include() /var/www/mysite/phploy.phar:10
PHP 3. Banago\PHPloy\PHPloy->__construct() phar:///var/www/mysite/phploy.phar/phploy.php:11
PHP 4. Banago\PHPloy\PHPloy->deploy() phar:///var/www/mysite/phploy.phar/src/PHPloy.php:221
PHP 5. Banago\PHPloy\PHPloy->compare() phar:///var/www/mysite/phploy.phar/src/PHPloy.php:563

Deploying to all servers should require a --all parameter

The default behaviour of uploading to all servers could cause problems if people use the setup for different environments as the example deploy.ini shows. It's highly unlikely people would want to deploy to development, staging and production environments all at the same time. A --all parameter or something similar seems more logical than defaulting to deploying everywhere.

git command error

When I try to run the command "phploy" on my git project the following message comes out:

Oh snap: PHPloy attempted to run the following console command but it failed: git --git-dir=^"D:\server^\auto.git^" --work-tree=^"D:\server^\auto^" submodule status

Exclamation Mark on password causes termination of phploy

Hello there,

Props on the fantastic nifty tool you've made.

Couple of minutes ago, I wanted to phploy to a server which had a password consisting of an exclamation mark, just to have PHPloy throw me this exception:

Warning: parse error in deploy.ini on line 18
 in /usr/local/bin/phploy on line 367

Oh Snap: 'deploy.ini' is not a valid .ini file.

The exclamation mark was at the end of it to be more precise.
Tried escaping it with a backlash, or throwing the whole string within quotes but to no avail.

Coding style and minor optimizations

Let's put this as the next step. It won't take much, but it's a needed one. Also, minor optimizations to code could be acheived in this phase, mostly for legibility, thrown exceptions, etc.

deploy only contents of a selected folder

Would it be possible to have the ability to deploy only the contents within a set folder?

For example; when I develop, I develop, the stuff that I want to have sent to the server would be inside a www/ folder. the rest of the stuff in the root is sh scripts that we track or vagrant related and wouldn't want these on production.

How do submodules work?

This is a great tool, but I'm trying to upload a Yii2 project, and I have a vendor folder with all my modules, but none of them are uploaded.

I'm not really sure if the modules in the vendor folder are submodules.

Any solutions for this?

Revision file incorrect if committing during deployment

I might be incorrect but I've noticed this a few times --

If I'm doing a long deployment, say an initial deployment of many thousands of files, then make commits during that deployment the .revision file on the server is incorrectly updated to the latest local revision. i.e.: the revision when deployment completed, not when it was started.

When detected I just sync the server to the correct revision; however sometimes this is not picked up and files are missing or outdated on the server as a result.

How to re-produce: Make a local commit whilst phploy is deploying.

Deploy one source to different folders (for example: secure & public files)

Is it possible to deploy certain folders/files to different locations?

For example I would like my public files (such as assets) to be deployed into the public web root:
/domains/domain.com/public_html/

However the framework/config code should go to a non-public location such as:
/domains/domain.com/framework/

That would be a neat feature to have. :)

Ignore files/folders

Would be great to be able to ignore files and folders that we do want in the repo, but not on the server. I'm thinking raw SASS, node modules and the such.

Change file name on deployment

A way to change file names.
Ex.

system.ini // Dont deploy
system.live.ini => system.ini // Change name for live server

Passing path of repository to phploy

It would be good thing to have an option to pass the path of the repository to phploy through parameters, so you don't have to be in the repository folder and use it as a shortcut or, for example, custom action from SourceTree.

Bug with gitlab

Hello,

When I run 'phploy' in my git folder, PHPloy tell me :
"Oh Snap: '/var/opt/gitlab/git-data/repositories/jbm/testing.git' is not Git repository."
I use PHPloy (last version) and Gitlab omnibus 6.9

Sometimes file numbering is off

Sometimes file operation numbering starts from 2, e.g. "uploaded 2 of 184" and ends with "uploaded 185 of 184". Not really sure when it happens, but I caught it two times already. Using latest beta on Windows.

Installing through Composer

Personally I use composer a lot an I would be glad if you can make it available through composer as well.

Strange submodule detection

Hello,

I got a lot of issus with my submodule. I have a repository with 4 submodule et one of them have a submodule too.
But the script found wierd thing:

---------------------------------------------------
|              phploy v2.0.0                |
---------------------------------------------------

Scanning repository...
   Found 4 submodules.
   Found submodule plugins/chartetypo. Scanning for sub-submodules...
      Found sub-submodule plugins/chartetypo/dans.
      Found sub-submodule plugins/chartetypo/dans.
      Found sub-submodule plugins/chartetypo/dans.
      Found sub-submodule plugins/chartetypo/lib/array_column.
      Found sub-submodule plugins/chartetypo/dans.
   Found submodule plugins/courtjus. Scanning for sub-submodules...
      Found sub-submodule plugins/courtjus/dans.
      Found sub-submodule plugins/courtjus/dans.
      Found sub-submodule plugins/courtjus/dans.
      Found sub-submodule plugins/courtjus/lib/array_column.
      Found sub-submodule plugins/courtjus/dans.
   Found submodule plugins/spip_array_column. Scanning for sub-submodules...
      Found sub-submodule plugins/spip_array_column/dans.
      Found sub-submodule plugins/spip_array_column/dans.
      Found sub-submodule plugins/spip_array_column/dans.
      Found sub-submodule plugins/spip_array_column/lib/array_column.
      Found sub-submodule plugins/spip_array_column/dans.
   Found submodule plugins/zoundation. Scanning for sub-submodules...
      Found sub-submodule plugins/zoundation/dans.
      Found sub-submodule plugins/zoundation/dans.
      Found sub-submodule plugins/zoundation/dans.
      Found sub-submodule plugins/zoundation/lib/array_column.
      Found sub-submodule plugins/zoundation/dans.

All sub-submodule are wrong, except for plugins/spip_array_column/lib/array_column.
This dans. folder doesn't even exist.

The V3 have the same problem but, act differente:

---------------------------------------------------
|              PHPloy v3.0.7-alpha                |
---------------------------------------------------

Scanning repository...
   Found 4 submodules.
   Found submodule plugins/chartetypo. 
      Scanning for sub-submodules...
      Found sub-submodule plugins/chartetypo/dans.
      Found sub-submodule plugins/chartetypo/dans.
      Found sub-submodule plugins/chartetypo/dans.
      Found sub-submodule plugins/chartetypo/lib/array_column.
      Found sub-submodule plugins/chartetypo/dans.
   Found submodule plugins/courtjus. 
      Scanning for sub-submodules...
      Found sub-submodule plugins/courtjus/dans.
      Found sub-submodule plugins/courtjus/dans.
      Found sub-submodule plugins/courtjus/dans.
      Found sub-submodule plugins/courtjus/lib/array_column.
      Found sub-submodule plugins/courtjus/dans.
   Found submodule plugins/spip_array_column. 
      Scanning for sub-submodules...
      Found sub-submodule plugins/spip_array_column/dans.
      Found sub-submodule plugins/spip_array_column/dans.
      Found sub-submodule plugins/spip_array_column/dans.
      Found sub-submodule plugins/spip_array_column/lib/array_column.
      Found sub-submodule plugins/spip_array_column/dans.
   Found submodule plugins/zoundation. 
      Scanning for sub-submodules...
      Found sub-submodule plugins/zoundation/dans.
      Found sub-submodule plugins/zoundation/dans.
      Found sub-submodule plugins/zoundation/dans.
      Found sub-submodule plugins/zoundation/lib/array_column.
      Found sub-submodule plugins/zoundation/dans.

SERVER: production
   No files to upload.

SUBMODULE: plugins/chartetypo
   No files to upload.

SUBMODULE: plugins/chartetypo/dans
|----[ No revision found. Fresh deployment - grab a coffee ]----|
fatal: Not a git repository: '/home/phenix/Sites/Personnel/henix/plugins/chartetypo/dans/.git'
   No files to upload.

SUBMODULE: plugins/chartetypo/dans
|----[ No revision found. Fresh deployment - grab a coffee ]----|
fatal: Not a git repository: '/home/phenix/Sites/Personnel/henix/plugins/chartetypo/dans/.git'
   No files to upload.

SUBMODULE: plugins/chartetypo/dans
|----[ No revision found. Fresh deployment - grab a coffee ]----|
fatal: Not a git repository: '/home/phenix/Sites/Personnel/henix/plugins/chartetypo/dans/.git'
   No files to upload.

SUBMODULE: plugins/chartetypo/lib/array_column
|----[ No revision found. Fresh deployment - grab a coffee ]----|
fatal: Not a git repository: '/home/phenix/Sites/Personnel/henix/plugins/chartetypo/lib/array_column/.git'
   No files to upload.

SUBMODULE: plugins/chartetypo/dans
|----[ No revision found. Fresh deployment - grab a coffee ]----|
fatal: Not a git repository: '/home/phenix/Sites/Personnel/henix/plugins/chartetypo/dans/.git'
   No files to upload.

SUBMODULE: plugins/courtjus
|----[ No revision found. Fresh deployment - grab a coffee ]----|
Created directory 'plugins/courtjus/'.
 ^  1 of 13 plugins/courtjus/courtjus_administrations.php
 ^  2 of 13 plugins/courtjus/courtjus_fonctions.php
 ^  3 of 13 plugins/courtjus/courtjus_pipelines.php
 ^  4 of 13 plugins/courtjus/fabrique_courtjus.php
Created directory 'plugins/courtjus/formulaires/'.
 ^  5 of 13 plugins/courtjus/formulaires/configurer_courtjus.html
 ^  6 of 13 plugins/courtjus/formulaires/configurer_courtjus.php
Created directory 'plugins/courtjus/lang/'.
 ^  7 of 13 plugins/courtjus/lang/courtjus_fr.php
 ^  8 of 13 plugins/courtjus/lang/paquet-courtjus_fr.php
 ^  9 of 13 plugins/courtjus/paquet.xml
Created directory 'plugins/courtjus/prive/'.
Created directory 'plugins/courtjus/prive/squelettes/'.
Created directory 'plugins/courtjus/prive/squelettes/contenu/'.
 ^ 10 of 13 plugins/courtjus/prive/squelettes/contenu/configurer_courtjus.html
Created directory 'plugins/courtjus/prive/themes/'.
Created directory 'plugins/courtjus/prive/themes/spip/'.
Created directory 'plugins/courtjus/prive/themes/spip/images/'.
 ^ 11 of 13 plugins/courtjus/prive/themes/spip/images/courtjus-128.png
 ^ 12 of 13 plugins/courtjus/prive/themes/spip/images/courtjus-32.png
 ^ 13 of 13 plugins/courtjus/prive/themes/spip/images/courtjus-64.png

SUBMODULE: plugins/courtjus/dans
|----[ No revision found. Fresh deployment - grab a coffee ]----|
fatal: Not a git repository: '/home/phenix/Sites/Personnel/henix/plugins/courtjus/dans/.git'
   No files to upload.

SUBMODULE: plugins/courtjus/dans
|----[ No revision found. Fresh deployment - grab a coffee ]----|
fatal: Not a git repository: '/home/phenix/Sites/Personnel/henix/plugins/courtjus/dans/.git'
   No files to upload.

SUBMODULE: plugins/courtjus/dans
|----[ No revision found. Fresh deployment - grab a coffee ]----|
fatal: Not a git repository: '/home/phenix/Sites/Personnel/henix/plugins/courtjus/dans/.git'
   No files to upload.

SUBMODULE: plugins/courtjus/lib/array_column
|----[ No revision found. Fresh deployment - grab a coffee ]----|
fatal: Not a git repository: '/home/phenix/Sites/Personnel/henix/plugins/courtjus/lib/array_column/.git'
   No files to upload.

SUBMODULE: plugins/courtjus/dans
|----[ No revision found. Fresh deployment - grab a coffee ]----|
fatal: Not a git repository: '/home/phenix/Sites/Personnel/henix/plugins/courtjus/dans/.git'
   No files to upload.

SUBMODULE: plugins/spip_array_column
|----[ No revision found. Fresh deployment - grab a coffee ]----|
Created directory 'plugins/spip_array_column/'.
 ^  1 of 11 plugins/spip_array_column/.gitmodules
 ^  2 of 11 plugins/spip_array_column/arraycolumn_options.php
 ^  3 of 11 plugins/spip_array_column/fabrique_arraycolumn.php
Created directory 'plugins/spip_array_column/lang/'.
 ^  4 of 11 plugins/spip_array_column/lang/arraycolumn_fr.php
 ^  5 of 11 plugins/spip_array_column/lang/paquet-arraycolumn_fr.php
Created directory 'plugins/spip_array_column/lib/'.
 ^  6 of 11 plugins/spip_array_column/lib/array_column
 ^  7 of 11 plugins/spip_array_column/paquet.xml
Created directory 'plugins/spip_array_column/prive/'.
Created directory 'plugins/spip_array_column/prive/themes/'.
Created directory 'plugins/spip_array_column/prive/themes/spip/'.
Created directory 'plugins/spip_array_column/prive/themes/spip/images/'.
 ^  8 of 11 plugins/spip_array_column/prive/themes/spip/images/array_column.psd
 ^  9 of 11 plugins/spip_array_column/prive/themes/spip/images/arraycolumn-128.png
 ^ 10 of 11 plugins/spip_array_column/prive/themes/spip/images/arraycolumn-32.png
 ^ 11 of 11 plugins/spip_array_column/prive/themes/spip/images/arraycolumn-64.png

SUBMODULE: plugins/spip_array_column/dans
|----[ No revision found. Fresh deployment - grab a coffee ]----|
fatal: Not a git repository: '/home/phenix/Sites/Personnel/henix/plugins/spip_array_column/dans/.git'
   No files to upload.

SUBMODULE: plugins/spip_array_column/dans
|----[ No revision found. Fresh deployment - grab a coffee ]----|
fatal: Not a git repository: '/home/phenix/Sites/Personnel/henix/plugins/spip_array_column/dans/.git'
   No files to upload.

SUBMODULE: plugins/spip_array_column/dans
|----[ No revision found. Fresh deployment - grab a coffee ]----|
fatal: Not a git repository: '/home/phenix/Sites/Personnel/henix/plugins/spip_array_column/dans/.git'
   No files to upload.

SUBMODULE: plugins/spip_array_column/lib/array_column
|----[ No revision found. Fresh deployment - grab a coffee ]----|
PHP Warning:  ftp_chdir(): plugins/spip_array_column/lib/array_column/: No such file or directory in phar:///usr/local/bin/phploy.phar/vendor/banago/bridge/src/Backend/Ftp.php on line 100
PHP Stack trace:
PHP   1. {main}() /usr/local/bin/phploy.phar:0
PHP   2. include() /usr/local/bin/phploy.phar:10
PHP   3. Banago\PHPloy\PHPloy->__construct() phar:///usr/local/bin/phploy.phar/phploy.php:11
PHP   4. Banago\PHPloy\PHPloy->deploy() phar:///usr/local/bin/phploy.phar/src/PHPloy.php:221
PHP   5. Banago\PHPloy\PHPloy->push() phar:///usr/local/bin/phploy.phar/src/PHPloy.php:584
PHP   6. Banago\Bridge\Bridge->cd() phar:///usr/local/bin/phploy.phar/src/PHPloy.php:710
PHP   7. Banago\Bridge\Backend\FTP->cd() phar:///usr/local/bin/phploy.phar/vendor/banago/bridge/src/Bridge.php:52
PHP   8. ftp_chdir() phar:///usr/local/bin/phploy.phar/vendor/banago/bridge/src/Backend/Ftp.php:100

Oh Snap: Changing directory to 'plugins/spip_array_column/lib/array_column/' failed

What can I do ?

Can you specify staging/production servers in the one deploy.ini file?

This looks awesome, just the kinda thing I need. Gonna attempt to try it out tomorrow, but just wondered if there might be a way to specify separate settings for staging/production servers, so you could do something like

phploy production
or
phploy staging

I realise that this was probably intended for a workflow where you have separate Git branches for staging/production in which case a different deploy.ini file for each. I sometimes do that, but for simpler projects with mostly linear development, it's nice to deploy to staging, get approval from the client and then run 1 command to get that on production.

I might even see if I can build that feature myself.... hmmm...

(Also, from a quick glance, shouldn't the deploy.ini file be in $files_to_ignore? It should also ignore the entire .git folder.)

Thanks for sharing this.

Simon.

Choose which branch deploy

It would be interesting if we can set on deploy.ini which branch use to deploy. I use capifony to deploy my Symfony projects and it has this helpful feature.

Thx.

Ask for (s)ftp password if not specified

It would be good the console ask for the ftp password if this is blank in the configuration file, this way is can versioning the deploy.ini file without compromising the security of the server.

does not give any error , does not connect

When I do -> phploy --list it says connecting to production server, and nothing more, exits with error 255. I have specified in deploy.ini all credentials. Could it be that because my username on ftp contains dot character like de.munze? It does not give any clue of what might have happened, could not connect to server, or no such directory or whatever.

PHPloy in window 64 bit

I run on my computer window 7 64bit and get this error. Please help me to fixe them. Thanks.

test

Syntax Errors Check Before Deployment

Embarrassingly enough only today was I able to come across this little nice utility in PHP - syntax checking form the terminal.

php -l filename.php

Out if this, I wrote a little bash script to do this check before the commit, but I don't really bother if I do a commit with errors.

On the other hand it is really important that we don't do a deploy with errors. And guess what, I've done it, it's time consuming and sometimes embarrassing when the clients tells you there is an error in the website, because you where to lazy to check.

So, we are going to have this feature built into PHPloy.

I suggest we have it on by default and have an option to deactivate it like --no-check when we are doing an initial deploy or similar scenarios to save some seconds.

You feedback on this is very welcome.

Issues with rollback command

There's currently two issues with the --rollback command.

  1. It doesn't handle submodules correctly. See source code note here.
  2. It returns the working copy to the master branch, which may not be what the user intended. See source code note here.

I'm unlikely to have time to fix these any time soon unfortunately, but if anyone else wants to have a go, feel free. ๐Ÿ‘

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.