-
Notifications
You must be signed in to change notification settings - Fork 4
/
build-all.sh
50 lines (41 loc) · 1.16 KB
/
build-all.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
#!/usr/bin/env bash
set -xe
SOURCES_URL="$( cat latest-squid-url.txt )"
if [[ -z "${CUSTOM_SOURCES_URL}" ]];then
echo ""
else
# Validate that the url exists?
# curl -I "${CUSTOM_SOURCES_URL}"|grep "200 OK"
export SOURCES_URL="${CUSTOM_SOURCES_URL}"
fi
COMPRESSION="store"
DEBUG_MODE="1"
USE_CCACHE="1"
CCACHE_DIR="/srv/ccache"
RELEASE_NUMBER=$(head -1 release)
BUILD_ARRAY=`ls -d squid*/`
if [[ ! -z "${BUILD_ONLY}" ]];then
BUILD_ARRAY=`ls -d */|egrep "${BUILD_ONLY}"`
fi
#for Build in `find ./ -type d -maxdepth 1`
for Build in ${BUILD_ARRAY}
do
echo "${Build}"
stat "${Build}/build" || continue
cd "${Build}"
DOCKER_IMAGE=`cat podmanimage`
echo "${DOCKER_IMAGE}"
stat build && stat podmanimage && \
( podman image inspect "${DOCKER_IMAGE}" || buildah bud -t "${DOCKER_IMAGE}" . )
stat build && podman run -it \
-e COMPRESSION="${COMPRESSION}" \
-e DEBUG_MODE="${DEBUG_MODE}" \
-e USE_CCACHE="${USE_CCACHE}" \
-e CCACHE_DIR="${CCACHE_DIR}" \
-e RELEASE_NUMBER="${RELEASE_NUMBER}" \
-e SOURCES_URL="${SOURCES_URL}" \
-v `pwd`/srv:/srv \
"${DOCKER_IMAGE}"
cd -
done
set +xe