-
Notifications
You must be signed in to change notification settings - Fork 329
/
wercker.yml
79 lines (66 loc) · 2.67 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
box: golang:1.7
build:
base-path: /go/src/github.com/wercker/stern
steps:
- script:
name: install govendor
code: go get -u github.com/kardianos/govendor
- script:
name: go vet
code: govendor vet +local
- script:
name: install dependencies
code: govendor sync
- script:
name: build binaries
code: |
export CGO_ENABLED=0
GOOS=linux GOARCH=amd64 go build \
-ldflags="-s -X github.com/wercker/stern.GitCommit=$WERCKER_GIT_COMMIT -X github.com/wercker/stern.PatchVersion=$(( ($(date +%s) - $(date --date=20150101 +%s) )/(60*60*24) )) -X github.com/wercker/stern.Compiled=$(date +%s)" \
-installsuffix cgo \
-o $WERCKER_OUTPUT_DIR/artifacts/latest/linux_amd64/stern
GOOS=darwin GOARCH=amd64 go build \
-ldflags="-s -X github.com/wercker/stern.GitCommit=$WERCKER_GIT_COMMIT -X github.com/wercker/stern.PatchVersion=$(( ($(date +%s) - $(date --date=20150101 +%s) )/(60*60*24) )) -X github.com/wercker/stern.Compiled=$(date +%s)" \
-installsuffix cgo \
-o $WERCKER_OUTPUT_DIR/artifacts/latest/darwin_amd64/stern
cp -r $WERCKER_OUTPUT_DIR/artifacts/latest/* $WERCKER_REPORT_ARTIFACTS_DIR
- script:
name: generate SHAs
code: |
cd $WERCKER_OUTPUT_DIR
for f in $(find . -type f -name stern); do
cd $WERCKER_OUTPUT_DIR/$(dirname "$f")
sha256sum stern > SHA256SUMS
done
- script:
name: prepare
code: cp -r scripts $WERCKER_OUTPUT_DIR
release-stable:
steps:
- install-packages:
packages: jshon
- script:
name: version
code: |
export STERN_VERSION=$(./artifacts/latest/linux_amd64/stern --version | awk '{print $3}')
echo "Releasing stern stable v$STERN_VERSION" > $WERCKER_REPORT_MESSAGE_FILE
echo "Releasing stern stable v$STERN_VERSION"
- script:
name: generate release notes
code: |
export RELEASE_NOTES=$(jshon -s "$(./scripts/create-release-notes.sh)" | sed 's/.$//; s/^.//')
echo $RELEASE_NOTES
- github-create-release:
token: $GITHUB_TOKEN
tag: $STERN_VERSION
body: $RELEASE_NOTES
- github-upload-asset:
token: $GITHUB_TOKEN
file: ./artifacts/latest/linux_amd64/stern
filename: stern_linux_amd64
content-type: application/octet-stream
- github-upload-asset:
token: $GITHUB_TOKEN
file: ./artifacts/latest/darwin_amd64/stern
filename: stern_darwin_amd64
content-type: application/octet-stream