promise-for-git

1.0.2 • Public • Published

git-promise

Add commands to run as branches merge down stream.

promise new <promise> <extension>

promise new tables sql

promise add <promise> <command>

mysql "ALTER TABLE table ADD some_column int"
promise add tables ALTER TABLE table ADD some_column int

promise pull <promise>

promise pull tables
mysql "source tables.sql"

promise resolve <promise>

promise resolve tables

Example

# Create promise for SQL 
promise new tables sql

Dev server 1

# Add a line to our promise 
promise add tables ALTER TABLE table ADD some_column int
# Push changes 
git add -A && git commit && git push

Dev server 2

# Add a line to our promise 
promise add tables ALTER TABLE table ADD some_column_other_column VARCHAR(32)
# Push changes 
git add -A && git commit && git push

Test / Master server

# Pull changes 
git pull
promise pull tables
cat tables.sql
  # ALTER TABLE table ADD some_column int 
  # ALTER TABLE table ADD some_column_other_column VARCHAR(32) 
 
# Apply changes 
mysql "source tables.sql"
 
# Resolve changes 
promise resolve tables
cat tables.sql # Empty 

Pull and resolve should always be used together, in one sitting.

promise pull
do_something
promise resolve

promise add will overwrite the cache and should be done after promise pull.

Readme

Keywords

none

Package Sidebar

Install

npm i promise-for-git

Weekly Downloads

0

Version

1.0.2

License

GPL-3.0-or-later

Unpacked Size

40.5 kB

Total Files

13

Last publish

Collaborators

  • brandondyer64