forked from HariSekhon/Dockerfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·42 lines (31 loc) · 1.05 KB
/
build.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
#!/usr/bin/env bash
# vim:ts=4:sts=4:sw=4:et
#
# Author: Hari Sekhon
# Date: 2019-03-16 14:44:58 +0000 (Sat, 16 Mar 2019)
#
# https://github.com/harisekhon/Dockerfiles
#
# License: see accompanying Hari Sekhon LICENSE file
#
# If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish
#
# https://www.linkedin.com/in/harisekhon
#
set -euo pipefail
[ -n "${DEBUG:-}" ] && set -x
# doesn't work because it executes from within docker container where Makefile isn't available
#srcdir="$(dirname "$0")"
#repo="$(sed -n '/REPO/ s,.*/,,; s/:.*//; /tools/ p' Makefile)"
repo="$(env | grep ^PATH= | sed 's/.*github\///; s/:.*//')"
github="/github"
mkdir -pv "$github"
cd "$github"
if type -P apt-get &>/dev/null; then
apt-get update
apt-get install -y curl
fi
curl -sS "https://raw.githubusercontent.com/HariSekhon/$repo/master/setup/bootstrap.sh" | sh
cd "$github/$repo"
make test
curl -sS https://raw.githubusercontent.com/HariSekhon/bash-tools/master/docker_clean.sh | sh