-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'gitlab/feature/fix-cert'
# Conflicts: # .gitlab-ci.yml # go.mod
- Loading branch information
Showing
23 changed files
with
326 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
stages: | ||
- notice | ||
- check | ||
- build | ||
- deploy | ||
- publish | ||
|
||
variables: | ||
PATH: /usr/local/sonar-scanner/sonar-scanner-4.4.0.2170-linux/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/data/golang/go/bin/:/root/go/bin | ||
GOROOT: /data/golang/go | ||
GOPROXY: https://goproxy.cn | ||
APP: apinto | ||
VERSION: $CI_COMMIT_SHORT_SHA | ||
SAVE_DIR: /opt/apinto | ||
APP_PRE: ${APP}-${VERSION} | ||
|
||
default: | ||
before_script: | ||
- pwd | ||
|
||
merge-informer: # 飞书回调 | ||
stage: notice | ||
variables: | ||
DIFF_URL: "$CI_MERGE_REQUEST_PROJECT_URL/-/merge_requests/$CI_MERGE_REQUEST_IID/diffs" | ||
rules: | ||
- if: $CI_PIPELINE_SOURCE=="merge_request_event" | ||
script: | ||
- rm -rf out/apinto-* | ||
- | | ||
curl -X POST -H "Content-Type: application/json" \ | ||
-d "{\"msg_type\":\"text\",\"content\":{\"text\":\"项目:${CI_PROJECT_NAME}\\n提交人:${GITLAB_USER_NAME}\\n提交信息:${CI_MERGE_REQUEST_TITLE}\\n合并分支信息:${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME} -> ${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}\\n差异性地址:${DIFF_URL}\\n请及时review代码\"}}" \ | ||
https://open.feishu.cn/open-apis/bot/v2/hook/1c334752-2874-41a1-8f1b-3060f2d46b6c | ||
checker: | ||
stage: check | ||
rules: | ||
- if: $CI_COMMIT_BRANCH=="develop" | ||
script: | ||
- set +e | ||
- go mod tidy | ||
- go test -covermode=atomic -coverpkg=./... -coverprofile=coverage.data -timeout=1m ./... | ||
- golangci-lint run --timeout=3m --out-format checkstyle --issues-exit-code 0 ./... > report.xml | ||
- sonar-scanner | ||
builder: | ||
stage: build | ||
rules: | ||
- if: $CI_COMMIT_BRANCH=="develop" | ||
when: on_success | ||
- if: $CI_COMMIT_BRANCH=="test" | ||
when: on_success | ||
script: | ||
- sed -i '/replace github.com\/eolinker\/eosc => */d' go.mod | ||
- go mod tidy | ||
- cd build/cmd && ./package.sh $VERSION | ||
cache: | ||
paths: | ||
- out/ | ||
deployer: | ||
stage: deploy | ||
rules: | ||
- if: $CI_COMMIT_BRANCH=="develop" | ||
variables: | ||
DEPLOY_SERVER: [email protected] | ||
DEPLOY_DESC: "DEV 环境" | ||
- if: $CI_COMMIT_BRANCH=="test" | ||
variables: | ||
DEPLOY_SERVER: [email protected] | ||
DEPLOY_DESC: "TEST 环境" | ||
dependencies: | ||
- builder | ||
script: | ||
- set -e | ||
- scp out/${APP_PRE}.linux.x64.tar.gz ${DEPLOY_SERVER}:${SAVE_DIR} | ||
- ssh ${DEPLOY_SERVER} "set -e; cd ${SAVE_DIR}; mkdir -p ${APP_PRE};tar -zxvf ${APP_PRE}.linux.x64.tar.gz -C ${APP_PRE};cd ${APP_PRE}/${APP}; ./install.sh upgrade;cd ${SAVE_DIR}; ./clean.sh ${APP_PRE}" | ||
- | | ||
curl -X POST -H "Content-Type: application/json" \ | ||
-d "{\"msg_type\":\"text\",\"content\":{\"text\":\"项目:apinto\\n环境:${DEPLOY_DESC}\\n更新部署完成.\"}}" \ | ||
https://open.feishu.cn/open-apis/bot/v2/hook/1c334752-2874-41a1-8f1b-3060f2d46b6c | ||
when: on_success | ||
cache: | ||
paths: | ||
- out/ | ||
publisher: | ||
stage: publish | ||
only: | ||
- tags | ||
script: | ||
- sed -i '/replace github.com\/eolinker\/eosc => */d' go.mod | ||
- go mod tidy | ||
- GOVERSION=$(go version) EoscVersion=$(sed -n 's/.*eosc v/v/p' go.mod) goreleaser release --skip-validate --rm-dist --skip-publish | ||
- mkdir -p /data/pkg/apinto/${CI_COMMIT_TAG} | ||
- cp -if dist/*.tar.gz /data/pkg/apinto/${CI_COMMIT_TAG} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
stages: | ||
- notice | ||
- check | ||
- build | ||
- deploy | ||
- publish | ||
|
||
variables: | ||
PATH: /usr/local/sonar-scanner/sonar-scanner-4.4.0.2170-linux/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/data/golang/go/bin/:/root/go/bin | ||
GOROOT: /data/golang/go | ||
GOPROXY: https://goproxy.cn | ||
APP: apinto | ||
VERSION: $CI_COMMIT_SHORT_SHA | ||
SAVE_DIR: /opt/apinto | ||
APP_PRE: ${APP}-${VERSION} | ||
|
||
default: | ||
before_script: | ||
- pwd | ||
|
||
merge-informer: # 飞书回调 | ||
stage: notice | ||
variables: | ||
DIFF_URL: "$CI_MERGE_REQUEST_PROJECT_URL/-/merge_requests/$CI_MERGE_REQUEST_IID/diffs" | ||
rules: | ||
- if: $CI_PIPELINE_SOURCE=="merge_request_event" | ||
script: | ||
- rm -rf out/apinto-* | ||
- | | ||
curl -X POST -H "Content-Type: application/json" \ | ||
-d "{\"msg_type\":\"text\",\"content\":{\"text\":\"项目:${CI_PROJECT_NAME}\\n提交人:${GITLAB_USER_NAME}\\n提交信息:${CI_MERGE_REQUEST_TITLE}\\n合并分支信息:${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME} -> ${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}\\n差异性地址:${DIFF_URL}\\n请及时review代码\"}}" \ | ||
https://open.feishu.cn/open-apis/bot/v2/hook/1c334752-2874-41a1-8f1b-3060f2d46b6c | ||
checker: | ||
stage: check | ||
rules: | ||
- if: $CI_COMMIT_BRANCH=="develop" | ||
script: | ||
- set +e | ||
- go mod tidy | ||
- go test -covermode=atomic -coverpkg=./... -coverprofile=coverage.data -timeout=1m ./... | ||
- golangci-lint run --timeout=3m --out-format checkstyle --issues-exit-code 0 ./... > report.xml | ||
- sonar-scanner | ||
builder: | ||
stage: build | ||
rules: | ||
- if: $CI_COMMIT_BRANCH=="develop" | ||
when: on_success | ||
- if: $CI_COMMIT_BRANCH=="test" | ||
when: on_success | ||
script: | ||
- sed -i '/replace github.com\/eolinker\/eosc => */d' go.mod | ||
- go mod tidy | ||
- cd build/cmd && ./package.sh $VERSION | ||
cache: | ||
paths: | ||
- out/ | ||
deployer: | ||
stage: deploy | ||
rules: | ||
- if: $CI_COMMIT_BRANCH=="develop" | ||
variables: | ||
DEPLOY_SERVER: [email protected] | ||
DEPLOY_DESC: "DEV 环境" | ||
- if: $CI_COMMIT_BRANCH=="test" | ||
variables: | ||
DEPLOY_SERVER: [email protected] | ||
DEPLOY_DESC: "TEST 环境" | ||
dependencies: | ||
- builder | ||
script: | ||
- set -e | ||
- scp out/${APP_PRE}.linux.x64.tar.gz ${DEPLOY_SERVER}:${SAVE_DIR} | ||
- ssh ${DEPLOY_SERVER} "set -e; cd ${SAVE_DIR}; mkdir -p ${APP_PRE};tar -zxvf ${APP_PRE}.linux.x64.tar.gz -C ${APP_PRE};cd ${APP_PRE}/${APP}; ./install.sh upgrade;cd ${SAVE_DIR}; ./clean.sh ${APP_PRE}" | ||
- | | ||
curl -X POST -H "Content-Type: application/json" \ | ||
-d "{\"msg_type\":\"text\",\"content\":{\"text\":\"项目:apinto\\n环境:${DEPLOY_DESC}\\n更新部署完成.\"}}" \ | ||
https://open.feishu.cn/open-apis/bot/v2/hook/1c334752-2874-41a1-8f1b-3060f2d46b6c | ||
when: on_success | ||
cache: | ||
paths: | ||
- out/ | ||
publisher: | ||
stage: publish | ||
only: | ||
- tags | ||
script: | ||
- sed -i '/replace github.com\/eolinker\/eosc => */d' go.mod | ||
- go mod tidy | ||
- GOVERSION=$(go version) EoscVersion=$(sed -n 's/.*eosc v/v/p' go.mod) goreleaser release --skip-validate --rm-dist --skip-publish | ||
- mkdir -p /data/pkg/apinto/${CI_COMMIT_TAG} | ||
- cp -if dist/*.tar.gz /data/pkg/apinto/${CI_COMMIT_TAG} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,26 @@ | ||
listen: # node listen port | ||
- 8099 | ||
version: 2 | ||
#certificate: # 证书存放根目录 | ||
# dir: /etc/apinto/cert | ||
client: | ||
#advertise_urls: # open api 服务的广播地址 | ||
#- http://127.0.0.1:9400 | ||
listen_urls: # open api 服务的监听地址 | ||
- http://0.0.0.0:9400 | ||
#certificate: # 证书配置,允许使用ip的自签证书 | ||
# - cert: server.pem | ||
# key: server.key | ||
gateway: | ||
#advertise_urls: # 转发服务的广播地址 | ||
#- http://127.0.0.1:9400 | ||
listen_urls: # 转发服务的监听地址 | ||
- https://0.0.0.0:8099 | ||
- http://0.0.0.0:8099 | ||
peer: # 集群间节点通信配置信息 | ||
listen_urls: # 节点监听地址 | ||
- http://0.0.0.0:9401 | ||
#advertise_urls: # 节点通信广播地址 | ||
#- http://127.0.0.1:9400 | ||
#certificate: # 证书配置,允许使用ip的自签证书 | ||
# - cert: server.pem | ||
# key: server.key | ||
|
||
admin: # openAPI request info | ||
scheme: http # listen scheme | ||
listen: 9400 # listen port | ||
ip: 0.0.0.0 # listen ip | ||
#ssl: | ||
# listen: | ||
# - port: 443 #https端口 | ||
# certificate: # 不配表示使用所有 cert_dir中的证书,默认pem文件后缀为pem,key后缀为key | ||
# - cert: cert.pem | ||
# key: cert.key | ||
#certificate: | ||
# dir: ./cert # 证书文件目录,不填则默认从cert目录下载 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.