Giter Site home page Giter Site logo

mishell.sh's Introduction

mishell.sh

It's sexy and contains 'shell'.

Simple git deploy tool completely in bash.

Introduction

Small tool detecting changes in git repository and deploying when needed. Do you hate manually deploy you project to servers every time you push to master? So do I!
This track your branch (for example origin/master) and if you are in detached HEAD state, it will just checkout to that.

Commnads before and after can be executed.

Just put it in cron and forget about it.

Features

  • Extremely simple installation
  • Works on machines in intranets (not accessible form internet)
  • Allows to run pre and post deploy commands
  • cross platform
  • Um... name sounds like a girl

Requirements

  • bash
  • git

Installation

Just download mishell.sh file to your machine.

If you are in Debian you can install latest version by:

sudo curl -L \
  https://raw.githubusercontent.com/pkristian/mishell.sh/master/mishell.sh \
  -o /usr/local/bin/mishell.sh
sudo chmod +x /usr/local/bin/mishell.sh
bash mishell.sh --version .

For downloading specific version, go to releases.

Usage

mishell.sh . is simplest usage is to deploy origin/master in current directory.

If you do not have it as executable, use bash mishell.sh .

More complex usage with same outcome:

mishell.sh \
	--remote origin \
	--branch master \
	--before "" \
	--after "" \
	.

Help:

Usage: mishell.sh [OPTION]... CONTEXT

CONTEXT is directory containing git repository
options:
  --remote string     Remote name
                        (default "origin")
  --branch string     Remote branch name
                        (default "master")
  --before string     Command executed before deploy
                        (default "")
  --after string      Command executed after deploy
                        (default "")
  --print-vars        Show variables and exit
  --version           Show version info and exit
  -q, --quiet         Do not print anything
  -v, --verbose       More verbose
  --help              Show this help

For any additional info visit:
    https://github.com/pkristian/mishell.sh

Testing

If you wish to alter code, you can run tests by bash testCases/testAll.sh

  • New tests are added into separate directories in testCases/
  • Each test consists form files command.sh and expected
  • Before all tests is created testRemote/ with testCases/createTestRemote.sh (if does not exists)
  • Before every test is recreated testRepo/ with testCases/createTestRepo.sh
  • Tests itself are run in direcotry testRepo/

mishell.sh's People

Contributors

pkristian avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

stargator

mishell.sh's Issues

putting tests at next level

Yesterday I was thinking in a sort of set up (prepare scenario) and tear down (remove scenario) for test cases, and just see pr #4 where you implement in part this idea.

In fact, what I am thinking of is a sort of "callback" in the testAll.sh script that looks for and execute a global set up (and tear down after all tests are finished) and even one test case based.

With this you can isolate the scenario creation from the test itself so they will become easier to understand.

fullDeployVerbose test

I was playing around with test and I realized that the fullDeployVerbose test is going to fail if run in another machine with a version of git different from 2.16.2 windows.

Cron directory issue

When using cron there somehow script cant properly cd:
doesn't work:

mishell.sh /var/www/html

works:

cd /var/www/html
mishell.sh .

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.