From 44bad0146cd3a7a12de8141efa361c6a0730580c Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Wed, 18 May 2022 19:13:00 +0800 Subject: [PATCH] office tag async send --- deploy/dockerfiles/Dockerfile.api | 3 +- .../admin_cms.Dockerfile | 0 .../{dockerfiles => api}/api.Dockerfile | 0 .../{dockerfiles => auth}/auth.Dockerfile | 0 deploy_k8s/build_push_all_images.sh | 51 +++++++++++++++++++ .../{dockerfiles => cache}/cache.Dockerfile | 0 .../cms_api.Dockerfile | 0 .../conversation.Dockerfile | 0 .../{dockerfiles => demo}/demo.Dockerfile | 0 .../{dockerfiles => friend}/friend.Dockerfile | 0 .../{dockerfiles => group}/group.Dockerfile | 0 .../message_cms.Dockerfile | 0 .../{dockerfiles => msg}/msg.Dockerfile | 0 .../msg_gateway.Dockerfile | 0 .../{dockerfiles => office}/office.Dockerfile | 0 .../organization.Dockerfile | 0 .../{dockerfiles => push}/push.Dockerfile | 0 deploy_k8s/script/build_push_all_images.sh | 43 ---------------- deploy_k8s/script/test.sh | 2 - .../sdk_server.Dockerfile | 0 20 files changed, 53 insertions(+), 46 deletions(-) rename deploy_k8s/{dockerfiles => admin_cms}/admin_cms.Dockerfile (100%) rename deploy_k8s/{dockerfiles => api}/api.Dockerfile (100%) rename deploy_k8s/{dockerfiles => auth}/auth.Dockerfile (100%) create mode 100644 deploy_k8s/build_push_all_images.sh rename deploy_k8s/{dockerfiles => cache}/cache.Dockerfile (100%) rename deploy_k8s/{dockerfiles => cms_api}/cms_api.Dockerfile (100%) rename deploy_k8s/{dockerfiles => conversation}/conversation.Dockerfile (100%) rename deploy_k8s/{dockerfiles => demo}/demo.Dockerfile (100%) rename deploy_k8s/{dockerfiles => friend}/friend.Dockerfile (100%) rename deploy_k8s/{dockerfiles => group}/group.Dockerfile (100%) rename deploy_k8s/{dockerfiles => message_cms}/message_cms.Dockerfile (100%) rename deploy_k8s/{dockerfiles => msg}/msg.Dockerfile (100%) rename deploy_k8s/{dockerfiles => msg_gateway}/msg_gateway.Dockerfile (100%) rename deploy_k8s/{dockerfiles => office}/office.Dockerfile (100%) rename deploy_k8s/{dockerfiles => organization}/organization.Dockerfile (100%) rename deploy_k8s/{dockerfiles => push}/push.Dockerfile (100%) delete mode 100644 deploy_k8s/script/build_push_all_images.sh delete mode 100644 deploy_k8s/script/test.sh rename deploy_k8s/{dockerfiles => sdk_server}/sdk_server.Dockerfile (100%) diff --git a/deploy/dockerfiles/Dockerfile.api b/deploy/dockerfiles/Dockerfile.api index 9c70d735d..99582608a 100644 --- a/deploy/dockerfiles/Dockerfile.api +++ b/deploy/dockerfiles/Dockerfile.api @@ -6,6 +6,7 @@ ENV CONFIG_NAME $WORKDIR/config/config.yaml # 将可执行文件复制到目标目录 ADD ./open_im_api $WORKDIR/main +COPY ./start_api.sh $$WORKDIR # 创建用于挂载的几个目录,添加可执行权限 RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ @@ -13,4 +14,4 @@ RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ WORKDIR $WORKDIR -CMD ./main \ No newline at end of file +CMD ./start_api.sh \ No newline at end of file diff --git a/deploy_k8s/dockerfiles/admin_cms.Dockerfile b/deploy_k8s/admin_cms/admin_cms.Dockerfile similarity index 100% rename from deploy_k8s/dockerfiles/admin_cms.Dockerfile rename to deploy_k8s/admin_cms/admin_cms.Dockerfile diff --git a/deploy_k8s/dockerfiles/api.Dockerfile b/deploy_k8s/api/api.Dockerfile similarity index 100% rename from deploy_k8s/dockerfiles/api.Dockerfile rename to deploy_k8s/api/api.Dockerfile diff --git a/deploy_k8s/dockerfiles/auth.Dockerfile b/deploy_k8s/auth/auth.Dockerfile similarity index 100% rename from deploy_k8s/dockerfiles/auth.Dockerfile rename to deploy_k8s/auth/auth.Dockerfile diff --git a/deploy_k8s/build_push_all_images.sh b/deploy_k8s/build_push_all_images.sh new file mode 100644 index 000000000..c043ebb7f --- /dev/null +++ b/deploy_k8s/build_push_all_images.sh @@ -0,0 +1,51 @@ +#/bin/sh +service=( + #api service file + api + cms_api + + #rpc service file + user + friend + group + auth + admin_cms + message_cms + statistics + office + organization + conversation + cache + gateway + transfer + msg + push + sdk_server + open_im_demo +) +# +version=v2.0.10 +cd ../script/; ./build_all_service.sh +cd ../deploy_k8s/ + +for i in ${service[*]} +do + mv ../bin/open_im_${i} ./${i}/ +done + +echo "move success" + +echo "start to build images" + +for i in ${service[*]} +do + echo "start to build images" $i + cd $i + image="openim/${i}:$version" + docker build -t $image . -f ./${i}.Dockerfile + echo "build ${dockerfile} success" + docker push $image + echo "push ${image} success " + cd .. +done + diff --git a/deploy_k8s/dockerfiles/cache.Dockerfile b/deploy_k8s/cache/cache.Dockerfile similarity index 100% rename from deploy_k8s/dockerfiles/cache.Dockerfile rename to deploy_k8s/cache/cache.Dockerfile diff --git a/deploy_k8s/dockerfiles/cms_api.Dockerfile b/deploy_k8s/cms_api/cms_api.Dockerfile similarity index 100% rename from deploy_k8s/dockerfiles/cms_api.Dockerfile rename to deploy_k8s/cms_api/cms_api.Dockerfile diff --git a/deploy_k8s/dockerfiles/conversation.Dockerfile b/deploy_k8s/conversation/conversation.Dockerfile similarity index 100% rename from deploy_k8s/dockerfiles/conversation.Dockerfile rename to deploy_k8s/conversation/conversation.Dockerfile diff --git a/deploy_k8s/dockerfiles/demo.Dockerfile b/deploy_k8s/demo/demo.Dockerfile similarity index 100% rename from deploy_k8s/dockerfiles/demo.Dockerfile rename to deploy_k8s/demo/demo.Dockerfile diff --git a/deploy_k8s/dockerfiles/friend.Dockerfile b/deploy_k8s/friend/friend.Dockerfile similarity index 100% rename from deploy_k8s/dockerfiles/friend.Dockerfile rename to deploy_k8s/friend/friend.Dockerfile diff --git a/deploy_k8s/dockerfiles/group.Dockerfile b/deploy_k8s/group/group.Dockerfile similarity index 100% rename from deploy_k8s/dockerfiles/group.Dockerfile rename to deploy_k8s/group/group.Dockerfile diff --git a/deploy_k8s/dockerfiles/message_cms.Dockerfile b/deploy_k8s/message_cms/message_cms.Dockerfile similarity index 100% rename from deploy_k8s/dockerfiles/message_cms.Dockerfile rename to deploy_k8s/message_cms/message_cms.Dockerfile diff --git a/deploy_k8s/dockerfiles/msg.Dockerfile b/deploy_k8s/msg/msg.Dockerfile similarity index 100% rename from deploy_k8s/dockerfiles/msg.Dockerfile rename to deploy_k8s/msg/msg.Dockerfile diff --git a/deploy_k8s/dockerfiles/msg_gateway.Dockerfile b/deploy_k8s/msg_gateway/msg_gateway.Dockerfile similarity index 100% rename from deploy_k8s/dockerfiles/msg_gateway.Dockerfile rename to deploy_k8s/msg_gateway/msg_gateway.Dockerfile diff --git a/deploy_k8s/dockerfiles/office.Dockerfile b/deploy_k8s/office/office.Dockerfile similarity index 100% rename from deploy_k8s/dockerfiles/office.Dockerfile rename to deploy_k8s/office/office.Dockerfile diff --git a/deploy_k8s/dockerfiles/organization.Dockerfile b/deploy_k8s/organization/organization.Dockerfile similarity index 100% rename from deploy_k8s/dockerfiles/organization.Dockerfile rename to deploy_k8s/organization/organization.Dockerfile diff --git a/deploy_k8s/dockerfiles/push.Dockerfile b/deploy_k8s/push/push.Dockerfile similarity index 100% rename from deploy_k8s/dockerfiles/push.Dockerfile rename to deploy_k8s/push/push.Dockerfile diff --git a/deploy_k8s/script/build_push_all_images.sh b/deploy_k8s/script/build_push_all_images.sh deleted file mode 100644 index 128622b77..000000000 --- a/deploy_k8s/script/build_push_all_images.sh +++ /dev/null @@ -1,43 +0,0 @@ -#/bin/sh -#service_source_root=( -# #api service file -# ../cmd/open_im_api/ -# ../cmd/open_im_cms_api/ -# #rpc service file -# ../cmd/rpc/open_im_user/ -# ../cmd/rpc/open_im_friend/ -# ../cmd/rpc/open_im_group/ -# ../cmd/rpc/open_im_auth/ -# ../cmd/rpc/open_im_admin_cms/ -# ../cmd/rpc/open_im_message_cms/ -# ../cmd/rpc/open_im_statistics/ -# ../cmd/rpc/open_im_office/ -# ../cmd/rpc/open_im_organization/ -# ../cmd/rpc/open_im_conversation/ -# ../cmd/rpc/open_im_cache/ -# ../cmd/open_im_msg_gateway/ -# ../cmd/open_im_msg_transfer/ -# ../cmd/rpc/open_im_msg/ -# ../cmd/open_im_push/ -# ../cmd/Open-IM-SDK-Core/ -# ../cmd/open_im_demo/ -#) -# -version=v2.0.10 -cd ../../script/; ./build_all_service.sh -cd ../deploy_k8s/dockerfiles -dockerfile_list=$(ls ../dockerfiles/) -mv ../../bin/* ./ -echo "start to build images" - -for dockerfile in $dockerfile_list -do - echo "start to build images" $dockerfile - image=`echo $dockerfile |awk -F '.' '{print $1}'` - image="openim"+image+$version - docker build -t $image . -f ../dockerfiles/${dockerfile} - echo "build ${dockerfile} success" - docker push $image - echo "push ${image} success " -done - diff --git a/deploy_k8s/script/test.sh b/deploy_k8s/script/test.sh deleted file mode 100644 index 4551c2a23..000000000 --- a/deploy_k8s/script/test.sh +++ /dev/null @@ -1,2 +0,0 @@ -var2=`echo "hello world"|awk -F ' ' '{print $1}'` -echo $var2 \ No newline at end of file diff --git a/deploy_k8s/dockerfiles/sdk_server.Dockerfile b/deploy_k8s/sdk_server/sdk_server.Dockerfile similarity index 100% rename from deploy_k8s/dockerfiles/sdk_server.Dockerfile rename to deploy_k8s/sdk_server/sdk_server.Dockerfile