Skip to content

Commit 89c987e

Browse files
committed
Update.
0 parents  commit 89c987e

Some content is hidden

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

87 files changed

+11312
-0
lines changed

.gitattributes

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
resource/** linguist-vendored
2+
resource/static/* !linguist-vendored
3+
resource/template/dashboard/* !linguist-vendored

.github/workflows/agent.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Agent release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@master
13+
with:
14+
fetch-depth: 0
15+
- uses: actions/setup-go@v2
16+
with:
17+
go-version: "^1.17.2"
18+
- name: Run GoReleaser
19+
uses: goreleaser/goreleaser-action@v2
20+
with:
21+
distribution: goreleaser
22+
version: latest
23+
args: release --rm-dist
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/dashboard.yml

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Dashboard image
2+
3+
on:
4+
push:
5+
branches:
6+
- "master"
7+
paths-ignore:
8+
- "cmd/playground/**"
9+
- "cmd/agent/**"
10+
- "script/**"
11+
- "*.md"
12+
- ".*"
13+
- ".github/workflows/agent.yml"
14+
15+
jobs:
16+
deploy:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@master
20+
21+
- name: Log in to the GHCR
22+
uses: docker/login-action@master
23+
with:
24+
registry: ghcr.io
25+
username: ${{ github.repository_owner }}
26+
password: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- name: Login to Docker Hub
29+
uses: docker/login-action@master
30+
with:
31+
username: ${{ secrets.DOC_USER }}
32+
password: ${{ secrets.DOC_PAT }}
33+
34+
- name: Log in to the AliyunCS
35+
uses: docker/login-action@master
36+
with:
37+
registry: registry.cn-shanghai.aliyuncs.com
38+
username: ${{ secrets.ALI_USER }}
39+
password: ${{ secrets.ALI_PAT }}
40+
41+
- name: Set up QEMU
42+
uses: docker/setup-qemu-action@v1
43+
44+
- name: Set up Docker Buildx
45+
uses: docker/setup-buildx-action@v1
46+
47+
- name: Set up image name
48+
run: |
49+
GHRC_IMAGE_NAME=$(echo "ghcr.io/${{ github.repository_owner }}/probe-lite-dashboard" | tr '[:upper:]' '[:lower:]')
50+
DOC_IMAGE_NAME=$(echo "nangle/probe-lite-dashboard" | tr '[:upper:]' '[:lower:]')
51+
if [ ${{ github.repository_owner }} = "xOS" ]
52+
then ALI_IMAGE_NAME=$(echo "registry.cn-shanghai.aliyuncs.com/dns/probe-lite-dashboard")
53+
else ALI_IMAGE_NAME=$(echo "registry.cn-shanghai.aliyuncs.com/${{ github.repository_owner }}/probe-lite-dashboard" | tr '[:upper:]' '[:lower:]')
54+
fi
55+
echo "::set-output name=GHRC_IMAGE_NAME::$GHRC_IMAGE_NAME"
56+
echo "::set-output name=ALI_IMAGE_NAME::$ALI_IMAGE_NAME"
57+
echo "::set-output name=DOC_IMAGE_NAME::$DOC_IMAGE_NAME"
58+
id: image-name
59+
60+
- name: Build dasbboard image And Push
61+
uses: docker/build-push-action@v2
62+
with:
63+
context: .
64+
file: ./Dockerfile
65+
platforms: linux/amd64,linux/arm64,linux/arm,linux/386
66+
push: true
67+
tags: |
68+
${{ steps.image-name.outputs.ALI_IMAGE_NAME }}
69+
${{ steps.image-name.outputs.DOC_IMAGE_NAME }}
70+
${{ steps.image-name.outputs.GHRC_IMAGE_NAME }}
71+
72+
- name: Purge jsdelivr cache
73+
run: |
74+
curl -s https://purge.jsdelivr.net/gh/${{ github.repository_owner }}/probe-lite@master/script/probe.sh
75+
curl -s https://purge.jsdelivr.net/gh/${{ github.repository_owner }}/probe-lite@master/script/probe-agent-lite.service
76+
curl -s https://purge.jsdelivr.net/gh/${{ github.repository_owner }}/probe-lite@master/script/docker-compose.yaml
77+
curl -s https://purge.jsdelivr.net/gh/${{ github.repository_owner }}/probe-lite@master/script/config.yaml
78+
LOWER_USERNAME=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
79+
curl -s https://purge.jsdelivr.net/gh/$LOWER_USERNAME/probe-lite@master/script/probe.sh
80+
curl -s https://purge.jsdelivr.net/gh/$LOWER_USERNAME/probe-lite@master/script/probe-agent-lite.service
81+
curl -s https://purge.jsdelivr.net/gh/$LOWER_USERNAME/probe-lite@master/script/docker-compose.yaml
82+
curl -s https://purge.jsdelivr.net/gh/$LOWER_USERNAME/probe-lite@master/script/config.yaml
83+
curl -s https://purge.jsdelivr.net/gh/xos/probe-lite@master/resource/static/bg/background.jpeg
84+
curl -s https://purge.jsdelivr.net/gh/xos/probe-lite@master/resource/static/favicon.ico
85+
curl -s https://purge.jsdelivr.net/gh/xos/probe-lite@master/resource/static/logo.png
86+
curl -s https://purge.jsdelivr.net/gh/xos/probe-lite@master/resource/static/main.css
87+
curl -s https://purge.jsdelivr.net/gh/xos/probe-lite@master/resource/static/main.js
88+
curl -s https://purge.jsdelivr.net/gh/xos/probe-lite@master/resource/static/semantic-ui-alerts.min.css
89+
curl -s https://purge.jsdelivr.net/gh/xos/probe-lite@master/resource/static/semantic-ui-alerts.min.js

.gitignore

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Binaries for programs and plugins
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
8+
# Test binary, build with `go test -c`
9+
*.test
10+
11+
# Output of the go coverage tool, specifically when used with LiteIDE
12+
*.out
13+
*.pprof
14+
.idea
15+
/data
16+
/dist
17+
.DS_Store
18+
/main
19+
/cmd/agent/main
20+
/cmd/dashboard/main

.goreleaser.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
before:
2+
hooks:
3+
- go mod tidy -v
4+
builds:
5+
- env:
6+
- CGO_ENABLED=0
7+
ldflags:
8+
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}}
9+
goos:
10+
- linux
11+
- windows
12+
- darwin
13+
goarch:
14+
- arm
15+
- arm64
16+
- 386
17+
- amd64
18+
- mips
19+
- mipsle
20+
- s390x
21+
- riscv64
22+
gomips:
23+
- softfloat
24+
ignore:
25+
- goos: windows
26+
goarch: arm
27+
- goos: windows
28+
goarch: arm64
29+
main: ./cmd/agent
30+
binary: probe-lite-agent
31+
universal_binaries:
32+
- name_template: "probe-lite-agent"
33+
replace: false
34+
checksum:
35+
name_template: "checksums.txt"
36+
snapshot:
37+
name_template: "probe-lite-agent"
38+
archives:
39+
- name_template: "probe-lite-agent_{{ .Os }}_{{ .Arch }}"
40+
files:
41+
- none*
42+
changelog:
43+
sort: asc
44+
filters:
45+
exclude:
46+
- "^docs:"
47+
- "^test:"
48+
- "^chore"
49+
- Merge pull request
50+
- Merge branch
51+
- go mod tidy

Dockerfile

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM golang:alpine AS binarybuilder
2+
RUN apk --no-cache --no-progress add \
3+
gcc git musl-dev
4+
WORKDIR /dashboard
5+
COPY . .
6+
RUN cd cmd/dashboard && go build -o app -ldflags="-s -w"
7+
8+
FROM alpine:latest
9+
ENV TZ="Asia/Shanghai"
10+
RUN apk --no-cache --no-progress add \
11+
ca-certificates \
12+
tzdata && \
13+
cp "/usr/share/zoneinfo/$TZ" /etc/localtime && \
14+
echo "$TZ" > /etc/timezone
15+
WORKDIR /dashboard
16+
COPY ./resource ./resource
17+
COPY --from=binarybuilder /dashboard/cmd/dashboard/app ./app
18+
19+
VOLUME ["/dashboard/data"]
20+
EXPOSE 8008 2222
21+
CMD ["/dashboard/app"]

0 commit comments

Comments
 (0)