Skip to content

Commit 1cd2ce9

Browse files
authored
Merge pull request #40 from averak/release/v0.1.0
Release/v0.1.0
2 parents 1e14d05 + f241be5 commit 1cd2ce9

File tree

76 files changed

+4606
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+4606
-0
lines changed

.editorconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
insert_final_newline = true
7+
trim_trailing_whitespace = true
8+
max_line_length = 140
9+
10+
[*.{kt,kts}]
11+
ktlint_code_style = intellij_idea
12+
ktlint_standard_no-wildcard-imports = disabled
13+
ktlint_standard_package-name = disabled
14+
ktlint_standard_max-line-length = disabled
15+
16+
[*.md]
17+
max_line_length = off

.github/workflows/ci.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- develop
8+
pull_request:
9+
branches:
10+
- master
11+
- develop
12+
13+
jobs:
14+
test:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
with:
20+
fetch-depth: 0
21+
- uses: actions/setup-java@v3
22+
with:
23+
distribution: corretto
24+
java-version: 17
25+
cache: gradle
26+
- uses: google-github-actions/setup-gcloud@v1
27+
28+
- name: cache sonar packages
29+
uses: actions/cache@v3
30+
with:
31+
path: ~/.sonar/cache
32+
key: ${{ runner.os }}-sonar
33+
restore-keys: ${{ runner.os }}-sonar
34+
35+
- name: launch docker
36+
run: |
37+
docker-compose up -d
38+
39+
- name: backend test
40+
run: |
41+
./gradlew test jacocoTestReport
42+
43+
- name: backend analyze
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
47+
run: |
48+
./gradlew sonar
49+
50+
lint:
51+
runs-on: ubuntu-latest
52+
53+
steps:
54+
- uses: actions/checkout@v3
55+
- uses: actions/setup-java@v3
56+
with:
57+
distribution: corretto
58+
java-version: 17
59+
cache: gradle
60+
61+
- name: backend lint
62+
run: |
63+
./gradlew spotlessCheck
64+
65+
build:
66+
runs-on: ubuntu-latest
67+
68+
steps:
69+
- uses: actions/checkout@v3
70+
71+
- name: build docker image
72+
uses: docker/build-push-action@v3
73+
with:
74+
context: .
75+
push: false

.gitignore

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Gradle
2+
.gradle/
3+
build/
4+
5+
# Eclipse
6+
.project
7+
.classpath
8+
.settings/
9+
bin/
10+
11+
# IntelliJ
12+
.idea
13+
*.ipr
14+
*.iml
15+
*.iws
16+
17+
# NetBeans
18+
nb-configuration.xml
19+
20+
# Visual Studio Code
21+
.vscode
22+
.factorypath
23+
24+
# OSX
25+
.DS_Store
26+
27+
# Vim
28+
*.swp
29+
*.swo
30+
31+
# patch
32+
*.orig
33+
*.rej

Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM public.ecr.aws/docker/library/amazoncorretto:17 as build-stage
2+
3+
WORKDIR /app
4+
COPY . /app/
5+
6+
RUN yum install -y git
7+
RUN ./gradlew build -x test
8+
9+
FROM public.ecr.aws/docker/library/amazoncorretto:17
10+
11+
COPY --from=build-stage /app/build/libs/*.jar app.jar
12+
ENTRYPOINT ["java","-jar","app.jar"]

Makefile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
.PHONY: build
2+
build:
3+
./gradlew build -x test
4+
5+
.PHONY: test
6+
test:
7+
./gradlew test jacocoTestReport
8+
9+
.PHONY: lint
10+
lint:
11+
./gradlew spotlessCheck
12+
13+
.PHONY: format
14+
format:
15+
./gradlew spotlessApply
16+
17+
.PHONY: codegen
18+
codegen:
19+
./gradlew mbGenerate
20+
./gradlew spotlessApply
21+
22+
.PHONY: db-migrate
23+
db-migrate:
24+
./gradlew flywayMigrate
25+
26+
.PHONY: db-clean
27+
db-clean:
28+
./gradlew flywayClean
29+
30+
.PHONY: check_dependencies
31+
check_dependencies:
32+
./gradlew dependencyUpdates -Drevision=release
33+
34+
.PHONY: update_dependencies
35+
update_dependencies:
36+
./gradlew versionCatalogUpdate

README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# gsync
2+
3+
![CI](https://github.com/averak/gsync/workflows/CI/badge.svg)
4+
5+
This is a multi-tenancy game server for MO games.
6+
7+
This component provides only reusable features that can be used across various games, and individual logic cannot be embedded.
8+
9+
## Features
10+
11+
* Player authentication / authorization
12+
* Friend
13+
* Match making
14+
* Realtime messaging
15+
* And more
16+
17+
## Develop
18+
19+
This document only contains minimal setup instructions to launch the application.
20+
21+
For more information, see [Makefile](./Makefile).
22+
23+
### Environments
24+
25+
* Java OpenJDK 17
26+
* Kotlin 1.9
27+
* Spring Boot 3.2
28+
* Cloud Spanner
29+
* Redis
30+
31+
### Running the application in dev mode
32+
33+
You can run your application in dev mode.
34+
35+
```shell
36+
docker compose up -d
37+
./gradlew bootRun
38+
```
39+
40+
### Packaging and running the application
41+
42+
The application can be packaged.
43+
44+
```shell
45+
make build
46+
```
47+
48+
It produces the `gsync.jar` file in the `build/libs/` directory.
49+
50+
The application is now runnable using `java -jar build/libs/gsync.jar`.
51+
52+
### Check Dependency updates
53+
54+
Follow steps [littlerobots/version-catalog-update-plugin](https://github.com/littlerobots/version-catalog-update-plugin?tab=readme-ov-file#interactive-mode) to update outdated dependencies.
55+
56+
```shell
57+
./gradlew versionCatalogUpdate --interactive
58+
59+
# Check the execution plan automatically generated in `gradle/libs.version.updates.toml` and apply if there is no problem.
60+
./gradlew versionCatalogApplyUpdates
61+
```

0 commit comments

Comments
 (0)