fix docker-compose

This commit is contained in:
bwcx_jzy 2023-04-04 18:22:28 +08:00
parent d96346b5a5
commit 797550f0b4
No known key found for this signature in database
GPG Key ID: 5E48E9372088B9E5
4 changed files with 13 additions and 12 deletions

View File

@ -156,8 +156,8 @@ web_modules/
.yarn-integrity
# dotenv environment variables file
.env
.env.test
#.env
#.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache

View File

@ -285,6 +285,7 @@ git clone https://gitee.com/dromara/Jpom.git
cd Jpom
docker-compose -f docker-compose.yml up
# docker-compose -f docker-compose.yml up --build
# docker-compose -f docker-compose.yml build --no-cache
# docker-compose -f docker-compose-local.yml up
# docker-compose -f docker-compose-local.yml build --build-arg TEMP_VERSION=.0
```

View File

@ -32,7 +32,7 @@ VOLUME ["/root/.m2","/target/dependency/web-vue/node_modules"]
ARG TEMP_VERSION=""
ARG JPOM_VERSION
ENV USE_JPOM_VERSION=${JPOM_VERSION}${TEMP_VERSION}
RUN --mount=type=cache,target=/root/.m2 sh ./script/replaceVersion.sh ${USE_JPOM_VERSION}
RUN --mount=type=cache,target=/root/.m2 bash ./script/replaceVersion.sh "${USE_JPOM_VERSION}" "release"
ENV NODE_VERSION 16.13.1

View File

@ -42,8 +42,8 @@ Linux)
esac
base=${bin_abs_path}/../
echo "当前路径:${current_path} 脚本路径:${bin_abs_path}"
tag="$2"
echo "当前路径:${current_path} 脚本路径:${bin_abs_path} $tag"
if [ -n "$1" ]; then
new_version="$1"
@ -51,18 +51,18 @@ if [ -n "$1" ]; then
echo "$old_version 替换为新版本 $new_version"
else
# 参数错误,退出
echo "ERROR: 请指定新版本!"
exit
echo "ERROR: 请指定新版本!" 2>&2
exit 1
fi
if [ ! -n "$old_version" ]; then
echo "ERROR: 旧版本不存在,请确认 /script/tag.$tag.txt 中信息正确"
exit
echo "ERROR: 旧版本不存在,请确认 /script/tag.$tag.txt 中信息正确" 2>&2
exit 1
fi
echo "替换配置文件版本号 $new_version"
if [ "$tag" == "release" ]; then
if [[ "$tag" == "release" ]]; then
# 替换 Dockerfile 中的版本
sed -i.bak "s/${old_version}/${new_version}/g" "$base/modules/server/Dockerfile"
sed -i.bak "s/${old_version}/${new_version}/g" "$base/modules/agent/Dockerfile"
@ -77,12 +77,12 @@ if [ "$tag" == "release" ]; then
elif [ "$tag" == "beta" ]; then
sed -i.bak "s/${old_version}/${new_version}/g" "$base/modules/server/DockerfileBeta"
else
echo "不支持的模式 $tag"
exit
echo "不支持的模式 $tag" 2>&2
exit 2
fi
# 替换所有模块pom.xml中的版本
cd "${base}" && mvn versions:set -DnewVersion=$new_version
cd "${base}" && mvn -s "$base/script/settings.xml" versions:set -DnewVersion=$new_version
# 替换 docker 中的版本
sed -i.bak "s/${old_version}/${new_version}/g" "$base/env-$tag.env"