[infra] support contribute with Gitpod (#2419)

This commit is contained in:
Kerwin Bryant 2024-07-30 21:31:09 +08:00 committed by GitHub
parent 2824542037
commit 15768d8077
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 92 additions and 2 deletions

View File

@ -0,0 +1,38 @@
{
"name": "Hertzbeat DevContainer",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"ghcr.io/devcontainers/features/java:1": {
"version": "17",
"installMaven": "true",
"installGradle": "false"
},
"ghcr.io/devcontainers/features/node:1": {
"version": "20"
},
"ghcr.io/devcontainers/features/git-lfs:1.1.0": {}
},
"customizations": {
"vscode": {
"settings": {},
// same extensions as Gitpod, should match /.gitpod.yml
"extensions": [
"vscjava.vscode-java-pack",
"editorconfig.editorconfig",
"dbaeumer.vscode-eslint",
"stylelint.vscode-stylelint",
"DavidAnson.vscode-markdownlint",
"ms-azuretools.vscode-docker",
"cweijan.vscode-database-client2",
"GitHub.vscode-pull-request-github"
]
}
},
"portsAttributes": {
"4200": {
"label": "Hertzbeat Web",
"onAutoForward": "notify"
}
},
"postCreateCommand": "java -version"
}

7
.gitpod.Dockerfile vendored Normal file
View File

@ -0,0 +1,7 @@
FROM gitpod/workspace-full
USER gitpod
RUN bash -c ". /home/gitpod/.sdkman/bin/sdkman-init.sh && \
sdk install java 17.0.12-amzn && \
sdk default java 17.0.12-amzn"

41
.gitpod.yml Normal file
View File

@ -0,0 +1,41 @@
image:
file: .gitpod.Dockerfile
tasks:
- name: Setup
init: |
cp -r contrib/ide/vscode .vscode
mvn clean install
cd web-app
yarn install
command: |
gp sync-done setup
exit 0
- name: Run backend
command: |
gp sync-await setup
cd manager
mvn spring-boot:run
- name: Run frontend
command: |
gp sync-await setup
cd web-app
yarn start
openMode: split-right
vscode:
extensions:
- vscjava.vscode-java-pack
- editorconfig.editorconfig
- dbaeumer.vscode-eslint
- stylelint.vscode-stylelint
- DavidAnson.vscode-markdownlint
- ms-azuretools.vscode-docker
- cweijan.vscode-database-client2
- GitHub.vscode-pull-request-github
ports:
- port: 4200
name: Hertzbeat
onOpen: open-browser

View File

@ -62,6 +62,8 @@ header:
- '.stylelintrc'
- '.prettierignore'
- '.prettierrc.js'
- '.gitpod.Dockerfile'
- '.gitpod.yml'
- 'karma.conf.js'
- 'proxy.conf.js'
- '.helmignore'
@ -92,12 +94,12 @@ header:
- 'web-app/src/style.less'
- 'web-app/src/test.ts'
- 'web-app/src/typings.d.ts'
comment: on-failure
dependency:
files:
- pom.xml
- web-app/package.json

View File

@ -18,6 +18,7 @@
[![Docker Pulls](https://img.shields.io/docker/pulls/apache/hertzbeat?style=%20for-the-badge&logo=docker&label=DockerHub%20Download)](https://hub.docker.com/r/apache/hertzbeat)
[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/hertzbeat)](https://artifacthub.io/packages/search?repo=hertzbeat)
[![YouTube Channel Subscribers](https://img.shields.io/youtube/channel/subscribers/UCri75zfWX0GHqJFPENEbLow?logo=youtube&label=YouTube%20Channel)](https://www.youtube.com/channel/UCri75zfWX0GHqJFPENEbLow)
[![Contribute with Gitpod](https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod&color=green)](https://gitpod.io/#https://github.com/apache/hertzbeat)
**Home: [hertzbeat.apache.org](https://hertzbeat.apache.org)**
**Email: <a href="mailto:dev-subscribe@hertzbeat.apache.org">Mail to `dev-subscribe@hertzbeat.apache.org`</a> to subscribe mailing lists**

View File

@ -18,6 +18,7 @@
[![Docker Pulls](https://img.shields.io/docker/pulls/apache/hertzbeat?style=%20for-the-badge&logo=docker&label=DockerHub%20Download)](https://hub.docker.com/r/apache/hertzbeat)
[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/hertzbeat)](https://artifacthub.io/packages/search?repo=hertzbeat)
[![YouTube Channel Subscribers](https://img.shields.io/youtube/channel/subscribers/UCri75zfWX0GHqJFPENEbLow?logo=youtube&label=YouTube%20Channel)](https://www.youtube.com/channel/UCri75zfWX0GHqJFPENEbLow)
[![Contribute with Gitpod](https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod&color=green)](https://gitpod.io/#https://github.com/apache/hertzbeat)
**官网: [hertzbeat.apache.org](https://hertzbeat.apache.org)**