This repository has been archived by the owner on Aug 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pipeline.yml
82 lines (76 loc) · 2.46 KB
/
.pipeline.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
jobs:
- name: Test, build and release
plan:
- get: git
trigger: true
- config:
container_limits: {}
image_resource:
source:
repository: golang
tag: 1.11-stretch
type: docker-image
inputs:
- name: git
outputs:
- name: artifacts
platform: linux
run:
args:
- -ec
- |
export CONCOURSE_ROOT=$PWD
export ARTIFACTS=$PWD/artifacts
cd git
echo go test
go test -cover ./...
echo
echo Integration Test
TMPDIR=`mktemp -d`
export PATH=$PATH:$TMPDIR
CF_TAR_URL="https://packages.cloudfoundry.org/stable?release=linux64-binary&version=6.35.0&source=github-rel"
PLUGIN_BIN_PATH=${TMPDIR}/plugin
wget -qO- ${CF_TAR_URL} | tar xvz -C $TMPDIR > /dev/null
# Compile the plugin
go build -o ${PLUGIN_BIN_PATH} cmd/plugin.go > /dev/null
CF_HOME=${TMPDIR} cf install-plugin ${PLUGIN_BIN_PATH} -f
echo
echo Building plugin for all platforms
CGO_ENABLED=0 GOARCH=amd64 GOOS=darwin go build -ldflags "-X github.com/springernature/halfpipe-cf-plugin/config.SHA=`cat .git/ref`" -o $ARTIFACTS/halfpipe_cf_plugin_darwin cmd/plugin.go
CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -ldflags "-X github.com/springernature/halfpipe-cf-plugin/config.SHA=`cat .git/ref`" -o $ARTIFACTS/halfpipe_cf_plugin_linux cmd/plugin.go
CGO_ENABLED=0 GOARCH=amd64 GOOS=windows go build -ldflags "-X github.com/springernature/halfpipe-cf-plugin/config.SHA=`cat .git/ref`" -o $ARTIFACTS/halfpipe_cf_plugin_windows.exe cmd/plugin.go
path: /bin/sh
task: Test and build
- params:
bump: minor
put: version
- params:
globs:
- artifacts/halfpipe_cf_plugin_*
name: git/.name
tag: version/version
put: release
serial: true
resources:
- name: git
source:
private_key: ((halfpipe-github.private_key))
uri: [email protected]:springernature/halfpipe-cf-plugin.git
type: git
check_every: 24h
- name: release
source:
access_token: ((api-keys.halfpipe-cli))
owner: springernature
repository: halfpipe-cf-plugin
type: github-release
check_every: 24h
- name: version
source:
branch: version
driver: git
file: version
private_key: ((halfpipe-github.private_key))
uri: [email protected]:springernature/halfpipe-cf-plugin.git
type: semver
check_every: 24h