forked from vmware-archive/cfops
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwercker.yml
More file actions
122 lines (104 loc) · 3.84 KB
/
wercker.yml
File metadata and controls
122 lines (104 loc) · 3.84 KB
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
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: |
cd $WERCKER_SOURCE_DIR
go version
go get -u github.com/tools/godep
export PATH=$WERCKER_SOURCE_DIR/bin:$PATH
# Test the project
- script:
name: go test
code: |
godep go test ./... -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 ./... $COVERAGE_WATERMARK
# lets make sure we can build
# the main executable (later we can cross compile and upload)
- script:
name: go smoke build
code: |
godep go build ./cmd/cfops/*.go
- 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 godep go build -ldflags "-X main.VERSION=${NEXT_VERSION}" && mkdir -p ${WERCKER_OUTPUT_DIR}/${BUILD_DIR}/linux64 && mv cfops ${WERCKER_OUTPUT_DIR}/${BUILD_DIR}/linux64)
(cd cmd/cfops/ && GOOS=darwin GOARCH=amd64 godep go build -ldflags "-X main.VERSION=${NEXT_VERSION}" && mkdir -p ${WERCKER_OUTPUT_DIR}/${BUILD_DIR}/osx && mv cfops ${WERCKER_OUTPUT_DIR}/${BUILD_DIR}/osx)
(cd cmd/cfops/ && GOOS=windows GOARCH=amd64 godep go build -ldflags "-X main.VERSION=${NEXT_VERSION}" && mkdir -p ${WERCKER_OUTPUT_DIR}/${BUILD_DIR}/win64 && mv cfops.exe ${WERCKER_OUTPUT_DIR}/${BUILD_DIR}/win64)
- script:
name: create tarball
code: |
tar -cvzf cfops_binaries.tgz ${WERCKER_OUTPUT_DIR}/${BUILD_DIR}/
- script:
name: add repo to artifact
code: |
cp -R ./ ${WERCKER_OUTPUT_DIR}
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/add-ssh-key@1.0.2:
keyname: PCF_GITHUB_KEY
- wercker/add-to-known_hosts@1.4.0:
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_binaries.tgz
release_id: $WERCKER_GITHUB_CREATE_RELEASE_ID
content-type: application/x-gzip