Introduce kickstart deploy
This commit is contained in:
parent
a833d374d1
commit
fcfd9c516e
20
README.md
20
README.md
@ -55,6 +55,26 @@ Compile the current workspace into the folder to be packaged on deploy
|
||||
kickstart compile
|
||||
```
|
||||
|
||||
#### deploy
|
||||
Takes an host target and deploy the compiled code on it.
|
||||
|
||||
```bash
|
||||
kickstart deploy [target] [roles ...]
|
||||
```
|
||||
|
||||
##### Examples
|
||||
Deploy a role on a host
|
||||
|
||||
```bash
|
||||
kickstart deploy vagrant@localhost nodejs
|
||||
```
|
||||
|
||||
Deploy two roles on a host with an alternative port
|
||||
|
||||
```bash
|
||||
kickstart deploy "-p 2222 vagrant@localhost" nodejs redis
|
||||
```
|
||||
|
||||
|
||||
### Thanks
|
||||
This project was inspired on [sunzi](https://github.com/kenn/sunzi)
|
||||
|
18
lib/kickstart-deploy
Executable file
18
lib/kickstart-deploy
Executable file
@ -0,0 +1,18 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
target=$1
|
||||
[ "$target" ] || echo "Please, provide an ssh target"
|
||||
shift
|
||||
|
||||
remote_command=$(
|
||||
cat <<CMD
|
||||
[ -d ~/kickstart ] && rm -rf ~/kickstart
|
||||
mkdir ~/kickstart
|
||||
cd ~/kickstart
|
||||
tar xz
|
||||
bash install.sh
|
||||
CMD
|
||||
)
|
||||
|
||||
kickstart compile $@
|
||||
tar chz -C compile . | ssh $target "$remote_command"
|
Loading…
Reference in New Issue
Block a user