Deploy Using Git Pull

Automatically pull files from bitbucket git repo upon commit/merge to master.

Whenever there’s a need to deploy by means of an automated git pull, without the whole container,  docker registry, aws overhead, the code below works best.

exec(“git pull https://username:password@bitbucket.org/company/repo.git master”);

Here are the step-by step instructions

  1. Create a user on bitbucket with access to the desired repository.
  2. SSH to your remote server, where the code should be pulled to.
  3. Clone the repository into the desired directory:  git clone https://username:password@bitbucket.org/company/repo.git
  4. Create a script (python, php or shell) – doesn’t matter. The “exec” command above is for php.  Script should be accessible from the web.
  5. Add a webhook to the repository on bitbucket, where the triggered url is the url to the php script.

All done! Now every time there’s a change to master, the code will be pulled by the remote server.

Why use username and password and not SSH keys?

SSH keys won’t work for a number of reasons, but anyone is free to give it a shot and let us know how it went. Note, the script is executed by the webserver, which runs under it’s own user that naturally has no access to the private key. Trying to make the keys available for that user is  not worth the headache.

Bitbucket’s own documentation has an FTP example, why not use that?

The whole FTP business is not secure and not that widely used. If one can avoid spinning up an FTP server, one probably should.

Below are a few search queries suggested by google, left here to help those seeking the solution to their problem 🙂

How to sync with git repository

Bitbucket pull via ftp sftp

Deploy using ftp sftp

Automate git pull

Simplest continuous integration

muCommander for Mac OS X

Mac OS has long lacked a robust file manager and unfortunately continues to do so, sigh. Nonetheless there exists muCommander, which fills the void. A cross-platform file manager written in Java is a great tool. Free download of muCommander v. 0.9.1 (year 2016) is available from our site.

Note: You need to have java installed in order for muCommander to work. In case you don’t have it already, we recommend using homebrew or the official java installer for Mac OS. Tips and instructions are available via Google search or this link.

Unfortunately the official muCommander site hasn’t been updated for years and while anyone can download and compile the app from source files, available on github, it may not be as easy and straightforward even for tech savy users. Since our team uses muCommander for daily operations and a member of our team occasionally contributes to the code he decided to compile a stable and working solution for all of us to use. We decided to share it with everybody else. Enjoy!

Отладка. Будет убрана потом