Skip to content

Commit 0e9ef92

Browse files
authored
refactor: unify docker compose online&offline deploy (#175)
* refactor: unify docker compose online&offline deploy * fix: fix all-in-one tar path
1 parent a26da1e commit 0e9ef92

File tree

3 files changed

+6
-62
lines changed

3 files changed

+6
-62
lines changed

.github/all-in-one/docker-compose/build.sh

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
#!/bin/bash
22

3-
dir="docker-compose"
4-
53
pwd
64
cp -r ../docker-compose ./
7-
cd docker-compose
8-
tar -czvf ./univer.tar.gz * .[!.]*
9-
mv ./univer.tar.gz ../
10-
cd ../
115

12-
source ${dir}/.env
6+
source docker-compose/.env
7+
8+
mv docker-compose univer-server-${UNIVERSER_VERSION}
139

1410
echo "save univer image"
1511
docker pull univer-acr-registry.cn-shenzhen.cr.aliyuncs.com/release/universer:${UNIVERSER_VERSION}
@@ -61,9 +57,10 @@ docker save \
6157
kbudde/rabbitmq-exporter:${RABBITMQ_EXPORTER_VERSION} \
6258
| gzip > observability-image.tar.gz
6359

64-
rm -rf $dir
60+
mkdir all-in-one.$1.${UNIVERSER_VERSION}
61+
mv univer-image.tar.gz observability-image.tar.gz univer-server-${UNIVERSER_VERSION}/ load-images.sh ./all-in-one.$1.${UNIVERSER_VERSION}
6562

66-
tar -cvf all-in-one.$1.${UNIVERSER_VERSION}.tar univer-image.tar.gz observability-image.tar.gz univer.tar.gz install.sh uninstall.sh
63+
tar -cvf all-in-one.$1.${UNIVERSER_VERSION}.tar ./all-in-one.$1.${UNIVERSER_VERSION}
6764

6865
echo "ALLINONE_PATH=$(echo $PWD/all-in-one.$1.${UNIVERSER_VERSION}.tar)" >> $GITHUB_ENV
6966
echo "ALLINONE_TAR=$(echo all-in-one.$1.${UNIVERSER_VERSION}.tar)" >> $GITHUB_ENV

.github/all-in-one/docker-compose/install.sh renamed to .github/all-in-one/docker-compose/load-images.sh

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -62,43 +62,3 @@ docker load -i univer-image.tar.gz
6262

6363
# load observability image
6464
docker load -i observability-image.tar.gz
65-
66-
packagePath="${PWD}"
67-
appPath="${PWD}/univer-server"
68-
69-
# check docker-compose directory
70-
tar_overwrite=""
71-
if [ -f ${appPath}/.env ] && [ -f ${appPath}/run.sh ]; then
72-
read -r -p "docker-compose directory already exists, do you want to overwrite it? [y/N] " response
73-
if [ "$response" == "y" ] || [ "$response" == "Y" ]; then
74-
case "$osType" in
75-
"darwin")
76-
tar_overwrite="-U"
77-
;;
78-
"linux")
79-
tar_overwrite="--overwrite"
80-
;;
81-
esac
82-
else
83-
case "$osType" in
84-
"darwin")
85-
tar_overwrite="-k"
86-
;;
87-
"linux")
88-
tar_overwrite="--skip-old-files"
89-
;;
90-
esac
91-
fi
92-
fi
93-
94-
mkdir -p ${appPath} \
95-
&& cd ${appPath} \
96-
&& cp ${packagePath}/univer.tar.gz . \
97-
&& tar -xzf univer.tar.gz $tar_overwrite \
98-
&& if [ -f ../license-univer ]; then cp ../license-univer ./configs/; fi \
99-
&& $SED -e 's/^\s*prepare_image$/#&/' run.sh \
100-
&& NOT_CHECK_REGION=true bash run.sh \
101-
&& bash run.sh check \
102-
&& cd -
103-
104-
rm univer-image.tar.gz observability-image.tar.gz univer.tar.gz

.github/all-in-one/docker-compose/uninstall.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)