-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild_back_ends
executable file
·50 lines (38 loc) · 993 Bytes
/
build_back_ends
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
#! /bin/bash
set -o errexit
mode=${1}
if [[ "${mode}" == "" ]]
then
echo Please specify the mode when building the back end containers.
exit 1
fi
current_dir="$(pwd)"
tmp_dir=/tmp/codebuddy_backends
for container_dir in ${current_dir}/back_ends/*
do
dir_name=$(basename ${container_dir})
image_name=codebuddy/${dir_name}_${mode}
dir_path=${tmp_dir}/${dir_name}
if [[ "${dir_name}" == "python_testing_only" ]]
then
continue
fi
if [[ "${dir_name}" == "not_code" ]]
then
continue
fi
rm -rf ${dir_path}
mkdir -p ${dir_path}
cp -r ${container_dir}/* ${dir_path}/
cp ${current_dir}/exec_back_end.sh ${dir_path}/exec.sh
cp ${current_dir}/VERSION ${dir_path}/
cd ${dir_path}
echo "Building ${image_name}"
docker build \
--platform=linux/amd64 \
-t ${image_name}:version$(cat VERSION) \
-t ${image_name}:latest \
-f Containerfile \
.
rm -rf ${dir_path}
done