-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathwercker.yml
119 lines (109 loc) · 3.83 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# 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
# - mongodb
# 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:
# 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 -u github.com/golang/dep/cmd/dep
code: |
go get -u github.com/golang/dep/cmd/dep
dep ensure
# Build the project
- script:
name: go build
code: |
go build ./...
# Test the project
- script:
name: go test
code: |
go test ./...
# Run golint to find suggestions for code fixes after everything else passes (polish)
- golint:
exclude: "vendor"
- script:
name: install goxc (and related deps) for release
code: |
go get github.com/laher/goxc
go get github.com/gorilla/mux
go get github.com/gorilla/context
go get github.com/inconshreveable/mousetrap
# - script:
# name: configure deploy key for goxc
# code: goxc -wlc default publish-github -apikey=$GITHUB_TOKEN
- script:
name: goxc compile (linux, windows, darwin, amd64)
code: |
goxc -d=$WERCKER_OUTPUT_DIR/goxc/ -tasks-=go-test -tasks-=downloads-page
- script:
name: store $APP_VERSION
code: export APP_VERSION=$(git describe --abbrev=5 --dirty --always --tags)
- script:
name: export env vars
code: |
export
# - script:
# name: install mitchellh/gox
# code: |
# go get -u -v github.com/mitchellh/gox
# sudo -E env PATH=$GOPATH/bin:$PATH gox -build-toolchain
# - tcnksm/gox:
# os: "darwin linux windows" # OS to cross-compile
# arch: "amd64" # ARCH to cross-compile
deploy:
steps:
- script:
name: export env vars
code: |
export
- script:
name: log some output for purposes
code: |
pwd
ls -als
ls -als goxc/0.1.1
# - script:
# name: export APP_VERSION from Git repo
# code: |
# cd $WERCKER_SOURCE_DIR
# export APP_VERSION=$(cd ${WERCKER_SOURCE_DIR} && git describe --dirty --always --tags --abbrev=5)
- script:
name: generate version from goxc directory
code: |
export APP_VERSION=$(ls -1 goxc/)
- github-create-release:
token: $GITHUB_TOKEN
tag: $APP_VERSION
- github-upload-asset:
token: $GITHUB_TOKEN
file: $WERCKER_ROOT/goxc/${APP_VERSION}/remy_${APP_VERSION}_windows_amd64.zip
- github-upload-asset:
token: $GITHUB_TOKEN
file: $WERCKER_ROOT/goxc/${APP_VERSION}/remy_${APP_VERSION}_linux_amd64.tar.gz
- github-upload-asset:
token: $GITHUB_TOKEN
file: $WERCKER_ROOT/goxc/0.1.1/remy_0.1.1_darwin_amd64.zip
- github-upload-asset:
token: $GITHUB_TOKEN
file: $WERCKER_OUTPUT_DIR/goxc/0.1.1/remy_0.1.1_amd64.deb