Coder Social home page Coder Social logo

mrwokkel / git-deploy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from michalsvec/git-deploy

1.0 2.0 0.0 148 KB

Quick and easy deployment from git repository to FTP server.

Home Page: http://blog.aizatto.com/2010/05/15/git-deploy-released/

License: MIT License

git-deploy's Introduction

git-deploy

Description

git-deploy is a deployment tool to allow for quick and easy deployments based on the changes in a git repository.

It was originally used to update multiple WordPress installations on shared hosting environments. Ideally Capistrano would have been the perfect tool, but generally shared hosting environments only allow for FTP access, which Capistrano does not support. Likewise rather than using a standard FTP program, when doing a deployment, I only need to upload the files that have been changed. This saves me both time and bandwidth.

I needed something like Capistrano, but simpler.

git-deploy supports deployment over SSH and FTP.

Installation

git-deploy requires the Ruby gems net-ssh, net-sftp, net-scp.

You can install them like so:

sudo gem install net-ssh net-sftp net-scp

Usage

In the root directory of your source code, create a deploy.yml file.

Here is a sample code:

'settings':
  ignore_if_same_revision: true

'ftp://example:[email protected]:21/path/to/installation':
  skip: false

You use the URI scheme to define the location of your installation. If you do not want to use the URI scheme, and instead use another identifier. Feel free to do so. Just enter the settings for the host like so:

'example':
  skip: false
  scheme: ftp
  user: example
  password: password
  host: example.com
  port: 21
  path: /path/to/installation

Note: The port field is optional in both the URI scheme and the broken down options

Once you have done creating the deploy.yml, upload to your server a file called REVISION with the revision string for the current revision residing on the server

After you have commited your code to the repository. You can run

git deploy

You will also need to upload a REVISION file to your server inside the installation path, ie “/path/to/installation”

To create a REVISION file for HEAD, exexcute:

git rev-parse HEAD > REVISION

This will create a REVISION file which you will need to upload to your server

Additional Keys

The configuration for a site has additional and optional options:

  • skip: true or false (default). Whether to skip the configuration

  • debug_mode: true or false (default). For FTP only. Outputs debugging information

  • passive: true or false (default). For FTP only. Enable passive connection.

  • local_path: string. Only consider files to upload in a particular local path.

How It Works

git-deploy stores file called REVISION on your server inside the root path to your application. This file stores the current revision of your application residing on your server.

When you run a git deploy, git-deploy downloads the REVISION file, and checks to see what files are different between revisions and either upload the changed files or deletes them from the server.

TODO

  • Create a Ruby gem for the script. Sadly gem-deploy was taken.

git-deploy's People

Stargazers

 avatar

Watchers

 avatar  avatar

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.