2019-01-22 23:44:17 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
name: default
|
|
|
|
|
|
|
|
platform:
|
|
|
|
os: linux
|
|
|
|
arch: amd64
|
|
|
|
|
|
|
|
workspace:
|
|
|
|
base: /go
|
|
|
|
path: src/github.com/octocat/hello-world
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: build
|
2019-07-17 15:09:47 +00:00
|
|
|
pull: if-not-exists
|
2019-01-22 23:44:17 +00:00
|
|
|
image: golang
|
|
|
|
commands:
|
|
|
|
- go get
|
|
|
|
- go build
|
|
|
|
environment:
|
|
|
|
GOARCH: amd64
|
|
|
|
GOOS: linux
|
|
|
|
volumes:
|
|
|
|
- name: 2f746d702f676f
|
|
|
|
path: /go/bin
|
|
|
|
|
|
|
|
- name: test
|
2019-07-17 15:09:47 +00:00
|
|
|
pull: if-not-exists
|
2019-01-22 23:44:17 +00:00
|
|
|
image: golang:latest
|
|
|
|
commands:
|
|
|
|
- go test -v
|
|
|
|
volumes:
|
|
|
|
- name: 2f746d702f676f
|
|
|
|
path: /go/bin
|
|
|
|
|
|
|
|
- name: docker
|
2019-07-17 15:09:47 +00:00
|
|
|
pull: if-not-exists
|
2019-01-22 23:44:17 +00:00
|
|
|
image: plugins/docker
|
|
|
|
settings:
|
|
|
|
repo: octocat/hello-world
|
|
|
|
environment:
|
|
|
|
DOCKER_PASSWORD:
|
|
|
|
from_secret: docker_password
|
|
|
|
DOCKER_USERNAME:
|
|
|
|
from_secret: docker_username
|
|
|
|
when:
|
|
|
|
branch:
|
|
|
|
- master
|
|
|
|
|
|
|
|
- name: slack
|
2019-07-17 15:09:47 +00:00
|
|
|
pull: if-not-exists
|
2019-01-22 23:44:17 +00:00
|
|
|
image: plugins/slack
|
|
|
|
settings:
|
|
|
|
channel: general
|
|
|
|
environment:
|
|
|
|
SLACK_TOKEN:
|
|
|
|
from_secret: token
|
|
|
|
|
|
|
|
services:
|
|
|
|
- name: database
|
2019-07-17 15:09:47 +00:00
|
|
|
pull: if-not-exists
|
2019-01-22 23:44:17 +00:00
|
|
|
image: mysql
|
|
|
|
environment:
|
|
|
|
MYSQL_PASSWORD: bar
|
|
|
|
MYSQL_USERNAME: foo
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
- name: 2f746d702f676f
|
|
|
|
host:
|
|
|
|
path: /tmp/go
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
branch:
|
|
|
|
- master
|
|
|
|
|
|
|
|
...
|