-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwercker.yml
More file actions
61 lines (52 loc) · 1.75 KB
/
wercker.yml
File metadata and controls
61 lines (52 loc) · 1.75 KB
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
# 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
# https://devcenter.wercker.com/overview-and-core-concepts/containers/
box:
id: "golang:1.16.5"
username: $DOCKERHUB_USERNAME
password: $DOCKERHUB_ACCESS_TOKEN
# Read more about pipelines on our dev center
# https://devcenter.wercker.com/development/pipelines/
# You can also use services such as databases. Read more on our dev center:
# https://devcenter.wercker.com/administration/services/
# services:
# - postgres
# https://devcenter.wercker.com/administration/services/examples/postgresql/
# - mongo
# https://devcenter.wercker.com/administration/services/examples/mongodb/
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:
# https://devcenter.wercker.com/development/steps/
steps:
# Sets the go workspace and places you package
# at the right place in the workspace tree
- setup-go-workspace
# Gets the dependencies
- script:
name: go get
code: |
go get
# Build the project
- script:
name: go build
code: |
go build ./...
# Test the project
- script:
name: go test
code: |
go test ./...
deploy:
steps:
- add-to-known_hosts:
hostname: $DEPLOY_HOST
- add-ssh-key:
keyname: FERRY_WERCKER
- script:
name: compose-up
code: |
ssh $DEPLOY_TO_USER@$DEPLOY_HOST "cd ~/go/src/github.com/Codehanhan/ferry-backend && git fetch && git rebase --autostash && make build-images && make compose-up"