-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwercker.yml
57 lines (57 loc) · 1.85 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
box: golang:1.6.2
build:
steps:
- script:
name: setup env
code: |
export GOPATH="/go" && \
export PACKAGE="github.com/stepanstipl/confpress" && \
mkdir -p "${GOPATH}/src/github.com/stepanstipl" && \
ln -s "${WERCKER_SOURCE_DIR}" "${GOPATH}/src/${PACKAGE}"
- script:
name: install glide
code: |
wget -O- https://github.com/Masterminds/glide/releases/download/0.10.2/glide-0.10.2-linux-amd64.tar.gz | tar -xvzO linux-amd64/glide > /usr/local/bin/glide && \
chmod +x /usr/local/bin/glide
- script:
name: install dependencies
code: glide install
cwd: "${GOPATH}/src/${PACKAGE}"
- script:
name: go build
code: |
CGO_ENABLED=0 go build -a -ldflags '-s' -v $PACKAGE
cwd: "${GOPATH}/src/${PACKAGE}"
- script:
name: go test
code: |
go test
cwd: "${GOPATH}/src/${PACKAGE}"
- script:
name: create confpress binary archive
code: |
tar zcvf "${WERCKER_OUTPUT_DIR}/confpress-linux-amd64.tar.gz" confpress
- script:
name: output release tag
code: |
git describe --tags --exact --match '*.*.*' | tee "${WERCKER_OUTPUT_DIR}/.release_tag" || true
- script:
name: wercker debug
code: |
ls -al $WERCKER_OUTPUT_DIR
push-github:
steps:
- script:
name: restore release tag
code: |
echo $WERCKER_ROOT && \
ls -al $WERCKER_ROOT && \
export MY_RELEASE_TAG=$(cat $WERCKER_ROOT/.release_tag) && \
echo "Release tag: ${MY_RELEASE_TAG}"
- github-create-release:
token: $GITHUB_TOKEN
tag: $MY_RELEASE_TAG
- github-upload-asset:
token: $GITHUB_TOKEN
file: confpress-linux-amd64.tar.gz
content_type: application/x-gzip