提交 d29a6013 编写于 作者: 李光春's avatar 李光春

update

上级 80e15188
# This file is a template, and might need editing before it works on your project.
image: golang:latest
variables:
# Please edit to your GitLab project
REPO_NAME: gitlab.com/namespace/project
# The problem is that to be able to use go get, one needs to put
# the repository in the $GOPATH. So for example if your gitlab domain
# is gitlab.com, and that your repository is namespace/project, and
# the default GOPATH being /go, then you'd need to have your
# repository in /go/src/gitlab.com/namespace/project
# Thus, making a symbolic link corrects this.
before_script:
- mkdir -p $GOPATH/src/$(dirname $REPO_NAME)
- ln -svf $CI_PROJECT_DIR $GOPATH/src/$REPO_NAME
- cd $GOPATH/src/$REPO_NAME
stages:
- test
- build
- deploy
format:
stage: test
script:
- go fmt $(go list ./... | grep -v /vendor/)
- go vet $(go list ./... | grep -v /vendor/)
- go test -race $(go list ./... | grep -v /vendor/)
compile:
stage: build
script:
- go build -race -ldflags "-extldflags '-static'" -o $CI_PROJECT_DIR/mybinary
artifacts:
paths:
- mybinary
......@@ -2,11 +2,11 @@
export GO15VENDOREXPERIMENT=1
export GOPROXY=https://goproxy.cn,direct
# 在工作目录创建源文件夹
mkdir -p $GOPATH/src/dtapps/golang/
mkdir -p $GOPATH/src/dtapps/
# 拷贝代码到创建好的目录
cp -rf . $GOPATH/src/dtapps/golang/
cp -rf . $GOPATH/src/dtapps/
# 进入项目
cd $GOPATH/src/dtapps/golang/
cd $GOPATH/src/dtapps/
# 构建,在GOPATH下生成构建包
go mod tidy
# 列出文件
......
kind: pipeline
type: docker # 使用docker
type: docker
name: default
steps:
- name: go-library
- name: dtapps
image: golang
commands:
- go mod tidy
......
---
stages:
- ".pre"
- build
- test
- deploy
- ".post"
build-job:
stage: build
script:
- echo "Compiling the code..."
- echo "Compile complete."
unit-test-job:
stage: test
script:
- echo "Running unit tests... This will take about 60 seconds."
- sleep 60
- echo "Code coverage is 90%"
lint-test-job:
stage: test
script:
- echo "Linting code... This will take about 10 seconds."
- sleep 10
- echo "No lint issues found."
deploy-job:
stage: deploy
script:
- echo "Deploying application..."
- echo "Application successfully deployed."
<img align="right" width="100" src="https://kodo-cdn.dtapp.net/04/999e9f2f06d396968eacc10ce9bc8a.png" alt="www.dtapp.net"/>
<img width="100" src="https://kodo-cdn.dtapp.net/04/999e9f2f06d396968eacc10ce9bc8a.png" alt="www.dtapp.net"/>
<h1 align="left"><a href="https://www.dtapp.net/">Golang SSH Tunnel</a></h1>
<h1><a href="https://www.dtapp.net/">Golang SSH Tunnel</a></h1>
📦 Golang SSH 隧道
通过Go实现从本地连接到远程服务器的数据库
[comment]: <> (dtapps)
![GitHub Org's stars](https://img.shields.io/github/stars/dtapps?style=for-the-badge)
[![GitHub Org's stars](https://img.shields.io/github/stars/dtapps?style=for-the-badge)](https://github.com/dtapps)
[comment]: <> (go)
![golang version](https://img.shields.io/badge/golang-%3E%3D1.6-8892BF.svg?style=for-the-badge)
![godoc](https://pkg.go.dev/badge/github.com/dtapps/go-ssh-tunnel?status.svg)
[![golang version](https://img.shields.io/badge/golang-%3E%3D1.6-8892BF.svg?style=for-the-badge)](https://pkg.go.dev/github.com/go-ssh-tunnel)
[![godoc](https://pkg.go.dev/badge/github.com/go-ssh-tunnel?status.svg)](https://pkg.go.dev/github.com/go-ssh-tunnel)
[comment]: <> (goproxy.cn)
![goproxy](https://goproxy.cn/stats/github.com/dtapps/go-ssh-tunnel/badges/download-count.svg)
[![goproxy](https://goproxy.cn/stats/github.com/go-ssh-tunnel/badges/download-count.svg)](https://goproxy.cn/stats/github.com/go-ssh-tunnel)
[comment]: <> (goreportcard.com)
![go report card](https://goreportcard.com/badge/github.com/dtapps/go-ssh-tunnel)
[comment]: <> (badge.fury.io)
![go project version](https://badge.fury.io/go/github.com%2Fdtapps%2Fgo-ssh-tunnel.svg)
[![go report card](https://goreportcard.com/badge/github.com/go-ssh-tunnel)](https://goreportcard.com/report/github.com/go-ssh-tunnel)
[comment]: <> (github.com)
![latest release](https://badgen.net/github/release/dtapps/go-ssh-tunnel)
![latest stable release](https://badgen.net/github/release/dtapps/go-ssh-tunnel/stable)
![latest tag](https://badgen.net/github/tag/dtapps/go-ssh-tunnel)
![watchers](https://badgen.net/github/watchers/dtapps/go-ssh-tunnel)
![combined checks (master branch)](https://badgen.net/github/checks/dtapps/go-ssh-tunnel)
![stars](https://badgen.net/github/stars/dtapps/go-ssh-tunnel)
![forks](https://badgen.net/github/forks/dtapps/go-ssh-tunnel)
![issues](https://badgen.net/github/issues/dtapps/go-ssh-tunnel)
![branches](https://badgen.net/github/branches/dtapps/go-ssh-tunnel)
![releases](https://badgen.net/github/releases/dtapps/go-ssh-tunnel)
![tags](https://badgen.net/github/tags/dtapps/go-ssh-tunnel)
![license](https://badgen.net/github/license/dtapps/go-ssh-tunnel)
![contributors](https://badgen.net/github/contributors/dtapps/go-ssh-tunnel)
![assets downloads for latest release](https://badgen.net/github/assets-dl/dtapps/go-ssh-tunnel)
![assets downloads for a tag](https://badgen.net/github/assets-dl/dtapps/go-ssh-tunnel/1.0.11)
![repository dependents](https://badgen.net/github/dependents-repo/dtapps/go-ssh-tunnel)
![package dependents](https://badgen.net/github/dependents-pkg/dtapps/go-ssh-tunnel)
![dependabot status](https://badgen.net/github/dependabot/dtapps/go-ssh-tunnel)
![GitHub last commit](https://img.shields.io/github/last-commit/dtapps/go-ssh-tunnel?style=for-the-badge)
![GitHub commit activity](https://img.shields.io/github/commit-activity/w/dtapps/go-ssh-tunnel?style=for-the-badge)
![Github All Contributors](https://img.shields.io/github/all-contributors/dtapps/go-ssh-tunnel/master?style=for-the-badge)
![GitHub go.mod Go version (branch)](https://img.shields.io/github/go-mod/go-version/dtapps/go-version/master?style=for-the-badge)
![GitHub go.mod Go version (subdirectory of monorepo)](https://img.shields.io/github/go-mod/go-version/dtapps/go-ssh-tunnel?style=for-the-badge)
![GitHub go.mod Go version (branch & subdirectory of monorepo)](https://img.shields.io/github/go-mod/go-version/dtapps/go-ssh-tunnel/master?style=for-the-badge)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/dtapps/go-ssh-tunnel?style=for-the-badge)
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/dtapps/go-ssh-tunnel?style=for-the-badge)
![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/dtapps/go-ssh-tunnel?style=for-the-badge)
![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/dtapps/go-ssh-tunnel?style=for-the-badge)
![GitHub pull requests](https://img.shields.io/github/issues-pr/dtapps/go-ssh-tunnel?style=for-the-badge)
![GitHub issues](https://img.shields.io/github/issues/dtapps/go-ssh-tunnel?style=for-the-badge)
![GitHub Sponsors](https://img.shields.io/github/sponsors/dtapps?style=for-the-badge)
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/dtapps/go-ssh-tunnel?style=for-the-badge)
![GitHub language count](https://img.shields.io/github/languages/count/dtapps/go-ssh-tunnel?style=for-the-badge)
![GitHub search hit counter](https://img.shields.io/github/search/dtapps/go-ssh-tunnel/go?style=for-the-badge)
![GitHub top language](https://img.shields.io/github/languages/top/dtapps/go-ssh-tunnel?style=for-the-badge)
[![latest release](https://badgen.net/github/release/go-ssh-tunnel)](https://github.com/go-ssh-tunnel)
[![latest stable release](https://badgen.net/github/release/go-ssh-tunnel/stable)](https://github.com/go-ssh-tunnel)
[![latest tag](https://badgen.net/github/tag/go-ssh-tunnel)](https://github.com/go-ssh-tunnel)
[![watchers](https://badgen.net/github/watchers/go-ssh-tunnel)](https://github.com/go-ssh-tunnel)
[![combined checks (master branch)](https://badgen.net/github/checks/go-ssh-tunnel)](https://github.com/go-ssh-tunnel)
[![stars](https://badgen.net/github/stars/go-ssh-tunnel)](https://github.com/go-ssh-tunnel)
[![forks](https://badgen.net/github/forks/go-ssh-tunnel)](https://github.com/go-ssh-tunnel)
[![issues](https://badgen.net/github/issues/go-ssh-tunnel)](https://github.com/go-ssh-tunnel)
[![branches](https://badgen.net/github/branches/go-ssh-tunnel)](https://github.com/go-ssh-tunnel)
[![releases](https://badgen.net/github/releases/go-ssh-tunnel)](https://github.com/go-ssh-tunnel)
[![tags](https://badgen.net/github/tags/go-ssh-tunnel)](https://github.com/go-ssh-tunnel)
[![license](https://badgen.net/github/license/go-ssh-tunnel)](https://github.com/go-ssh-tunnel)
[![contributors](https://badgen.net/github/contributors/go-ssh-tunnel)](https://github.com/go-ssh-tunnel)
[![assets downloads for latest release](https://badgen.net/github/assets-dl/go-ssh-tunnel)](https://github.com/go-ssh-tunnel)
[![repository dependents](https://badgen.net/github/dependents-repo/go-ssh-tunnel)](https://github.com/go-ssh-tunnel)
[![package dependents](https://badgen.net/github/dependents-pkg/go-ssh-tunnel)](https://github.com/go-ssh-tunnel)
[![dependabot status](https://badgen.net/github/dependabot/go-ssh-tunnel)](https://github.com/go-ssh-tunnel)
[![GitHub last commit](https://img.shields.io/github/last-commit/go-ssh-tunnel?style=for-the-badge)](https://github.com/go-ssh-tunnel)
[![GitHub commit activity](https://img.shields.io/github/commit-activity/w/go-ssh-tunnel?style=for-the-badge)](https://github.com/go-ssh-tunnel)
[![Github All Contributors](https://img.shields.io/github/all-contributors/go-ssh-tunnel/master?style=for-the-badge)](https://github.com/go-ssh-tunnel)
[![GitHub go.mod Go version (branch)](https://img.shields.io/github/go-mod/go-version/dtapps/go-version/master?style=for-the-badge)](https://github.com/go-ssh-tunnel)
[![GitHub go.mod Go version (subdirectory of monorepo)](https://img.shields.io/github/go-mod/go-version/go-ssh-tunnel?style=for-the-badge)](https://github.com/go-ssh-tunnel)
[![GitHub go.mod Go version (branch & subdirectory of monorepo)](https://img.shields.io/github/go-mod/go-version/go-ssh-tunnel/master?style=for-the-badge)](https://github.com/go-ssh-tunnel)
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/go-ssh-tunnel?style=for-the-badge)](https://github.com/go-ssh-tunnel)
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/go-ssh-tunnel?style=for-the-badge)](https://github.com/go-ssh-tunnel)
[![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/go-ssh-tunnel?style=for-the-badge)](https://github.com/go-ssh-tunnel)
[![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/go-ssh-tunnel?style=for-the-badge)](https://github.com/go-ssh-tunnel)
[![GitHub pull requests](https://img.shields.io/github/issues-pr/go-ssh-tunnel?style=for-the-badge)](https://github.com/go-ssh-tunnel)
[![GitHub issues](https://img.shields.io/github/issues/go-ssh-tunnel?style=for-the-badge)](https://github.com/go-ssh-tunnel)
[![GitHub Sponsors](https://img.shields.io/github/sponsors/dtapps?style=for-the-badge)](https://github.com/go-ssh-tunnel)
[![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/go-ssh-tunnel?style=for-the-badge)](https://github.com/go-ssh-tunnel)
[![GitHub language count](https://img.shields.io/github/languages/count/go-ssh-tunnel?style=for-the-badge)](https://github.com/go-ssh-tunnel)
[![GitHub search hit counter](https://img.shields.io/github/search/go-ssh-tunnel/go?style=for-the-badge)](https://github.com/go-ssh-tunnel)
[![GitHub top language](https://img.shields.io/github/languages/top/go-ssh-tunnel?style=for-the-badge)](https://github.com/go-ssh-tunnel)
[comment]: <> (scrutinizer-ci.com)
![Scrutinizer build (GitHub/Bitbucket)](https://img.shields.io/scrutinizer/build/g/dtapps/go-ssh-tunnel/master?style=for-the-badge)
![Scrutinizer coverage (GitHub/BitBucket)](https://img.shields.io/scrutinizer/coverage/g/dtapps/go-ssh-tunnel/master?style=for-the-badge)
![Scrutinizer code quality (GitHub/Bitbucket)](https://img.shields.io/scrutinizer/quality/g/dtapps/go-ssh-tunnel/master?style=for-the-badge)
[![Scrutinizer build (GitHub/Bitbucket)](https://img.shields.io/scrutinizer/build/g/go-ssh-tunnel/master?style=for-the-badge)](https://scrutinizer-ci.com/g/go-ssh-tunnel)
[![Scrutinizer coverage (GitHub/BitBucket)](https://img.shields.io/scrutinizer/coverage/g/go-ssh-tunnel/master?style=for-the-badge)](https://scrutinizer-ci.com/g/go-ssh-tunnel)
[![Scrutinizer code quality (GitHub/Bitbucket)](https://img.shields.io/scrutinizer/quality/g/go-ssh-tunnel/master?style=for-the-badge)](https://scrutinizer-ci.com/g/go-ssh-tunnel)
[comment]: <> (www.travis-ci.com)
![Travis (.com) branch](https://img.shields.io/travis/com/dtapps/go-ssh-tunnel/master?style=for-the-badge)
[![Travis (.com) branch](https://img.shields.io/travis/com/go-ssh-tunnel/master?style=for-the-badge)](https://www.travis-ci.com/github/go-ssh-tunnel)
[comment]: <> (app.codecov.io)
![Codecov branch](https://img.shields.io/codecov/c/github/dtapps/go-ssh-tunnel/master?style=for-the-badge)
[![Codecov branch](https://img.shields.io/codecov/c/github/go-ssh-tunnel/master?style=for-the-badge)](https://app.codecov.io/gh/go-ssh-tunnel)
[comment]: <> (gitlab.com)
[![gitlab (.com)](https://gitlab.com/go-ssh-tunnel/badges/master/pipeline.svg)](https://gitlab.com/go-ssh-tunnel)
[comment]: <> (codechina.csdn.net)
[![codechina.csdn (.net)](https://codechina.csdn.net/go-ssh-tunnel/badges/master/pipeline.svg)](https://codechina.csdn.net/go-ssh-tunnel)
## 下载使用
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册