-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·82 lines (69 loc) · 2.32 KB
/
install
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash
SCRIPT_DIR="$(cd "$(dirname "$0")" || exit ; pwd -P)"
# shellcheck source=/dev/null
source "${SCRIPT_DIR}/common-functions.sh"
cd "${SCRIPT_DIR}" || die "can't change to ${SCRIPT_DIR}"
if [ -n "${RUNNING_IN_DOCKER}" ]; then
export CI_COMMIT_REF_NAME="docker"
fi
start_time="$(date -u +%s)"
log_info "Starting install script"
log_info "CI branch: ${CI_COMMIT_REF_NAME}"
./check_for_updates git-*
CHECK_RET="$?"
if [ -z "${CI_COMMIT_REF_NAME}" ]; then
echo "NOT doing CI"
if [[ "$(hostname -f)" == *"elyograg"* ]]; then
if [[ "$(hostname)" != *"smeagol"* ]]; then
log_warn "Syncing from elyograg.org primary server."
checksum_before=$(find . -type f -exec md5sum {} + | grep -v "\.git" | sort | md5sum)
./sync_from_creator 2>&1
checksum_after=$(find . -type f -exec md5sum {} + | grep -v "\.git" | sort | md5sum)
if [ "$checksum_before" != "$checksum_after" ]; then
log_warn "Sync detected changes. Forcing build."
touch ./force
fi
else
log_info "This host IS the originating system. Skipping sync"
fi
else
echo "This host is not in the elyograg.org namespace. Skipping sync"
./fixperms
if [ -z "${CI_COMMIT_REF_NAME}" ]; then
fetch_from_git "myself"
fi
fi
fi
end_time="$(date -u +%s)"
sync_elapsed="$(($end_time-$start_time))"
log_info "- Sync done or skipped"
if [ "${CHECK_RET}" -eq 0 ] && [ ! -f ./force ]; then
log_warn "No updates. Create a file named 'force'"
log_warn "to proceed with the build anyway."
exit 0
fi
cd "${SCRIPT_DIR}"
HAPROXY_GIT="$(ls -1trd git-haproxy-* | tail -n1)"
rm ./force -f
./create-haproxy-service "${HAPROXY_GIT}"
if [ ! -d git-haproxy-3.0 ] || [ ! -d git-quictls ]; then
start_time="$(date -u +%s)"
./prep-source
end_time="$(date -u +%s)"
prep_elapsed="$(($end_time-$start_time))"
fi
start_time="$(date -u +%s)"
./new-quic git-quictls 2>&1
end_time="$(date -u +%s)"
quictls_elapsed="$(($end_time-$start_time))"
start_time="$(date -u +%s)"
./new-haproxy git-haproxy-3.0 2>&1
end_time="$(date -u +%s)"
haproxy_elapsed="$(($end_time-$start_time))"
echo
echo "seconds for sync : ${sync_elapsed}"
if [ -n "${prep_elapsed}" ]; then
echo "seconds for source prep : ${prep_elapsed}"
fi
echo "seconds for quictls build: ${quictls_elapsed}"
echo "seconds for haproxy build: ${haproxy_elapsed}"