-
Notifications
You must be signed in to change notification settings - Fork 0
/
wercker.yml
52 lines (47 loc) · 2.04 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
box: simonmenke/go-build:latest
build:
steps:
- setup-go-workspace
- script:
name: "go install"
code: |
CGO_ENABLED=0 go install -v ./cmd/...
- script:
name: "go test"
code: |
go test -v ./cmd/... ./pkg/...
- script:
name: "go build"
code: |
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ${WERCKER_OUTPUT_DIR}/bin/sec-linux-amd64/sec ./cmd/sec
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o ${WERCKER_OUTPUT_DIR}/bin/sec-darwin-amd64/sec ./cmd/sec
deploy:
steps:
- script:
name: "Pull secrets"
code: |
curl -# https://gist.githubusercontent.com/fd/354eed3ebf924565741f0df980d11741/raw/sec.pem | sec dec | tar -C $HOME -x
eval "$(install-creds)"
- script:
name: "Push release"
code: |
mkdir -p dist
if [[ "$WERCKER_DEPLOYTARGET_NAME" == "prerelease" ]]; then
VERSION="$(v5n store bump sec rc)"
v5n apply --commit $WERCKER_GIT_COMMIT --author "Simon Menke" bin/sec-linux-amd64/sec "$VERSION"
v5n apply --commit $WERCKER_GIT_COMMIT --author "Simon Menke" bin/sec-darwin-amd64/sec "$VERSION"
tar -C bin/sec-linux-amd64 -f dist/sec-linux-amd64.tar.gz -cz .
tar -C bin/sec-darwin-amd64 -f dist/sec-darwin-amd64.tar.gz -cz .
ghr -u fd -r sec-utils -c $WERCKER_GIT_COMMIT --replace --prerelease "v$VERSION" ./dist
else
VERSION="$(v5n store bump sec final+patch)"
v5n apply --commit $WERCKER_GIT_COMMIT --author "Simon Menke" bin/sec-linux-amd64/sec "$VERSION"
v5n apply --commit $WERCKER_GIT_COMMIT --author "Simon Menke" bin/sec-darwin-amd64/sec "$VERSION"
tar -C bin/sec-linux-amd64 -f dist/sec-linux-amd64.tar.gz -cz .
tar -C bin/sec-darwin-amd64 -f dist/sec-darwin-amd64.tar.gz -cz .
ghr -u fd -r sec-utils -c $WERCKER_GIT_COMMIT --replace "v$VERSION" ./dist
fi
- mbrevda/[email protected]:
token: $WRK_TOKEN
application_id: $WRK_APP
message: Triggered from sec