forked from grafeas/grafeas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwercker.yml
104 lines (91 loc) · 3.2 KB
/
wercker.yml
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# This references the default golang container from
# the Docker Hub: https://registry.hub.docker.com/u/library/golang/
# If you want Google's container you would reference google/golang
# Read more about containers on our dev center
# http://devcenter.wercker.com/docs/containers/index.html
box: golang
# This is the build pipeline. Pipelines are the core of wercker
# Read more about pipelines on our dev center
# http://devcenter.wercker.com/docs/pipelines/index.html
# You can also use services such as databases. Read more on our dev center:
# http://devcenter.wercker.com/docs/services/index.html
# services:
# - postgres
# http://devcenter.wercker.com/docs/services/postgresql.html
# - mongo
# http://devcenter.wercker.com/docs/services/mongodb.html
build:
# The steps that will be executed on build
# Steps make up the actions in your pipeline
# Read more about steps on our dev center:
# http://devcenter.wercker.com/docs/steps/index.html
steps:
- install-packages:
packages: zip unzip gnupg
# Sets the go workspace and places you package
# at the right place in the workspace tree
- setup-go-workspace:
package-dir: github.com/grafeas/grafeas
# Get protobuf
- script:
name: get protobuf
code: |
echo "Installing protobuf ..."
mkdir -p /protobuf
curl -o protobuf.zip -L https://github.com/google/protobuf/releases/download/v3.5.1/protoc-3.5.1-linux-x86_64.zip
unzip -d /protobuf protobuf.zip
mv protobuf.zip /protobuf
echo "Done installing protobuf."
# Gets the dependencies
- script:
name: go get
code: |
go version
go get -u github.com/golang/protobuf/protoc-gen-go
go get github.com/cockroachdb/cmux
go get github.com/rs/cors
go get google.golang.org/grpc
go get gopkg.in/yaml.v2
go get github.com/lib/pq
# Build the project
- script:
name: make
code: |
export PATH="/protobuf/bin:$PATH"
make clean build
# Copy results to output dir
# TODO: fix this to not copy .git directory
- script:
name: copy to output
code: |
echo "cp -a /go $WERCKER_OUTPUT_DIR"
cp -a /go $WERCKER_OUTPUT_DIR
publish:
steps:
- script:
name: copy source to /go
code: |
echo "rm -fr /go/*"
rm -fr /go/*
echo "cp -a /pipeline/source/go/* /go"
cp -a /pipeline/source/go/* /go
- internal/docker-push:
username: wmhopkins
password: super-secret-1
email: [email protected]
repository: wmhopkins/sscm
ports: 8080
working-dir: /go/src/github.com/grafeas/grafeas/samples/server/go-server/api/server/main
cmd: go run main.go
deploy-gke:
steps:
- riceo/[email protected]:
debug: true
server: https://$GKE_MASTER_ADDRESS
username: [email protected]
gcloud-key-json: $GCP_KEY_JSON
gke-cluster-name: $GKE_CLUSTER_NAME
gke-cluster-zone: $GKE_CLUSTER_ZONE
gke-cluster-project: $GKE_CLUSTER_PROJECT
insecure-skip-tls-verify: true
command: replace -f grafeas-deploy-gke.yaml