-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate-container.sh
52 lines (41 loc) · 975 Bytes
/
create-container.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
set -e
dockerrun="sudo docker run --name"
dockersockandbin="-v /var/run/docker.sock:/var/run/docker.sock -v $(which docker):/bin/docker"
dockerlinktest="--link unitbox:unitbox"
dockervolumes="--volumes-from datavol"
alone(){
name="${1:-devbox}"
$dockerrun $name --rm -it $dockersockandbin $dockerlinktest $dockervolumes devbox tmux -2
}
pair(){
name="${1:-pairbox}"
users="`join , ${@:2}`"
pairs="-e AUTHORIZED_GH_USERS=$users -p 0.0.0.0:8109:22"
$dockerrun $name -dt $dockersockandbin $dockerlinktest $dockervolumes $pairs pairbox
}
join(){
local IFS="$1"
shift
echo "$*"
}
unit(){
name="${1:-unitbox}"
$dockerrun $name -dt $dockervolumes unitbox sh
}
acceptance(){
echo "Hello source"
#cucumber container
}
justMe(){
unit
acceptance
alone
}
weAll(){
pair pairbox #users
unit
acceptance
}
#testar se $@ tem algo, se não tiver chamar o main, se tiver chamar o $@
"$@"