forked from vmware-archive/cfops
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wercker.yml
126 lines (109 loc) · 3.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
box: golang
build:
# The steps that will be executed on build
steps:
# Sets the go workspace and places you package
# at the right place in the workspace tree
- setup-go-workspace
# Get the dependencies
- script:
name: go get
code: |
export GO15VENDOREXPERIMENT=1
cd $WERCKER_SOURCE_DIR
go version
go get github.com/Masterminds/glide
export PATH=$WERCKER_SOURCE_DIR/bin:$PATH
glide install
- script:
name: setup ssh for integration tests
code: |
sudo apt-get update
sudo apt-get install -y openssh-server
service ssh start
# Test the project
- script:
name: go test
code: |
mkdir -p /var/vcap/store
go test $(glide novendor | grep -v system) -v -race
# Setting the coverage watermark low.
# This should be raised as we gain more coverage...
# Test coverage for the project
- script:
name: go test cover
code: |
./testCoverage $(glide novendor) $COVERAGE_WATERMARK
# lets make sure we can build
# the main executable (later we can cross compile and upload)
- script:
name: go smoke build
code: |
(cd cmd/cfops && go build)
- script:
name: add repo to artifact
code: |
cp -R ./ ${WERCKER_OUTPUT_DIR}
- script:
name: set release id variable and version
code: |
go get github.com/xchapter7x/versioning
export NEXT_VERSION=`versioning bump_patch`
echo "next version should be: ${NEXT_VERSION}"
- script:
name: cross platform release
code: |
(cd cmd/cfops/ && GOOS=linux GOARCH=amd64 go build -ldflags "-X main.VERSION=${NEXT_VERSION}" && mkdir -p ${WERCKER_OUTPUT_DIR}/${BUILD_DIR}/linux64 && cp cfops ${WERCKER_OUTPUT_DIR}/cfops_linux64)
deploy:
steps:
- script:
name: install-packages
code: |
sudo apt-get install -y openssh-client wget
ls -la
pwd
echo ${WERCKER_OUTPUT_DIR}
ls -la ${WERCKER_OUTPUT_DIR}
- wercker/[email protected]:
keyname: PCF_GITHUB_KEY
- wercker/[email protected]:
hostname: github.com
fingerprint: 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48
- script:
name: set release id variable for version
code: |
go get github.com/xchapter7x/versioning
export WERCKER_GITHUB_CREATE_RELEASE_ID=`versioning bump_patch`
- xchapter7x/flowy-release:
action: "get-latest"
tag_variable_name: "VERSION_TAG"
git_name: $GITFLOW_NAME
git_email: $GITFLOW_EMAIL
- xchapter7x/flowy-release:
action: "complete-release"
active: $GITFLOW_ACTIVE
git_name: $GITFLOW_NAME
git_email: $GITFLOW_EMAIL
#this is a workaround for the flowy-release not resetting
#its branch state...
- script:
name: reset git to proper commit
code: |
git checkout -fq ${WERCKER_GIT_COMMIT}
git submodule update --init --recursive
- github-create-release:
token: $GITHUB_TOKEN
tag: $WERCKER_GITHUB_CREATE_RELEASE_ID
title: CFOPS $WERCKER_GITHUB_CREATE_RELEASE_ID
draft: $RELEASE_DRAFT
- github-upload-asset:
token: $GITHUB_TOKEN
file: cfops_linux64
release_id: $WERCKER_GITHUB_CREATE_RELEASE_ID
content-type: application/octet-stream
- s3sync:
key-id: $S3_KEY
key-secret: $S3_SECRET
bucket-url: ${S3_BUCKET}/${S3_FOLDER}/linux64/${VERSION_TAG}/
source-dir: ./${BUILD_DIR}/linux64
delete-removed: false