forked from compiler-explorer/infra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin-daily-builds.sh
executable file
·102 lines (80 loc) · 2.89 KB
/
admin-daily-builds.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
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/bin/bash
set -exuo pipefail
finish() {
# shellcheck disable=SC2317
ce builder stop
}
trap finish EXIT
ce builder status
ce builder start
BUILD_FAILED=0
init_logspout() {
local LOG_DEST_HOST
LOG_DEST_HOST=$(aws ssm get-parameter --name /compiler-explorer/logDestHost | jq -r .Parameter.Value)
local LOG_DEST_PORT
LOG_DEST_PORT=$(aws ssm get-parameter --name /compiler-explorer/logDestPort | jq -r .Parameter.Value)
ce builder exec -- sudo docker pull gliderlabs/logspout:latest
ce builder exec -- sudo docker stop logspout || true
ce builder exec -- sudo docker rm logspout || true
ce builder exec -- sudo docker run --name logspout \
-d \
-v=/var/run/docker.sock:/tmp/docker.sock \
-e SYSLOG_HOSTNAME=librarybuilder \
gliderlabs/logspout "syslog+tls://${LOG_DEST_HOST}:${LOG_DEST_PORT}"
}
build_cpp_libraries() {
local BUILD_NAME=librarycpp
local COMMAND=build.sh
local CONAN_PASSWORD
CONAN_PASSWORD=$(aws ssm get-parameter --name /compiler-explorer/conanpwd | jq -r .Parameter.Value)
COMPILERS="popular-compilers-only"
DAYOFWEEK=$(date +"%u")
if [ "${DAYOFWEEK}" -eq 7 ]; then
COMPILERS="all"
fi
ce builder exec -- sudo docker run --rm --name "${BUILD_NAME}.build" \
-v/home/ubuntu/.s3cfg:/root/.s3cfg:ro \
-v/opt:/opt:ro \
-e "CONAN_PASSWORD=${CONAN_PASSWORD}" \
"compilerexplorer/library-builder" \
bash "${COMMAND}" "c++" "all" "${COMPILERS}" || true
}
build_rust_libraries() {
local BUILD_NAME=libraryrust
local COMMAND=build.sh
local CONAN_PASSWORD
CONAN_PASSWORD=$(aws ssm get-parameter --name /compiler-explorer/conanpwd | jq -r .Parameter.Value)
COMPILERS="popular-compilers-only"
DAYOFWEEK=$(date +"%u")
if [ "${DAYOFWEEK}" -eq 7 ]; then
COMPILERS="all"
fi
ce builder exec -- sudo docker run --rm --name "${BUILD_NAME}.build" \
-v/home/ubuntu/.s3cfg:/root/.s3cfg:ro \
-v/opt:/opt:ro \
-e "CONAN_PASSWORD=${CONAN_PASSWORD}" \
"compilerexplorer/library-builder" \
bash "${COMMAND}" "rust" "all" "${COMPILERS}" || true
}
build_fortran_libraries() {
local BUILD_NAME=libraryfortran
local COMMAND=build.sh
local CONAN_PASSWORD
CONAN_PASSWORD=$(aws ssm get-parameter --name /compiler-explorer/conanpwd | jq -r .Parameter.Value)
COMPILERS="popular-compilers-only"
DAYOFWEEK=$(date +"%u")
if [ "${DAYOFWEEK}" -eq 7 ]; then
COMPILERS="all"
fi
ce builder exec -- sudo docker run --rm --name "${BUILD_NAME}.build" \
-v/home/ubuntu/.s3cfg:/root/.s3cfg:ro \
-v/opt:/opt:ro \
-e "CONAN_PASSWORD=${CONAN_PASSWORD}" \
"compilerexplorer/library-builder" \
bash "${COMMAND}" "fortran" "all" "${COMPILERS}" || true
}
init_logspout
build_cpp_libraries
build_rust_libraries
build_fortran_libraries
exit ${BUILD_FAILED}