mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-05 20:11:14 +08:00
Feat/develop test (#687)
* docs: add readme docs Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * feat: add script yaml Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * feat: add script yaml Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * feat: add test Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * Update config.yaml * Update config.yaml --------- Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
This commit is contained in:
parent
df71049533
commit
0b9ac4bd87
38
.github/workflows/build-docker-image.yml
vendored
38
.github/workflows/build-docker-image.yml
vendored
@ -29,30 +29,31 @@ jobs:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# docker.io/openim/openim-server:latest
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
|
||||
uses: docker/metadata-action@v4.6.0
|
||||
with:
|
||||
images: openim/openim-server
|
||||
tags: latest
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
||||
|
||||
# registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-server:latest
|
||||
- name: Log in to AliYun Docker Hub
|
||||
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: registry.cn-hangzhou.aliyuncs.com
|
||||
username: ${{ secrets.ALIREGISTRY_USERNAME }}
|
||||
@ -60,19 +61,42 @@ jobs:
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta2
|
||||
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
|
||||
uses: docker/metadata-action@v4.6.0
|
||||
with:
|
||||
images: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-server
|
||||
tags: latest
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.meta2.outputs.tags }}
|
||||
labels: ${{ steps.meta2.outputs.labels }}
|
||||
|
||||
# ghcr.io/openim/openim-server:latest
|
||||
- name: Log in to GitHub Container Registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta3
|
||||
uses: docker/metadata-action@v4.6.0
|
||||
with:
|
||||
images: openim/openim-server
|
||||
tags: latest
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.meta3.outputs.tags }}
|
||||
labels: ${{ steps.meta3.outputs.labels }}
|
||||
|
||||
# name: OpenIM Build Docker Images
|
||||
# on:
|
||||
# push:
|
||||
|
86
.github/workflows/deploy.yml
vendored
86
.github/workflows/deploy.yml
vendored
@ -12,48 +12,52 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
name: deploy for dev
|
||||
name: OpenIM Deploy for dev
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'devops' # Only for the dev branch
|
||||
paths:
|
||||
- '.github/workflows/*'
|
||||
# - '__test__/**' # dev No immediate testing is required
|
||||
- 'src/**'
|
||||
- 'Dockerfile'
|
||||
- 'docker-compose.yml'
|
||||
- 'bin/*'
|
||||
push:
|
||||
branches:
|
||||
- 'devops' # Only for the dev branch
|
||||
paths:
|
||||
- '.github/workflows/*'
|
||||
# - '__test__/**' # dev No immediate testing is required
|
||||
- 'src/**'
|
||||
- 'Dockerfile'
|
||||
- 'docker-compose.yml'
|
||||
- 'bin/*'
|
||||
|
||||
env:
|
||||
SERVER_PRIVATE_KEY: ${{ secrets.SERVER_PRIVATE_KEY }} # server private key
|
||||
SERVER_HOST: ${{ secrets.SERVER_HOST }} # server ip address
|
||||
USER_NAME: ${{ secrets.USER_NAME }} # server username
|
||||
cache-name: note
|
||||
|
||||
jobs:
|
||||
deploy-dev:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: set ssh key # Temporarily set up ssh key
|
||||
run: |
|
||||
mkdir -p ~/.ssh/
|
||||
# secrets.WFP_ID_RSA set in GitHub
|
||||
echo "${{secrets.WFP_ID_RSA}}" > ~/.ssh/id_rsa
|
||||
chmod 600 ~/.ssh/id_rsa
|
||||
ssh-keyscan "182.92.xxx.xxx" >> ~/.ssh/known_hosts
|
||||
- name: deploy # Deployment
|
||||
run: |
|
||||
ssh work@182.92.xxx.xxx "
|
||||
# 【Attention】Log in with the 'work' account, manually create /home/work/imooc-lego directory
|
||||
# Then git clone https://username:password@github.com/imooc-lego/biz-editor-server.git -b dev (private repository, use GitHub username and password)
|
||||
# Remember to delete origin to avoid exposing GitHub password
|
||||
|
||||
cd /home/work/imooc-lego/biz-editor-server;
|
||||
git remote add origin https://openimbot:${{secrets.WFP_PASSWORD}}@github.com/OpenIMSDK/open-im-server.git;
|
||||
git checkout dev;
|
||||
git pull origin dev; # Download the latest code again
|
||||
git remote remove origin; # Remove origin to avoid exposing GitHub password
|
||||
# Start docker
|
||||
docker-compose build editor-server; # Same as the service name in docker-compose.yml
|
||||
docker-compose up -d;
|
||||
"
|
||||
- name: delete ssh key # Delete ssh key
|
||||
run: rm -rf ~/.ssh/id_rsa
|
||||
deploy-dev:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: set ssh key # Temporarily set up ssh key
|
||||
run: |
|
||||
mkdir -p ~/.ssh/
|
||||
# secrets.WFP_ID_RSA set in GitHub
|
||||
echo "${{secrets.WFP_ID_RSA}}" > ~/.ssh/id_rsa
|
||||
chmod 600 ~/.ssh/id_rsa
|
||||
ssh-keyscan "182.92.xxx.xxx" >> ~/.ssh/known_hosts
|
||||
- name: deploy # Deployment
|
||||
run: |
|
||||
ssh work@182.92.xxx.xxx "
|
||||
# 【Attention】Log in with the 'work' account, manually create /home/work/imooc-lego directory
|
||||
# Then git clone https://username:password@github.com/imooc-lego/biz-editor-server.git -b dev (private repository, use GitHub username and password)
|
||||
# Remember to delete origin to avoid exposing GitHub password
|
||||
cd /home/work/imooc-lego/biz-editor-server;
|
||||
git remote add origin https://openimbot:${{secrets.WFP_PASSWORD}}@github.com/OpenIMSDK/open-im-server.git;
|
||||
git checkout dev;
|
||||
git pull origin dev; # Download the latest code again
|
||||
git remote remove origin; # Remove origin to avoid exposing GitHub password
|
||||
# Start docker
|
||||
docker-compose build editor-server; # Same as the service name in docker-compose.yml
|
||||
docker-compose up -d;
|
||||
"
|
||||
- name: delete ssh key # Delete ssh key
|
||||
run: rm -rf ~/.ssh/id_rsa
|
118
.goreleaser.yaml
118
.goreleaser.yaml
@ -335,66 +335,66 @@ changelog:
|
||||
- title: Other work
|
||||
order: 9999
|
||||
|
||||
dockers:
|
||||
- image_templates:
|
||||
- "openimsdk/open-im-server:{{ .Tag }}-amd64"
|
||||
- "ghcr.io/goreleaser/goreleaser:{{ .Tag }}-amd64"
|
||||
dockerfile: Dockerfile
|
||||
use: buildx
|
||||
build_flag_templates:
|
||||
- "--pull"
|
||||
- "--label=io.artifacthub.package.readme-url=https://raw.githubusercontent.com/OpenIMSDK/Open-IM-Server/main/README.md"
|
||||
- "--label=io.artifacthub.package.logo-url=hhttps://github.com/OpenIMSDK/Open-IM-Server/blob/main/assets/logo/openim-logo-green.png"
|
||||
- '--label=io.artifacthub.package.maintainers=[{"name":"Xinwei Xiong","email":"3293172751nss@gmail.com"}]'
|
||||
- "--label=io.artifacthub.package.license=Apace-2.0"
|
||||
- "--label=org.opencontainers.image.description=OpenIM Open source top instant messaging system"
|
||||
- "--label=org.opencontainers.image.created={{.Date}}"
|
||||
- "--label=org.opencontainers.image.name={{.ProjectName}}"
|
||||
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
||||
- "--label=org.opencontainers.image.version={{.Version}}"
|
||||
- "--label=org.opencontainers.image.source={{.GitURL}}"
|
||||
- "--platform=linux/amd64"
|
||||
extra_files:
|
||||
- scripts/entrypoint.sh
|
||||
- image_templates:
|
||||
- "goreleaser/goreleaser:{{ .Tag }}-arm64"
|
||||
- "ghcr.io/goreleaser/goreleaser:{{ .Tag }}-arm64"
|
||||
dockerfile: Dockerfile
|
||||
use: buildx
|
||||
build_flag_templates:
|
||||
- "--pull"
|
||||
- "--label=io.artifacthub.package.readme-url=https://raw.githubusercontent.com/OpenIMSDK/Open-IM-Server/main/README.md"
|
||||
- "--label=io.artifacthub.package.logo-url=hhttps://github.com/OpenIMSDK/Open-IM-Server/blob/main/assets/logo/openim-logo-green.png"
|
||||
- '--label=io.artifacthub.package.maintainers=[{"name":"Xinwei Xiong","email":"3293172751nss@gmail.com"}]'
|
||||
- "--label=io.artifacthub.package.license=Apace-2.0"
|
||||
- "--label=org.opencontainers.image.description=OpenIM Open source top instant messaging system"
|
||||
- "--label=org.opencontainers.image.created={{.Date}}"
|
||||
- "--label=org.opencontainers.image.name={{.ProjectName}}"
|
||||
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
||||
- "--label=org.opencontainers.image.version={{.Version}}"
|
||||
- "--label=org.opencontainers.image.source={{.GitURL}}"
|
||||
- "--platform=linux/arm64"
|
||||
goarch: arm64
|
||||
extra_files:
|
||||
- scripts/entrypoint.sh
|
||||
# dockers:
|
||||
# - image_templates:
|
||||
# - "openimsdk/open-im-server:{{ .Tag }}-amd64"
|
||||
# - "ghcr.io/goreleaser/goreleaser:{{ .Tag }}-amd64"
|
||||
# dockerfile: Dockerfile
|
||||
# use: buildx
|
||||
# build_flag_templates:
|
||||
# - "--pull"
|
||||
# - "--label=io.artifacthub.package.readme-url=https://raw.githubusercontent.com/OpenIMSDK/Open-IM-Server/main/README.md"
|
||||
# - "--label=io.artifacthub.package.logo-url=hhttps://github.com/OpenIMSDK/Open-IM-Server/blob/main/assets/logo/openim-logo-green.png"
|
||||
# - '--label=io.artifacthub.package.maintainers=[{"name":"Xinwei Xiong","email":"3293172751nss@gmail.com"}]'
|
||||
# - "--label=io.artifacthub.package.license=Apace-2.0"
|
||||
# - "--label=org.opencontainers.image.description=OpenIM Open source top instant messaging system"
|
||||
# - "--label=org.opencontainers.image.created={{.Date}}"
|
||||
# - "--label=org.opencontainers.image.name={{.ProjectName}}"
|
||||
# - "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
||||
# - "--label=org.opencontainers.image.version={{.Version}}"
|
||||
# - "--label=org.opencontainers.image.source={{.GitURL}}"
|
||||
# - "--platform=linux/amd64"
|
||||
# extra_files:
|
||||
# - scripts/entrypoint.sh
|
||||
# - image_templates:
|
||||
# - "goreleaser/goreleaser:{{ .Tag }}-arm64"
|
||||
# - "ghcr.io/goreleaser/goreleaser:{{ .Tag }}-arm64"
|
||||
# dockerfile: Dockerfile
|
||||
# use: buildx
|
||||
# build_flag_templates:
|
||||
# - "--pull"
|
||||
# - "--label=io.artifacthub.package.readme-url=https://raw.githubusercontent.com/OpenIMSDK/Open-IM-Server/main/README.md"
|
||||
# - "--label=io.artifacthub.package.logo-url=hhttps://github.com/OpenIMSDK/Open-IM-Server/blob/main/assets/logo/openim-logo-green.png"
|
||||
# - '--label=io.artifacthub.package.maintainers=[{"name":"Xinwei Xiong","email":"3293172751nss@gmail.com"}]'
|
||||
# - "--label=io.artifacthub.package.license=Apace-2.0"
|
||||
# - "--label=org.opencontainers.image.description=OpenIM Open source top instant messaging system"
|
||||
# - "--label=org.opencontainers.image.created={{.Date}}"
|
||||
# - "--label=org.opencontainers.image.name={{.ProjectName}}"
|
||||
# - "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
||||
# - "--label=org.opencontainers.image.version={{.Version}}"
|
||||
# - "--label=org.opencontainers.image.source={{.GitURL}}"
|
||||
# - "--platform=linux/arm64"
|
||||
# goarch: arm64
|
||||
# extra_files:
|
||||
# - scripts/entrypoint.sh
|
||||
|
||||
docker_manifests:
|
||||
- name_template: "goreleaser/goreleaser:{{ .Tag }}"
|
||||
image_templates:
|
||||
- "goreleaser/goreleaser:{{ .Tag }}-amd64"
|
||||
- "goreleaser/goreleaser:{{ .Tag }}-arm64"
|
||||
- name_template: "ghcr.io/goreleaser/goreleaser:{{ .Tag }}"
|
||||
image_templates:
|
||||
- "ghcr.io/goreleaser/goreleaser:{{ .Tag }}-amd64"
|
||||
- "ghcr.io/goreleaser/goreleaser:{{ .Tag }}-arm64"
|
||||
- name_template: "goreleaser/goreleaser:latest"
|
||||
image_templates:
|
||||
- "goreleaser/goreleaser:{{ .Tag }}-amd64"
|
||||
- "goreleaser/goreleaser:{{ .Tag }}-arm64"
|
||||
- name_template: "ghcr.io/goreleaser/goreleaser:latest"
|
||||
image_templates:
|
||||
- "ghcr.io/goreleaser/goreleaser:{{ .Tag }}-amd64"
|
||||
- "ghcr.io/goreleaser/goreleaser:{{ .Tag }}-arm64"
|
||||
# docker_manifests:
|
||||
# - name_template: "goreleaser/goreleaser:{{ .Tag }}"
|
||||
# image_templates:
|
||||
# - "goreleaser/goreleaser:{{ .Tag }}-amd64"
|
||||
# - "goreleaser/goreleaser:{{ .Tag }}-arm64"
|
||||
# - name_template: "ghcr.io/goreleaser/goreleaser:{{ .Tag }}"
|
||||
# image_templates:
|
||||
# - "ghcr.io/goreleaser/goreleaser:{{ .Tag }}-amd64"
|
||||
# - "ghcr.io/goreleaser/goreleaser:{{ .Tag }}-arm64"
|
||||
# - name_template: "goreleaser/goreleaser:latest"
|
||||
# image_templates:
|
||||
# - "goreleaser/goreleaser:{{ .Tag }}-amd64"
|
||||
# - "goreleaser/goreleaser:{{ .Tag }}-arm64"
|
||||
# - name_template: "ghcr.io/goreleaser/goreleaser:latest"
|
||||
# image_templates:
|
||||
# - "ghcr.io/goreleaser/goreleaser:{{ .Tag }}-amd64"
|
||||
# - "ghcr.io/goreleaser/goreleaser:{{ .Tag }}-arm64"
|
||||
|
||||
nfpms:
|
||||
- id: packages
|
||||
|
@ -126,10 +126,10 @@ api:
|
||||
# Configuration for Aliyun OSS
|
||||
object:
|
||||
enable: "minio"
|
||||
apiURL: "http://127.0.0.1:10002/object/"
|
||||
apiURL: http://127.0.0.1:10002/object/
|
||||
minio:
|
||||
bucket: "openim"
|
||||
endpoint: http://127.0.0.1:10005
|
||||
endpoint: http://127.0.0.1:10005
|
||||
accessKeyID: root
|
||||
secretAccessKey: openIM123
|
||||
sessionToken: ""
|
||||
@ -371,4 +371,4 @@ prometheus:
|
||||
conversationPrometheusPort: [ 20230 ]
|
||||
rtcPrometheusPort: [ 21300 ]
|
||||
thirdPrometheusPort: [ 21301 ]
|
||||
messageTransferPrometheusPort: [ 21400, 21401, 21402, 21403 ]
|
||||
messageTransferPrometheusPort: [ 21400, 21401, 21402, 21403 ]
|
||||
|
Loading…
x
Reference in New Issue
Block a user