-
Notifications
You must be signed in to change notification settings - Fork 123
94 lines (81 loc) · 2.91 KB
/
scripts-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# 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.
name: OpenIM Chat Start Execute Scripts
on:
push:
branches:
- main
paths-ignore:
- "docs/**"
- "README.md"
- "README_zh-CN.md"
- "CONTRIBUTING.md"
pull_request:
branches:
- main
paths-ignore:
- "README.md"
- "README_zh-CN.md"
- "CONTRIBUTING.md"
- "docs/**"
jobs:
execute-scripts:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build Chat
run: |
sudo make build
sudo chmod +x ./scripts/build_all_service.sh
sudo ./scripts/build_all_service.sh
shell: bash
- name: deploy all services
run: |
git clone -b release-v3.3 https://github.com/OpenIMSDK/Open-IM-Server.git openim && export openim=$(pwd)/openim && cd $openim
curl -o docker-compose.yaml https://gist.githubusercontent.com/cubxxw/b1d5cbd2edfa23fee911118aa3e8249e/raw/openim-chat.sh
sudo docker compose up -d
sudo sleep 30
sudo chmod +x ./scripts/stop_all.sh
sudo ./scripts/stop_all.sh
sudo cat logs/openIM.log 2>/dev/null
sudo chmod +x ./scripts/build_all_service.sh
sudo ./scripts/build_all_service.sh
sudo cat logs/openIM.log 2>/dev/null
sudo chmod +x ./scripts/start_all.sh
sudo ./scripts/start_all.sh
sudo cat logs/openIM.log 2>/dev/null
sudo chmod +x ./scripts/check_all.sh
sudo ./scripts/check_all.sh
sudo cat logs/openIM.log 2>/dev/null
echo "pwd = $(pwd)"
cd ..
ls -al && pwd
shell: bash
continue-on-error: true
- name: start all services
run: |
sudo ./scripts/start_all.sh
shell: bash
- name: Check all services
run: |
sudo sleep 15; ports=(10008 10009 30200 30300); for port in "${ports[@]}"; do if ! lsof -i :$port > /dev/null; then echo "The service is not started on port $port."; exit 1; else echo "The service is started normally on port $port."; fi; done; echo "All port services have been started normally."
shell: bash
- name: Print openIM.log
run: |
ls -al && echo "pwd = $(pwd)"
sudo cat ./logs/* 2>/dev/null
sudo cat ./logs/* 2>/dev/null >> "$GITHUB_OUTPUT"
shell: bash
continue-on-error: true