Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update build-docker-image.yml #312

Merged
merged 4 commits into from
Dec 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ CHANGELOG/

# Ignore deployment-related files
docker-compose.yaml
deployments/

# Ignore assets
assets/
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/build-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern=v{{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
Expand Down Expand Up @@ -85,6 +86,15 @@ jobs:
uses: docker/[email protected]
with:
images: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-chat
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern=v{{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha

- name: Log in to AliYun Docker Hub
uses: docker/login-action@v2
Expand Down Expand Up @@ -118,6 +128,15 @@ jobs:
uses: docker/[email protected]
with:
images: ghcr.io/openimsdk/openim-chat
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern=v{{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha

- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scripts-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
sleep 30;
- name: start all services
run: |
sudo cp ./config/config.yaml.template ./config/config.yaml
sudo cp ./deployments/templates/config.yaml ./config/config.yaml
sudo make start
shell: bash

Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,6 @@ WORKDIR ${CHAT_WORKDIR}
COPY --from=builder ${OPENIM_CHAT_BINDIR} /openim/openim-chat/_output/bin
COPY --from=builder ${CHAT_WORKDIR}/config /openim/openim-chat/config
COPY --from=builder ${CHAT_WORKDIR}/scripts /openim/openim-chat/scripts
COPY --from=builder ${SERVER_WORKDIR}/deployments /openim/openim-server/deployments

CMD ["/openim/openim-chat/scripts/docker_start_all.sh"]
16 changes: 12 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,6 @@ else
IMAGE_PLAT := $(PLATFORM)
endif

# Copy githook scripts when execute makefile
# TODO! GIT_FILE_SIZE_LIMIT=42000000 git commit -m "This commit is allowed file sizes up to 42MB"
COPY_GITHOOK:=$(shell cp -f scripts/githooks/* .git/hooks/; chmod +x .git/hooks/*)

# Linux command settings
FIND := find . ! -path './image/*' ! -path './vendor/*' ! -path './bin/*'
XARGS := xargs -r
Expand Down Expand Up @@ -193,6 +189,18 @@ endif
.PHONY: all
all: copyright-verify tidy build start check #lint cover

## init: Init openim-chat config
.PHONY: init
init:
@echo "===========> Init openim-chat config"
@$(ROOT_DIR)/scripts/init-config.sh

## init-githooks: Initialize git hooks ✨
.PHONY: init-githooks
init-githooks:
@echo "===========> Initializing git hooks"
@${ROOT_DIR}/scripts/init-githooks.sh

## build: Build binaries by default.
.PHONY: build
build: go.build.verify $(addprefix go.build., $(addprefix $(PLATFORM)., $(BINS)))
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ sudo docker compose up -d
**Setting configuration items:**

```bash
cp ./config/config.yaml.template ./config/config.yaml
make init
```

> Then modify the configuration file `config/config.yaml` according to your needs
Expand Down
14 changes: 14 additions & 0 deletions build/images/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# 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.

FROM BASE_IMAGE

WORKDIR ${SERVER_WORKDIR}
Expand Down
14 changes: 14 additions & 0 deletions cmd/rpc/chat-rpc/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// 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.

package main

import (
Expand Down
17 changes: 17 additions & 0 deletions config/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Configuration file

The configuration file is automatically generated through make init or scripts/init-config.sh.

Add the configuration file to the policy that adds version management


```bash
make init
```


## Fix config/config.yaml

```bash
vim config/config.yaml
```
15 changes: 0 additions & 15 deletions deployment/helm-charts/charts/admin-rpc/templates/service.yaml

This file was deleted.

This file was deleted.

15 changes: 0 additions & 15 deletions deployment/helm-charts/charts/chat-api/templates/service.yaml

This file was deleted.

This file was deleted.

15 changes: 0 additions & 15 deletions deployment/helm-charts/charts/chat-rpc/templates/service.yaml

This file was deleted.

This file was deleted.

9 changes: 0 additions & 9 deletions deployment/helm-charts/templates/app-cm.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions deployment/helm-charts/templates/service.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions deployment/helm-charts/templates/serviceaccount.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# 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.

apiVersion: v2
name: admin-api
description: A Helm chart for Kubernetes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# 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.

apiVersion: v2
name: admin-rpc
description: A Helm chart for Kubernetes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# 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.

apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# 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.

{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# 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.

{{- if .Values.ingress.enabled -}}
{{- $fullName := include "admin-rpc.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
Expand Down
Loading
Loading