Skip to content

Commit

Permalink
feat: add more sync scripts
Browse files Browse the repository at this point in the history
Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]>
  • Loading branch information
cubxxw committed Aug 19, 2023
1 parent a06d8e1 commit 6b670fd
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 8 deletions.
26 changes: 26 additions & 0 deletions .github/sync.yml
Original file line number Diff line number Diff line change
@@ -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
40 changes: 40 additions & 0 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
@@ -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: "[email protected]"
GIT_USERNAME: "kubbot"
PR_BODY: 👌 kubecub provides automated community services
REVIEWERS: |
kubbot
cubxxw
PR_LABELS: |
file-sync
automerge
ASSIGNEES: |
kubbot
8 changes: 2 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
4 changes: 2 additions & 2 deletions scripts/docker_start_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 6b670fd

Please sign in to comment.