-
Notifications
You must be signed in to change notification settings - Fork 61
/
screwdriver.yaml
50 lines (48 loc) · 2.34 KB
/
screwdriver.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---
# Shared definition block
# This is where you would define any attributes that all your jobs will
# inherit. In our example, we state that all our Jobs will use the same Docker
# container for building in, as well as have a common environment variable set
shared:
# Docker image to use as the desired build container. This typically takes the
# form of "repo_name". Alternatively, you can define the image as
# "repo_name:tag_label"
# Docker image reference - https://hub.docker.com/_/golang/
image: golang
# A map of environment variables that we want to set
environment:
# We set the GOPATH to the build workspace. Eventually, this will be
# accessible by another environment variable that we can reference instead
# of hard-coding it here
GOPATH: /sd/workspace
# Jobs definition block
# All pipelines have "main" by default, and is implicitly defined.
jobs:
# We explicitly define "main" in our configuration so that it does what we
# want it to do.
main:
# A single job name or array of jobs that will trigger the job to run.
# Jobs defined with "requires: ~pr" are started by pull-request events.
# Jobs defined with "requires: ~commit" are started by push events.
# Jobs defined with "requires: ~sd@123:main" are started by job "main" from pipeline "123".
# Jobs defined with "requires: deploy-west" are started after "deploy-west" is done.
# Jobs defined with "requires: [deploy-west, deploy-east] are started after "deploy-west" and "deploy-east" are both done running successfully.
requires:
- ~pr
- ~commit
# Steps is the ordered list of commands to execute.
# Each step takes the form "step_name: command_to_run". The "step_name" is a
# convient label to reference it by. The "command_to_run" is the single
# command that is executed during the step.
steps:
# Go commands document - https://golang.org/cmd/go/
# This step downloads and installs packages and dependencies
- get: go get -t ./...
# The "vet" step runs the go tool vet on packages
- vet: go vet ./...
# This step runs gofmt on package resources
- gofmt: "find . -name '*.go' | xargs gofmt -s -w"
# The "test" step tests the packages
- test: go test ./...
# Compiles the packages and dependencies
- build: go build -o hello_go -a ./...