summaryrefslogtreecommitdiffstats
path: root/bootstrap-main.sh
blob: 68772fc0e26c2b81d0c6909874fad95283d8ca01 (plain)
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/sh
#
# Initial port bootstrap scripts
# bootstrap-main.sh
# Runs the other scripts to perform a full bootstrap.
#
# Copyright (C) 2013  Patrick "P. J." McDermott
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

set -e

SCRIPT_DIR=

main()
{
	SCRIPT_DIR="$(cd "${0%/*}" && pwd)"
	DATE="$(date '+%Y-%m-%d_%H:%M:%S')"

	[ -d logs ] || mkdir logs

	{ time -p "${SCRIPT_DIR}/bootstrap-prepare.sh"; } \
		>"logs/${DATE}_prepare.log" 2>&1
	{ time -p "${SCRIPT_DIR}/bootstrap-stage1-build.sh"; } \
		>"logs/${DATE}_stage1-build.log" 2>&1
	{ time -p "${SCRIPT_DIR}/bootstrap-stage1-install.sh"; } \
		>"logs/${DATE}_stage1-install.log" 2>&1
	{ time -p "${SCRIPT_DIR}/bootstrap-stage1-test.sh"; } \
		>"logs/${DATE}_stage1-test.log" 2>&1
	{ time -p "${SCRIPT_DIR}/bootstrap-stage2-build.sh"; } \
		>"logs/${DATE}_stage2-build.log" 2>&1
	{ time -p "${SCRIPT_DIR}/bootstrap-stage2-install.sh"; } \
		>"logs/${DATE}_stage2-install.log" 2>&1
	{ time -p "${SCRIPT_DIR}/bootstrap-stage2-test.sh"; } \
		>"logs/${DATE}_stage2-test.log" 2>&1
	{ time -p "${SCRIPT_DIR}/bootstrap-stage3-build.sh"; } \
		>"logs/${DATE}_stage3-build.log" 2>&1
}

main "${@}"