Git Product home page Git Product logo

gitsocket's Introduction

gitsocket Travis CI results

gitsocket is a command line tool to help setup github / bitbucket webhook on your local machine. It helps you to do git based auto deploy.

For more information, please read the project website.

Install

System Requirement

gitsocket is written in golang. It has only been tested and used on Linux. However, any POSIX environment (e.g. Mac OSX) with git and vi installed should be fine.

Manually Compile and Install

You need to install golang first.

Go into the folder. Build with this command:

go get ./...
go build

Just move it to any folder in your $PATH.

Install with go get

If you have properly install golang, setup $PATH to include $GOPATH/bin, you may just use go get to install:

go get github.com/yookoala/gitsocket

Usage

The tool supports 4 commands:

A. Socket Server

Command:

gitsocket server

This command creates a unix socket server. It updates the local git repository to origin/master branch whenever there is socket input to the socket file (default: ./gitsocket.sock).

You may change the remote repository name, branch or socket file path by the command options:

NAME:
   server - socket server. listen to unix socket and update local git repository accordingly

USAGE:
   command server [command options] [arguments...]

OPTIONS:
   --remote, -r "origin"		name of remote repository
   --branch, -b "master"		branch of remote repository
   --listen, -l "./gitsocket.sock"	path to socket to listen for connection
   --pidfile, -p 			path to pidfile. empty for no pidfile
   --output, -o 			log output of server. empty for displaying on stdout
   --daemon, -d				run server as daemon. will discard all output unless you have output flag set.
   --gitrepo, -g 			targeting git repository

B. Run Once

Command:

gitsocket once

This command run as the server is triggered once

NAME:
   once - run as the server is triggered once

USAGE:
   command once [command options] [arguments...]

OPTIONS:
   --remote, -r "origin"	name of remote repository
   --branch, -b "master"	branch of remote repository
   --output, -o 		log output of server. empty for displaying on stdout
   --gitrepo, -g 		targeting git repository

C. Client

Command:

gitsocket client

This command connects to the gitsocket server and trigger one git checkout

NAME:
   client - connects to socket triggers the socket server then returns the output

USAGE:
   command client [command options] [arguments...]

OPTIONS:
   --conn, -c "./gitsocket.sock"	socket or address to connect

D. Setup Helper

Command:

gitsocket setup

This command helps setup the post-checkout script file with vi. Just a time-saver in case you don't want to read all about git hook.

The script created will be run whenever git checkout is run. It will be triggered after each time gitsocket server is triggered.

NAME:
   setup - help setting up the post-checkout hook in the current repository folder. depends on vi

USAGE:
   command setup [command options] [arguments...]

OPTIONS:
   --command, -c 	Use shell command to be run in post-checkout hook. By default it starts vi to edit it. If the file exists, it fails (unless you have -f flag).
   --force, -f		Overwrites the current file with -c flag set. Default not set
   --gitrepo, -g 	targeting git repository

Report Bug

You are welcomed to report issue of this software.

Please use our issue tracker to report problem.

License

This software is licensed under MIT license.

You can find a copy of the license in this repository.

gitsocket's People

Contributors

yookoala avatar

Stargazers

Dan Tamas avatar

Watchers

 avatar James Cloos avatar

gitsocket's Issues

Add a gh page

Better explain the whole thing with Github pages.

Add example

Add proper example how to trigger the githook

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.