Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>pull/825/head
parent
3599d4b7ef
commit
b02d65bf9a
@ -1,70 +0,0 @@
|
||||
# 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 Scripts Execute CI
|
||||
|
||||
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: Download Docker Compose
|
||||
run: |
|
||||
curl -o docker-compose.yaml https://gist.githubusercontent.com/cubxxw/b1d5cbd2edfa23fee911118aa3e8249e/raw/openim-server.sh
|
||||
shell: bash
|
||||
|
||||
- name: Start Docker Compose
|
||||
run: |
|
||||
sudo docker compose up -d
|
||||
sudo sleep 60
|
||||
continue-on-error: true
|
||||
|
||||
- name: Build all services
|
||||
run: |
|
||||
sudo ./scripts/build-all-service.sh
|
||||
|
||||
- name: Start all services
|
||||
run: |
|
||||
sudo ./scripts/start-all.sh
|
||||
|
||||
- name: Check all services
|
||||
run: |
|
||||
sudo ./scripts/check-all.sh
|
||||
|
||||
- name: Print openIM.log
|
||||
run: |
|
||||
sudo cat ./_output/logs/* 2>/dev/null
|
||||
sudo cat ./_output/logs/* 2>/dev/null >> "$GITHUB_OUTPUT"
|
||||
continue-on-error: true
|
@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env bash
|
||||
# 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.
|
||||
|
||||
|
||||
# Common utilities, variables and checks for all build scripts.
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
|
||||
source "${OPENIM_ROOT}/scripts/lib/init.sh"
|
||||
|
||||
trap 'openim::util::onCtrlC' INT
|
||||
|
||||
chmod +x ${OPENIM_ROOT}/scripts/*.sh
|
||||
${OPENIM_ROOT}/scripts/init-config.sh
|
||||
|
||||
openim::util::ensure_docker_daemon_connectivity
|
||||
|
||||
DOCKER_COMPOSE_COMMAND=
|
||||
# Check if docker-compose command is available
|
||||
if command -v docker-compose &> /dev/null
|
||||
then
|
||||
openim::log::info "docker-compose command is available"
|
||||
DOCKER_COMPOSE_COMMAND="docker-compose"
|
||||
else
|
||||
DOCKER_COMPOSE_COMMAND="docker compose"
|
||||
fi
|
||||
|
||||
pushd "${OPENIM_ROOT}" >/dev/null
|
||||
${DOCKER_COMPOSE_COMMAND} up -d
|
||||
sleep 60
|
||||
${DOCKER_COMPOSE_COMMAND} ps
|
||||
${DOCKER_COMPOSE_COMMAND} logs
|
||||
popd >/dev/null
|
Loading…
Reference in new issue