forked from cloudwan/gohan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wercker.yml
75 lines (73 loc) · 2.6 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
box:
id: nati/gohan_builder
entrypoint: /bin/bash -c
build:
steps:
- script:
name: go env setup
code: |
export GOPATH=/go
export PATH=/go/bin:$PATH
export GOSRC=$GOPATH/src
export REPO_PATH=$GOSRC/github.com/cloudwan
mkdir -p $REPO_PATH
ln -s /pipeline/source $REPO_PATH/gohan
go get github.com/mattn/goveralls
make deps
- script:
name: make
code: |
set -xe
sudo apt-get update
sudo apt-get install curl gawk -y
export CIRCLE_PR_NUMBER=`curl https://app.wercker.com/api/v3/builds/$WERCKER_BUILD_ID | gawk 'match($0, /Pull request \#([0-9]+)/, a){print a[1]}'`
echo $CIRCLE_PR_NUMBER
echo $REPO_PATH
cd $REPO_PATH/gohan
make
GIT_BRANCH=$WERCKER_GIT_BRANCH goveralls -coverprofile=profile.cov -service=wercker.com -repotoken=${COVERALLS_TOKEN}
deploy:
steps:
- script:
name: build docs
code: |
sudo apt-get update
sudo apt-get install -y python-sphinx python-pip
sudo pip install sphinx_rtd_theme
cd ${WERCKER_SOURCE_DIR}/docs/
make html
touch build/html/.nojekyll
- script:
name: cross compile
code: |
export PATH=/go/bin:$PATH
cd /
FLAG_LDFLAGS="-X main.BuildVersion=$WERCKER_GIT_COMMIT" TARGETS="linux/amd64 linux/386 darwin/amd64 darwin/386 windows/386" ./build.sh github.com/cloudwan/gohan
- script:
name: zip
code: |
cd /build
mkdir -p ${WERCKER_OUTPUT_DIR}
for binary in $(ls); do
canonical_name=$(echo ${binary} | sed -e 's/-[a-zA-Z0-9-]*//')
cp ${binary} ${canonical_name}
archive_name=$(echo ${binary} | sed -e 's/.exe$//').zip
zip -r ${WERCKER_OUTPUT_DIR}/${archive_name} ${canonical_name}
done
- tcnksm/ghr:
token: $GITHUB_TOKEN
input: ${WERCKER_OUTPUT_DIR}
replace: true
- lukevivier/[email protected]:
token: $GITHUB_TOKEN
domain: cloudwan.github.io
basedir: ${WERCKER_SOURCE_DIR}/docs/build/html
- script:
name: trigger ansible-gohan build
code: |
sudo apt-get install -y curl
curl -H 'Content-Type: application/json' \
-H "Authorization: Bearer ${WERCKER_TOKEN}" \
-X POST \
-d '{"applicationId": "'${ANSIBLE_GOHAN_APP_ID}'", "message":"build triggered from gohan repo"}' \
https://app.wercker.com/api/v3/builds