diff --git a/.github/sync.yml b/.github/sync.yml new file mode 100644 index 000000000..7b718143b --- /dev/null +++ b/.github/sync.yml @@ -0,0 +1,26 @@ +# Copyright © 2023 OpenIM. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# https://github.com/BetaHuhn/repo-file-sync-action +# Synchronization for the.github repository +openim-sigs/openim-docker: + - source: ./config + dest: ./openim-chat/config + replace: true + - source: ./docs + dest: ./openim-chat/docs + replace: true + - source: ./scripts + dest: ./openim-chat/scripts + replace: true diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml new file mode 100644 index 000000000..4d82375da --- /dev/null +++ b/.github/workflows/sync.yml @@ -0,0 +1,40 @@ +# Copyright © 2023 KubeCub open source community. All rights reserved. +# Licensed under the MIT License (the "License"); +# you may not use this file except in compliance with the License. + +# https://github.com/BetaHuhn/repo-file-sync-action +name: Synchronize kubecub public code to other repositories +on: + push: + branches: + - main + + workflow_dispatch: + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Run GitHub File Sync + uses: BetaHuhn/repo-file-sync-action@latest + with: + GH_INSTALLATION_TOKEN: "${{ secrets.BOT_GITHUB_TOKEN }}" + CONFIG_PATH: .github/sync.yml + ORIGINAL_MESSAGE: true + SKIP_PR: true + COMMIT_EACH_FILE: false + COMMIT_BODY: "🤖 kubbot to synchronize the warehouse" + GIT_EMAIL: "3293172751ysy@gmail.com" + GIT_USERNAME: "kubbot" + PR_BODY: 👌 kubecub provides automated community services + REVIEWERS: | + kubbot + cubxxw + PR_LABELS: | + file-sync + automerge + ASSIGNEES: | + kubbot \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index fa95fc0cd..6943257bb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,14 +36,10 @@ RUN make clean RUN make build # Build the runtime stage -FROM ghcr.io/openim-sigs/openim-bash-image:latest +FROM ghcr.io/openim-sigs/openim-ubuntu-image:latest WORKDIR ${CHAT_WORKDIR} COPY --from=builder $OPENIM_CHAT_BINDIR/platforms /openim/openim-chat/_output/bin/platforms -COPY --from=builder ${OPENIM_CHAT_CMDDIR} /openim/openim-chat/scripts -COPY --from=builder ${OPENIM_CHAT_CONFIG_NAME} /openim/openim-chat/config/config.yaml -VOLUME ["/openim/openim-chat/_output","/openim/openim-chat/logs","/openim/openim-chat/config","/openim/openim-chat/scripts"] - -CMD ["bash","-c", "${OPENIM_CHAT_CMDDIR}/docker_start_all.sh"] +CMD ["/openim/openim-chat/scripts/docker_start_all.sh"] \ No newline at end of file diff --git a/scripts/docker_start_all.sh b/scripts/docker_start_all.sh index 21b2c6f87..5225b2dcc 100755 --- a/scripts/docker_start_all.sh +++ b/scripts/docker_start_all.sh @@ -80,7 +80,7 @@ for ((i = 0; i < ${#service_filenames[*]}; i++)); do service_ports=() for line in "${portList[@]}"; do if [[ $line == *"${service_port_names[$i]}"* ]]; then - port=$(echo "$line" | awk -F ':' '{print $NF}') + port=$(echo "$line" | awk -F '[ ]+' '{print $4} ') service_ports+=("$port") fi done @@ -93,7 +93,7 @@ for ((i = 0; i < ${#service_filenames[*]}; i++)); do cmd="$bin_dir/$service_name -port $port --config_folder_path $config_path" fi echo "$cmd" - nohup "$cmd" >> "${logs_dir}/openIM.log" 2>&1 & + nohup $cmd >> "${logs_dir}/openIM.log" 2>&1 & sleep 1 done done