-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add logic to deploy images (#497)
* feat: add logic to deploy images Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]> * feat: add logic to deploy images Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]> * fix: add ubuntu Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]> * fix: sync quest Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]> * feat: add copyright information Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]> * feat: add more cicd design Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]> * fix: fix sync Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]> * feat: test file Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]> * feat: test file Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]> * feat: build multiarch Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]> * feat: build multiarch Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]> * feat: add start scripts Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]> --------- Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]>
- Loading branch information
Showing
30 changed files
with
323 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,52 @@ | ||
# Copyright © 2023 OpenIM open source community. 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 CI | ||
|
||
on: | ||
# main branch | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- main | ||
paths-ignore: | ||
- "docs/**" | ||
- "README.md" | ||
- "README_zh-CN.md" | ||
- "CONTRIBUTING.md" | ||
pull_request: | ||
branches: | ||
- main | ||
- main | ||
paths-ignore: | ||
- "README.md" | ||
- "README_zh-CN.md" | ||
- "CONTRIBUTING.md" | ||
- "docs/**" | ||
|
||
jobs: | ||
env: | ||
GO_VERSION: "1.19" | ||
GOLANGCI_VERSION: "v1.50.1" | ||
|
||
openimci: | ||
jobs: | ||
openim: | ||
name: Test with go ${{ matrix.go_version }} on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
environment: | ||
name: openimci | ||
name: openim | ||
|
||
strategy: | ||
matrix: | ||
go_version: ['1.18', '1.19', '1.20'] | ||
os: [ubuntu-latest, macOS-latest] | ||
go_version: ["1.18","1.19","1.20"] | ||
os: [ubuntu-latest] | ||
|
||
steps: | ||
- name: Set up Go ${{ matrix.go_version }} | ||
|
@@ -32,41 +58,95 @@ jobs: | |
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
|
||
- name: Run go modules Tidy | ||
- name: Run go modules tidy | ||
run: | | ||
make tidy | ||
- name: Generate all necessary files, such as error code files | ||
- name: Run go format | ||
run: | | ||
make gen | ||
make format | ||
echo "Run go format successfully" | ||
- name: Check syntax and styling of go sources | ||
run: | | ||
make lint | ||
# - name: Generate all necessary files, such as error code files | ||
# run: | | ||
# make generate | ||
|
||
- name: Run unit test and get test coverage | ||
run: | | ||
make cover | ||
# - name: Check syntax and styling of go sources | ||
# run: | | ||
# set -e | ||
# make lint | ||
|
||
# - name: Run unit test and get test coverage | ||
# run: | | ||
# make cover | ||
|
||
- name: Build source code for host platform | ||
run: | | ||
make build | ||
make multiarch | ||
echo "Build source code for host platform successfully" | ||
- name: Collect Test Coverage File | ||
uses: actions/[email protected] | ||
with: | ||
name: main-output | ||
path: _output/coverage.out | ||
# - name: Collect Test Coverage File | ||
# uses: actions/[email protected] | ||
# with: | ||
# name: main-output | ||
# path: _output/tmp/coverage.out | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
# - name: Set up Docker Buildx | ||
# uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ env.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
# lint: | ||
# runs-on: ubuntu-20.04 | ||
# steps: | ||
# - name: Checkout | ||
# uses: actions/checkout@v3 | ||
# with: | ||
# fetch-depth: 0 | ||
|
||
# - name: Set up Go | ||
# uses: actions/setup-go@v3 | ||
# with: | ||
# go-version: ${{ env.GO_VERSION }} | ||
|
||
# - name: golangci-lint | ||
# uses: golangci/golangci-lint-action@v3 | ||
# with: | ||
# version: ${{ env.GOLANGCI_VERSION }} | ||
|
||
- name: Build docker images for host arch and push images to registry | ||
run: | | ||
make push | ||
# docker-image-tests: | ||
# runs-on: ubuntu-20.04 | ||
# steps: | ||
# - name: Checkout | ||
# uses: actions/checkout@v3 | ||
# with: | ||
# fetch-depth: 0 | ||
|
||
# - name: Set up Go | ||
# uses: actions/setup-go@v3 | ||
# with: | ||
# go-version: ${{ env.GO_VERSION }} | ||
|
||
# - name: Run tests | ||
# run: make build | ||
|
||
# - name: Test docker image | ||
# run: | | ||
# docker build -t openim:ci-build . | ||
|
||
# goreleaser-test: | ||
# runs-on: ubuntu-20.04 | ||
# steps: | ||
# - name: Checkout | ||
# uses: actions/checkout@v3 | ||
# with: | ||
# fetch-depth: 0 | ||
|
||
# - name: Set up Go | ||
# uses: actions/setup-go@v3 | ||
# with: | ||
# go-version: ${{ env.GO_VERSION }} | ||
|
||
# - name: Run GoReleaser | ||
# uses: goreleaser/goreleaser-action@v4 | ||
# with: | ||
# version: latest | ||
# args: release --clean --skip-publish --snapshot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: 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@v2 | ||
|
||
- name: Start Docker Compose | ||
run: docker-compose up -d | ||
|
||
- name: Stop all services | ||
run: | | ||
chmod +x ./scripts/stop_all.sh | ||
./scripts/stop_all.sh | ||
- name: Build all services | ||
run: | | ||
chmod +x ./scripts/build_all_service.sh | ||
./scripts/build_all_service.sh | ||
- name: Start all services | ||
run: | | ||
chmod +x ./scripts/start_all.sh | ||
./scripts/start_all.sh | ||
- name: Check all services | ||
run: | | ||
chmod +x ./scripts/check_all.sh | ||
./scripts/check_all.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# `/assets` | ||
|
||
The `/assets` directory in the OpenIM repository contains various assets such as images, logos, and animated GIFs. These assets serve different purposes and contribute to the functionality and aesthetics of the OpenIM project. | ||
|
||
## Directory Structure: | ||
|
||
```bash | ||
assets/ | ||
├── README.md # Documentation for the assets directory | ||
├── images # Directory holding images related to OpenIM | ||
│ ├── architecture.png # Image depicting the architecture of OpenIM | ||
│ └── mvc.png # Image illustrating the Model-View-Controller (MVC) pattern | ||
├── intive-slack.png # Image displaying the Intive Slack logo | ||
├── logo # Directory containing various logo variations for OpenIM | ||
│ ├── openim-logo-black.png # OpenIM logo with a black background | ||
│ ├── openim-logo-blue.png # OpenIM logo with a blue background | ||
│ ├── openim-logo-green.png # OpenIM logo with a green background | ||
│ ├── openim-logo-purple.png # OpenIM logo with a purple background | ||
│ ├── openim-logo-white.png # OpenIM logo with a white background | ||
│ ├── openim-logo-yellow.png # OpenIM logo with a yellow background | ||
│ └── openim-logo.png # OpenIM logo with a transparent background | ||
└── logo-gif # Directory containing animated GIF versions of the OpenIM logo | ||
└── openim-log.gif # Animated OpenIM logo with a transparent background | ||
``` | ||
|
||
## Copyright Notice: | ||
|
||
The OpenIM logo, including its variations and animated versions, displayed in this repository [OpenIM](https://github.com/OpenIMSDK/openim) under the `/assets/logo` and `/assets/logo-gif` directories, are protected by copyright laws. | ||
|
||
The logo design is credited to @Xx(席欣). | ||
|
||
Please respect the intellectual property rights and refrain from unauthorized use and distribution of these assets. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# The OpenIM logo files are licensed under a choice of either Apache-2.0 or CC-BY-4.0 (Creative Commons Attribution 4.0 International). |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# The OpenIM logo files are licensed under a choice of either Apache-2.0 or CC-BY-4.0 (Creative Commons Attribution 4.0 International). |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,39 @@ | ||
#!/usr/bin/env bash | ||
internet_ip=`curl ifconfig.me -s` | ||
|
||
# Get the public internet IP address | ||
internet_ip=$(curl ifconfig.me -s) | ||
echo $internet_ip | ||
|
||
# Load environment variables from .env file | ||
source .env | ||
echo $MINIO_ENDPOINT | ||
if [ $MINIO_ENDPOINT == "http://127.0.0.1:10005" ]; then | ||
sed -i "s/127.0.0.1/${internet_ip}/" .env | ||
|
||
# Replace local IP address with the public IP address in .env file | ||
if [ $MINIO_ENDPOINT == "http://127.0.0.1:10005" ]; then | ||
sed -i "s/127.0.0.1/${internet_ip}/" .env | ||
fi | ||
|
||
cd scripts ; | ||
chmod +x *.sh ; | ||
|
||
# Change directory to scripts folder | ||
cd scripts | ||
chmod +x *.sh | ||
|
||
# Execute necessary scripts | ||
./init_pwd.sh | ||
./env_check.sh; | ||
cd .. ; | ||
./env_check.sh | ||
|
||
# Go back to the previous directory | ||
cd .. | ||
|
||
# Check if docker-compose command is available | ||
if command -v docker-compose &> /dev/null | ||
then | ||
docker-compose up -d ; | ||
docker-compose up -d | ||
else | ||
docker compose up -d ; | ||
docker compose up -d | ||
fi | ||
|
||
# Change directory to scripts folder again | ||
cd scripts | ||
|
||
cd scripts ; | ||
./docker_check_service.sh | ||
# Check docker services | ||
./docker_check_service.sh |
Oops, something went wrong.