• Stars
    star
    558
  • Rank 76,898 (Top 2 %)
  • Language
    Shell
  • License
    MIT License
  • Created over 10 years ago
  • Updated about 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Minimalistic SSH deployment

shipit :shipit:

Minimalistic SSH deployment.

shipit

Installation

Copy this one-liner and run it in your shell:

SHPT=/usr/local/bin/shipit && curl -o $SHPT https://raw.githubusercontent.com/sapegin/shipit/master/bin/shipit && chmod +x $SHPT && unset SHPT

You can use this command to update shipit too.

Note: Use sudo or replace /usr/local/bin/shipit to path somewhere inside your home directory.

Usage

shipit [option] <command>

Commands

Command Aliases Description
<target> Execute target target on the remote host
list ls Print list of available targets
console shell, ssh Open an SSH session on remote host
exec <cmd> run Execute cmd on the remote host
copy <file> cp Copy files to the remote host
--version -V Print shipit version
--help -h Print help

Options

Option Description
-c, --config Config file path (default: .shipit)
-r, --remote Override remote host
-v, --verbose Enable verbose mode for SSH

Examples

Execute deploy target:

shipit

Execute status target:

shipit status

Show a list of available targets:

shipit list

Execute uptime command on the remote host:

shipit exec uptime

Configuration

You need to create .shipit file in your project’s directory.

Here is a typical config:

host='myhost'
path='sites/example.com'

[deploy:local]
git push origin master

[deploy]
git checkout master
git pull
npm install
grunt build

[status]
uptime

The only required things are host and path parameters, and [deploy] or [deploy:local] target.

For non-standard port number and to specify which SSH key to use, edit your SSH config, ~/.ssh/config:

host example.com
IdentityFile ~/.ssh/keyfile
port 10022
user usernamehere

Parameters

host

It’s the same host you use in ssh command. It could be string of format <username>@<ip>:<port> or just a name of ~/.ssh/config record.

path

Project path on remote host. shipit will cd to this directory before executing any command.

Targets

Target is just a bunch of shell command that will be executed on remote host via SSH. You can define as many targets as you want.

Note that you can’t use blank lines inside targets but you can use comments (#) and other things—it’s just a shell script.

Local targets

If you append :local to a target name (like [name:local]) it will be executed on your local machine before remote target with the same name. You can define only local, only remote or both targets.

In case of any errors in local target remote target won’t be executed.

You can use these variables:

  • $SSH_HOST — your config’s host value,
  • $SSH_PATH — your config’s path value.

Examples

Deploy from Git

host='myhost'
path='sites/example.com'

[deploy:local]
git push origin master

[deploy]
git checkout master
git pull
npm install
npm prune
npm run build

Deploy with rsync

host='myhost'
path='sites/example.com'

[deploy:local]
npm test
npm run build
rsync --archive --compress --force --delete public/ $SSH_HOST:$SSH_PATH

Changelog

The changelog can be found on the Releases page.

Sponsoring

This software has been developed with lots of coffee, buy me one more cup to keep it going.

Buy Me A Coffee


Authors and license

Artem Sapegin and contributors.

MIT License, see the included License.md file.

More Repositories

1

jest-cheat-sheet

Jest cheat sheet
5,071
star
2

mrm

Codemods for your project config files
JavaScript
1,585
star
3

grunt-webfont

SVG to webfont converter for Grunt
JavaScript
1,104
star
4

social-likes

Beautiful social “like” buttons with counters for jQuery.
CSS
1,089
star
5

dotfiles

My macOS environment: zsh, Git, Visual Studio Code, etc.
Shell
463
star
6

jquery.mosaicflow

Pinterest like responsive image grid that doesn’t suck
HTML
308
star
7

grunt-bower-concat

Bower components concatenator for Grunt
JavaScript
219
star
8

react-components

List of React components I use and recommend
193
star
9

washingcode-book

📖 Book on clean code for frontend developers
JavaScript
175
star
10

social-likes-next

Beautiful modern share buttons
JavaScript
163
star
11

stack-styled

Stacking layouts for React
TypeScript
141
star
12

richtypo.js

Typography enhancer for Node.js
TypeScript
122
star
13

fledermaus

Batman’s toolbelt for static site generation
JavaScript
78
star
14

q-i

Node.js objects inspector with color highlighting
JavaScript
62
star
15

react-spaceman

React component to manage whitespace
TypeScript
61
star
16

proselint

Proselint wrapper with a friendly reporter
JavaScript
58
star
17

react-group

Render React children with a separator
JavaScript
48
star
18

textlint-rule-terminology

Textlint rule to check correct terms spelling
JavaScript
44
star
19

react-weather

React/alt/ES6/Webpack demo app
JavaScript
41
star
20

blog.sapegin.me

My tech blog
TypeScript
38
star
21

squirrelsong

Low contrast light & dark themes
CSS
37
star
22

bower-update

DEPRECATED. Updates Bower components to the really latest versions.
JavaScript
37
star
23

mrm-core

Utilities to make tasks for Mrm
JavaScript
33
star
24

frontend-pull-request-checklist

Frontend pull request checklist
33
star
25

mrm-tasks

Mrm tasks: codemods for your config files
JavaScript
32
star
26

sweet

Simplest Web Engine Ever, The
JavaScript
29
star
27

fontoptim

Generates CSS with WOFF(2) fonts embedded as Base64
HTML
25
star
28

squirrelstrap

Set of Grunt templates for faster front-end web development
PHP
22
star
29

textlint-rule-stop-words

Textlint rule to find filler words, buzzwords and clichés
JavaScript
22
star
30

expect-react-shallow

JSX assertions with Chai-like API (based on unexpected-react-shallow)
JavaScript
20
star
31

grunt-fingerprint

Assets versioning task for Grunt
JavaScript
19
star
32

picturebeaver

WSH script for batch optimization PNG/JPEG/GIF images using optipng/jpegtran/gifsicle utilities.
19
star
33

csso-stylus

CSSO plugin for Stylus.
CoffeeScript
16
star
34

grunt-fontoptim

Generates CSS with WOFF(2) fonts embedded as Base64
JavaScript
16
star
35

morning.photos

My photo gallery
TypeScript
15
star
36

user-meta

Read user name, email and URL from .npmrc or .gitconfig
JavaScript
14
star
37

grunt-shower-markdown

Grunt task that generates Shower presentations from Markdown source
JavaScript
14
star
38

grunt-imgo

Image optimization for Grunt using imgo
JavaScript
13
star
39

csscolors

All named CSS colors on a single page
HTML
12
star
40

cddcourse

Component-driven development course
JavaScript
12
star
41

PEW

Photoshop Export Workflow: simple Photoshop scripts for file saving automation
JavaScript
12
star
42

sapegin.me

My home page and blog
TypeScript
12
star
43

grunt-stylus

DEPRECATED. Stylus task for Grunt
JavaScript
11
star
44

rtl-article-2019

Modern React testing: Jest and Enzyme
JavaScript
11
star
45

react-pixel-gif

1×1 pixel GIF component for React
JavaScript
9
star
46

react-text-stats

React/alt/ES6/Webpack/Jest demo app
JavaScript
8
star
47

coffeetimer

Basic filter coffee timer web app
TypeScript
8
star
48

react-pagify-preset-bootstrap

Bootstrap preset for react-pagify
JavaScript
8
star
49

grunt-article-examples

Тестовый Грант-проект
JavaScript
8
star
50

hello-box-flex-stack

“Say hello to Box, Flex and Stack: layouts in the component era” talk slides
JavaScript
7
star
51

cypress-article-2020

Modern React testing article examples: Cypress and Cypress Testing Library
JavaScript
6
star
52

enzyme-article-2019

Modern React testing: Jest and Enzyme
JavaScript
6
star
53

textlint-rule-apostrophe

Textlint rule to check correct apostrophe usage
JavaScript
5
star
54

hashnav

Simplest JavaScript hash navigation.
JavaScript
5
star
55

writing-style

English style guide
5
star
56

smpltmpl

Simple templates for Node.js based on ECMAScript template literals syntax
JavaScript
5
star
57

textlint-rule-title-case

Textlint rule to ensure that titles are using AP/APA style
JavaScript
5
star
58

every.morning.photos

My Instagram photos made on this day
TypeScript
5
star
59

lightroom-book-ru

Разумный рабочий процесс в Lightroom
5
star
60

til

Today I learned
4
star
61

textlint-rule-diacritics

Textlint rule to check correct usage of diacritics
JavaScript
4
star
62

grunt-talk-examples

Примеры к докладу про Grunt
PHP
4
star
63

deabsdeep

Recursively replace absolute paths in objects and arrays with ~
JavaScript
3
star
64

slides

Slides from my talks
HTML
3
star
65

package-repo-url

Returns GitHub repository URL based on package.json.
JavaScript
3
star
66

jquery-nicehover

jQuery delayed hover event
JavaScript
2
star
67

instagram-poster

Script to post photos to Instagram
JavaScript
2
star
68

egghead-typescript-webpack-css-modules

How to use CSS Modules with TypeScript and webpack
JavaScript
2
star
69

SublimeGruntWatch

Grunt Watch plugin for Sublime Text 2
Python
2
star
70

social-share-services

Social share sites data: icon, popup URL, etc.
JavaScript
2
star
71

grunt-sweet

Sweet task for Grunt
HTML
2
star
72

jscodestyle

What JavaScript code style is the most popular
HTML
2
star
73

git-default-branch

Returns Git default branch name
JavaScript
2
star
74

fingerprinter

Generic assests fingerprint generator
CSS
1
star
75

cv

My résumé
HTML
1
star
76

wp-typohelper

Russian typography for WordPress
PHP
1
star
77

home-assistant-config

My Home Assistant config
Python
1
star
78

fog.morning.photos

Is it foggy in Berlin?
TypeScript
1
star
79

gatsby-lessons

Egghead lessons on Gatsby
CSS
1
star