1 Star 0 Fork 0

真逗/jenkins-pipeline-golang-demo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
.drone.yml 1.76 KB
一键复制 编辑 原始数据 按行查看 历史
qiuyt 提交于 2021-11-09 14:51 . jenkins-demo20211109
kind: pipeline
name: default
steps:
- name: linter
image: golang:latest
environment:
GOPROXY: https://mirrors.aliyun.com/goproxy/
commands:
- go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
- golangci-lint run
- name: build
image: golang:latest
environment:
GOPROXY: https://mirrors.aliyun.com/goproxy/
GOOS: linux
GOARCH: amd64
CGO_ENABLED: 0
commands:
- go build -o demo-app
- name: docker
image: plugins/docker
settings:
repo: cnych/devops-demo
use_cache: true
username:
from_secret: docker_username
password:
from_secret: docker_password
tags:
- latest
# - ${DRONE_COMMIT_SHA:0:8}
when:
event: push
branch: master
- name: deploy
image: quay.io/ipedrazas/drone-helm
environment:
STABLE_REPO_URL: https://mirror.azure.cn/kubernetes/charts/
SERVICE_ACCOUNT: tiller
API_SERVER:
from_secret: api_server
KUBERNETES_TOKEN:
from_secret: kubernetes_token
KUBERNETES_CERTIFICATE:
from_secret: kubernetes_ca
settings:
client-only: true
wait: true
recreate_pods: true
chart: ./helm
release: drk8d
values_files: ["./helm/my-values.yaml"]
namespace: kube-ops
when:
event: push
branch: master
# - name: release
# image: plugins/docker
# settings:
# repo: cnych/devops-demo
# # use_cache: true
# # cache_from: cnych/devops-demo
# username:
# from_secret: docker_username
# password:
# from_secret: docker_password
# tags:
# - ${DRONE_TAG##v}
# - ${DRONE_COMMIT_SHA:0:8}
# - latest
# when:
# event: tag
# branch: master
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/qiuyt/jenkins-pipeline-golang-demo.git
git@gitee.com:qiuyt/jenkins-pipeline-golang-demo.git
qiuyt
jenkins-pipeline-golang-demo
jenkins-pipeline-golang-demo
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385