2023-06-16 11:22:47 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
version=errcode
|
|
|
|
|
repository=${1}
|
2023-06-16 11:33:41 +08:00
|
|
|
if [[ -z ${repository} ]]
|
|
|
|
|
then
|
|
|
|
|
echo "repository is empty"
|
|
|
|
|
exit 0
|
2023-06-16 11:28:49 +08:00
|
|
|
fi
|
2023-06-16 11:22:47 +08:00
|
|
|
|
|
|
|
|
set +e
|
|
|
|
|
echo "repository: ${repository}"
|
|
|
|
|
source ./path_info.cfg
|
|
|
|
|
echo "start to build docker images"
|
2023-06-16 14:04:26 +08:00
|
|
|
currentPwd=`pwd`
|
2023-06-16 13:58:12 +08:00
|
|
|
echo ${currentPwd}
|
2023-06-16 11:22:47 +08:00
|
|
|
i=0
|
|
|
|
|
for path in ${service_source_root[*]}
|
|
|
|
|
do
|
2023-06-16 13:16:20 +08:00
|
|
|
cd ${path}
|
|
|
|
|
make build
|
2023-06-16 11:22:47 +08:00
|
|
|
image="${repository}/${image_names[${i}]}:$version"
|
|
|
|
|
echo ${image}
|
2023-06-16 13:20:45 +08:00
|
|
|
docker build -t $image . -f ./deploy.Dockerfile
|
2023-06-16 11:22:47 +08:00
|
|
|
echo "build ${image} success"
|
|
|
|
|
docker push ${image}
|
|
|
|
|
echo "push ${image} success"
|
|
|
|
|
echo "=============================="
|
|
|
|
|
i=$((i + 1))
|
2023-06-16 13:16:20 +08:00
|
|
|
cd ${currentPwd}
|
2023-06-16 11:22:47 +08:00
|
|
|
done
|
|
|
|
|
|
|
|
|
|
echo "build all images success"
|