Support running with sudo
This commit is contained in:
parent
f599567230
commit
47e692b57f
@ -59,7 +59,7 @@ kickstart compile
|
||||
Takes an host target and deploy the compiled code on it.
|
||||
|
||||
```bash
|
||||
kickstart deploy [target] [roles ...]
|
||||
kickstart deploy [--sudo] [target] [roles ...]
|
||||
```
|
||||
|
||||
##### Examples
|
||||
@ -79,7 +79,7 @@ kickstart deploy "-p 2222 vagrant@localhost" nodejs redis
|
||||
Deploy localy a recipe that is not over ssh. It basicaly compile and run the install script
|
||||
|
||||
```bash
|
||||
kickstart local [roles ...]
|
||||
kickstart local [--sudo] [roles ...]
|
||||
```
|
||||
|
||||
#### infect
|
||||
|
@ -1,16 +1,20 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
[[ "$1" == "--sudo" ]] && prefix="sudo " && shift
|
||||
|
||||
target=$1
|
||||
[ "$target" ] || echo "Please, provide an ssh target"
|
||||
shift
|
||||
|
||||
[[ "$1" == "--sudo" ]] && prefix="sudo " && shift
|
||||
|
||||
remote_command=$(
|
||||
cat <<CMD
|
||||
[ -d ~/kickstart ] && rm -rf ~/kickstart
|
||||
mkdir ~/kickstart
|
||||
cd ~/kickstart
|
||||
tar xz
|
||||
bash install.sh
|
||||
$prefix bash install.sh
|
||||
CMD
|
||||
)
|
||||
|
||||
|
@ -1,7 +1,9 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
[[ "$1" == "--sudo" ]] && prefix="sudo " && shift
|
||||
|
||||
kickstart compile $@
|
||||
(
|
||||
cd compile
|
||||
bash install.sh
|
||||
$prefix bash install.sh
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user