-
Notifications
You must be signed in to change notification settings - Fork 19
/
.travis
executable file
·55 lines (48 loc) · 1.71 KB
/
.travis
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
52
53
54
55
#!/usr/bin/env sh
set -e
_BASH_VERSION="${_BASH_VERSION-latest}"
if [ -n "$DOCKER_PASSWORD" ] && [ -n "$DOCKER_USERNAME" ]; then
echo "$DOCKER_PASSWORD" |
docker login \
--username "$DOCKER_USERNAME" \
--password-stdin
fi
for clone_target in /dotfiles /root/.dotfiles; do
>&2 printf 'Bootstrapping with absolute path to %s\n' "$clone_target"
docker run \
--rm \
--volume "$PWD:$clone_target" \
"bash:$_BASH_VERSION" \
sh -c "apk add perl tree &&
bash --version &&
$clone_target/bootstrap && tree -a ~"
>&2 printf 'Bootstrapping with relative path to %s\n' "$clone_target"
docker run \
--rm \
--volume "$PWD:$clone_target" \
"bash:$_BASH_VERSION" \
sh -c "apk add perl tree &&
bash --version &&
cd $clone_target && ./bootstrap && tree -a ~"
>&2 printf 'Bootstrapping with files that would be overwritten\n'
if docker run \
--rm \
--volume "$PWD:$clone_target" \
"bash:$_BASH_VERSION" \
sh -c "apk add perl tree &&
bash --version &&
touch ~/.bashrc
$clone_target/bootstrap"; then
>&2 printf 'This should have failed because the home directory contains a file that would be overwritten.\n'
exit 1
fi
>&2 printf 'Forced bootstrapping with files that would be overwritten\n'
docker run \
--rm \
--volume "$PWD:$clone_target" \
"bash:$_BASH_VERSION" \
sh -c "apk add perl tree &&
bash --version &&
touch ~/.bashrc
$clone_target/bootstrap --force && tree -a ~"
done