Add support to send password on deploy
This commit is contained in:
parent
57b73e88fd
commit
b783772864
@ -61,7 +61,7 @@ kickstart compile
|
||||
Takes an host target and deploy the compiled code on it.
|
||||
|
||||
```bash
|
||||
kickstart deploy [--sudo] [target] [roles ...]
|
||||
kickstart deploy [--sudo] [--password PASSWORD] target [roles ...]
|
||||
```
|
||||
|
||||
##### Examples
|
||||
@ -77,6 +77,12 @@ Deploy two roles on a host with an alternative port
|
||||
kickstart deploy "-p 2222 vagrant@localhost" nodejs redis
|
||||
```
|
||||
|
||||
Deploy with sudo and send the password for sudo
|
||||
|
||||
```bash
|
||||
kickstart deploy --sudo --password vagrant "-p 2222 vagrant@localhost" nodejs redis
|
||||
```
|
||||
|
||||
#### local
|
||||
Deploy localy a recipe that is not over ssh. It basicaly compile and run the install script
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
[[ "$1" == "--sudo" ]] && prefix="sudo " && shift
|
||||
[[ "$1" == "--password" ]] && shift && prefix="echo \"$1\" | sudo -S " && shift
|
||||
|
||||
target=$1
|
||||
[ "$target" ] || echo "Please, provide an ssh target"
|
||||
shift
|
||||
|
||||
[[ "$1" == "--sudo" ]] && prefix="sudo " && shift
|
||||
[ "$DEBUG" ] && debug="-x"
|
||||
|
||||
remote_command=$(
|
||||
|
Loading…
Reference in New Issue
Block a user