forked from compiler-explorer/infra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin-daily-builds.sh
executable file
·67 lines (51 loc) · 1.9 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
#!/bin/bash
set -exuo pipefail
finish() {
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)
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" "all" || 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)
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" "all" || true
}
init_logspout
build_cpp_libraries
build_rust_libraries
exit ${BUILD_FAILED}