forked from bitrise-io/envman
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbitrise.yml
97 lines (79 loc) · 2.72 KB
/
bitrise.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
format_version: "5"
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: other
app:
envs:
- BIN_NAME: envman
workflows:
test:
title: Runs tests
steps:
- go-list:
- golint:
- errcheck:
- go-test:
- codecov:
run_if: .IsCI
inputs:
- other_options: -f ${GO_CODE_COVERAGE_REPORT_PATH}
- CODECOV_TOKEN: "$CODECOV_UPLOAD_TOKEN"
- script:
title: Run integration tests
inputs:
- content: |-
#!/usr/bin/env bash
set -ex
current_envman="$(pwd)/_tmp/test_envman"
go build -o "$current_envman"
export PR="" PULL_REQUEST_ID=""
export INTEGRATION_TEST_BINARY_PATH="$current_envman"
go test -v ./_tests/integration/...
create-binaries:
title: Create binaries
steps:
- script:
title: Create binaries
inputs:
- content: |
#!/bin/bash
set -ex
echo
echo "Create final binaries"
echo " Build number: $BITRISE_BUILD_NUMBER"
export ARCH=x86_64
export GOARCH=amd64
# Create Darwin bin
export OS=Darwin
export GOOS=darwin
DEPLOY_PATH="_bin/$BIN_NAME-$OS-$ARCH"
echo " Create final Darwin binary at: $DEPLOY_PATH"
version_package="github.com/bitrise-io/envman/version"
go build \
-ldflags "-X $version_package.BuildNumber=$BITRISE_BUILD_NUMBER -X $version_package.Commit=$GIT_CLONE_COMMIT_HASH" \
-o "$DEPLOY_PATH"
envman add --key OSX_DEPLOY_PATH --value $DEPLOY_PATH
cp $DEPLOY_PATH $BITRISE_DEPLOY_DIR/$BIN_NAME-$OS-$ARCH
echo " Copy final Darwin binary to: $BITRISE_DEPLOY_DIR/$BIN_NAME-$OS-$ARCH"
# Create Linux binary
export OS=Linux
export GOOS=linux
DEPLOY_PATH="_bin/$BIN_NAME-$OS-$ARCH"
echo " Create final Linux binary at: $DEPLOY_PATH"
go build \
-ldflags "-X $version_package.BuildNumber=$BITRISE_BUILD_NUMBER -X $version_package.Commit=$GIT_CLONE_COMMIT_HASH" \
-o "$DEPLOY_PATH"
envman add --key LINUX_DEPLOY_PATH --value $DEPLOY_PATH
cp $DEPLOY_PATH $BITRISE_DEPLOY_DIR/$BIN_NAME-$OS-$ARCH
echo " Copy final Linux binary to: $BITRISE_DEPLOY_DIR/$BIN_NAME-$OS-$ARCH"
dep-update:
title: Dep update
steps:
- script:
title: Dependency update
inputs:
- content: |-
#!/bin/bash
set -ex
go get -u -v github.com/golang/dep/cmd/dep
dep ensure -v
dep ensure -v -update