Skip to content

Commit f22c4e5

Browse files
committed
Merge branch 'go-admin-team:master' into master
2 parents 3211b47 + 7d7fc53 commit f22c4e5

File tree

341 files changed

+16469
-16770
lines changed

Some content is hidden

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

341 files changed

+16469
-16770
lines changed

.github/workflows/codeql-analysis.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
# The branches below must be a subset of the branches above
8+
branches: [ master ]
9+
10+
jobs:
11+
analyze:
12+
name: Analyze
13+
runs-on: ubuntu-latest
14+
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
language: [ 'go' ]
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v2
23+
24+
# Initializes the CodeQL tools for scanning.
25+
- name: Initialize CodeQL
26+
uses: github/codeql-action/init@v1
27+
with:
28+
languages: ${{ matrix.language }}
29+
# If you wish to specify custom queries, you can do so here or in a config file.
30+
# By default, queries listed here will override any specified in a config file.
31+
# Prefix the list here with "+" to use these queries and those in the config file.
32+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
33+
34+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
35+
# If this step fails, then you should remove it and run the build manually (see below)
36+
- name: Autobuild
37+
uses: github/codeql-action/autobuild@v1
38+
39+
# ℹ️ Command-line programs to run using the OS shell.
40+
# 📚 https://git.io/JvXDl
41+
42+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
43+
# and modify them (or add more) to build your code if your project
44+
# uses a compiled language
45+
46+
#- run: |
47+
# make bootstrap
48+
# make release
49+
50+
- name: Perform CodeQL Analysis
51+
uses: github/codeql-action/analyze@v1

.github/workflows/dev-lwx.yml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches: [ dev-lwx ]
6+
pull_request:
7+
branches: [ dev-lwx ]
8+
9+
jobs:
10+
build:
11+
name: Build
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Set up Go 1.15
15+
uses: actions/setup-go@v1
16+
with:
17+
go-version: 1.15
18+
id: go
19+
20+
- name: Check out code into the Go module directory
21+
uses: actions/checkout@v2
22+
- name: Get dependencies
23+
run: |
24+
go get -v -t -d ./...
25+
if [ -f Gopkg.toml ]; then
26+
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
27+
dep ensure
28+
fi
29+
- name: Build
30+
run: |
31+
CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -a -installsuffix cgo -o go-admin .
32+
mv go-admin ./scripts
33+
34+
- uses: Azure/docker-login@v1
35+
with:
36+
login-server: registry.cn-shanghai.aliyuncs.com
37+
username: ${{ secrets.REGISTRY_USERNAME }}
38+
password: ${{ secrets.REGISTRY_PASSWORD }}
39+
- run: |
40+
docker build ./scripts -t registry.cn-shanghai.aliyuncs.com/go-admin-team/go-admin:${{ github.sha }}
41+
docker push registry.cn-shanghai.aliyuncs.com/go-admin-team/go-admin:${{ github.sha }}
42+
- uses: Azure/k8s-set-context@v1
43+
with:
44+
kubeconfig: ${{ secrets.KUBE_CONFIG }}
45+
46+
- uses: Azure/k8s-create-secret@v1
47+
with:
48+
namespace: 'go-admin'
49+
container-registry-url: registry.cn-shanghai.aliyuncs.com
50+
container-registry-username: ${{ secrets.REGISTRY_USERNAME }}
51+
container-registry-password: ${{ secrets.REGISTRY_PASSWORD }}
52+
secret-name: aliyuncs-k8s-secret
53+
54+
- uses: Azure/k8s-deploy@v1
55+
with:
56+
namespace: 'go-admin'
57+
manifests: 'scripts/k8s/deploy.yml'
58+
images: 'registry.cn-shanghai.aliyuncs.com/go-admin-team/go-admin:${{ github.sha }}'
59+
imagepullsecrets: 'aliyuncs-k8s-secret'
60+
kubectl-version: 'latest'

.github/workflows/go.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515

16-
- name: Set up Go 1.13
16+
- name: Set up Go 1.14
1717
uses: actions/setup-go@v1
1818
with:
19-
go-version: 1.13
19+
go-version: 1.14
2020
id: go
2121

2222
- name: Check out code into the Go module directory

.gitignore

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.idea
22
.vscode
3+
*/.DS_Store
34
static/uploadfile
45
main.exe
56
go-admin
@@ -14,4 +15,10 @@ config/settings.dev.*.yml.log
1415
temp/logs
1516
config/settings.dev.yml.log
1617
config/settings.b.dev.yml
17-
cmd/migrate/migration/version_local/*
18+
cmd/migrate/migration/version-local/*
19+
!cmd/migrate/migration/version-local/doc.go
20+
*/.DS_Store
21+
22+
# go sum
23+
go.sum
24+
config/settings.deva.yml

Dockerfile

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
21
FROM golang:alpine as builder
32

4-
MAINTAINER xxx
3+
MAINTAINER lwnmengjing
54

65
ENV GOPROXY https://goproxy.cn/
76

87
WORKDIR /go/release
98
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
109
RUN apk update && apk add tzdata
1110

12-
COPY ./go.mod ./go.mod
11+
COPY go.mod ./go.mod
1312
RUN go mod download
1413
COPY . .
1514
RUN pwd && ls
@@ -19,11 +18,9 @@ RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -a -installsuffix cgo -o
1918
FROM alpine
2019

2120
COPY --from=builder /go/release/go-admin /
22-
COPY --from=builder /go/release/config/ /config/
2321

2422
COPY --from=builder /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
2523

2624
EXPOSE 8000
2725

28-
CMD ["/go-admin","server","-c", "/config/settings.yml"]
29-
26+
CMD ["/go-admin","server","-c", "/config/settings.yml"]

0 commit comments

Comments
 (0)