-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwercker.yml
86 lines (86 loc) · 2.48 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
box: tcnksm/gox
dev:
steps:
- internal/watch:
code: |
COMMITID=$(git show -s --format=%h)
go build -ldflags "-X github.com/manabu/dockerlayer/config.CommitID ${COMMITID}" ./...
./source
reload: true
build:
steps:
- setup-go-workspace
- script:
name: show environments
code: |
git version
go version
- script:
name: go get
code: |
go get -t ./...
- script:
name: go test
code: |
go test -v ./...
deploy:
steps:
- setup-go-workspace
- script:
name: install tools
code: |
apt-get update
apt-get install -y zip
curl -L http://stedolan.github.io/jq/download/linux64/jq -o /usr/local/bin/jq
chmod +x /usr/local/bin/jq
go get github.com/motemen/gobump/cmd/gobump
go get github.com/inconshreveable/mousetrap
go get -d github.com/Microsoft/go-winio
- script:
name: get version from gobump
code: |
export REPLACEFLAG=true
export RELEASE_TAG=$(gobump show | jq -r .version)
if [[ "$RELEASE_TAG" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
export REPLACEFLAG=false
fi
- motemen/gobump-github-pull-request:
github_token: $GITHUB_TOKEN
label_pattern_major: ^(major|breaking)$
label_pattern_minor: ^(minor|feature)$
- script:
name: get git commit ID
code: |
export COMMITID=$(git show -s --format=%h)
- script:
name: go get
code: |
go get ./...
- wercker/gox:
os: darwin linux windows
arch: 386 amd64
output: '{{.Dir}}_{{.OS}}_{{.Arch}}/{{.Dir}}'
ldflags: "-X github.com/manabu/dockerlayer/config.CommitID=$COMMITID"
dest: $WERCKER_OUTPUT_DIR/pkg
- script:
name: include assets into artifacts
code: |
for dir in $WERCKER_OUTPUT_DIR/pkg/*; do
if [ -d "$dir" ]; then
cp dockerlayer.txt "$dir/README.txt"
fi
done
- tcnksm/zip:
input: $WERCKER_OUTPUT_DIR/pkg
output: $WERCKER_OUTPUT_DIR/dist
- script:
name: set release tag
code: |
if [ -n "$GOBUMP_NEW_VERSION" ]; then
export RELEASE_TAG="$GOBUMP_NEW_VERSION"
fi
- tcnksm/ghr:
token: $GITHUB_TOKEN
input: $WERCKER_OUTPUT_DIR/dist
replace: $REPLACEFLAG
version: $RELEASE_TAG