[Windows/Linux/Mac][PHP Deployer] Zero Downtime PHP Deployment

Deployer – https://deployer.org/
A zero downtime PHP deployment tool.

How it works?

Basically it SSH into the remote server, git clone to new folder, composer install, and create symlink to latest release folder
And optionally run database migration, restart PHP-FPM. If either step fails, it rollbacks the whole transaction.

Continue reading “[Windows/Linux/Mac][PHP Deployer] Zero Downtime PHP Deployment”

[Windows Bash] Add Rsync to “Git Bash for Windows”

In last few post we mentioned using bash in Windows by install Git.
It comes with handy *nix tools like grep, find, wget, curl, vim, ssh… but something still missing is rsync
Because it do not mean to be collection of POSIX software for Windows. It is a wont-fix for them.

Git for Windows is based on MSYS2 (As of version Git-SCM 2.13.3)
Unfortunately it does not comes with pacman (Package manager) so there are not official way to install packages.

Furthermore, cwRsync and DeltaCopy does not work in bash environment.

Continue reading “[Windows Bash] Add Rsync to “Git Bash for Windows””

[Windows Bash] Git in bash ignores SSH key

When you using Bash for Windows (MinGW, Installed by git), with TotoriseGit installed
Sometime ssh works but git do not pick-up correct SSH keys.
Causing “No supported authentication methods available”

It is because TotoriseGit has taken over some git/ssh command.

To correctly this, the solution is adding this line to your ~/.bashrc

export GIT_SSH=/bin/ssh.exe

 

 

[Windows Bash] Using bash in Windows

As a full-stack developer in LAMP, I often play-around with Linux servers.
Unfortunately, there are always some reason that I can’t switch to Linux development machine.
E.g. Windows only printer drivers, Adobe Software, exe…

However, Windows cmd/PowerShell always disgust me for their special syntax.
And I missed Unix-like CLI tools such as (grep, find, wget, curl, vim, ssh…) so much.
Plus you can’t use id_rsa format in Windows directly (You will need putty, a GUI tool for CLI… and you need to convert all your keys)

So today we will get those lovely tools back, on Windows!
(Does NOT require Windows 10 Ubuntu Bash, should work on any supported version of Windows)
Continue reading “[Windows Bash] Using bash in Windows”

[Windows Bash] Use bash instead of cmd Intellij/Android Studio/WebStorm/PHPStorm

If you love bash & Linux command but forced to use Windows for development, you will love this trick.

The console is colored like on Linux and autocomplete works way better than cmd / PowerShell.

Requirement: Git installed with git-bash

Continue reading “[Windows Bash] Use bash instead of cmd Intellij/Android Studio/WebStorm/PHPStorm”