代码拉取完成,页面将自动刷新
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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。