forked from bsteciuk/kismatic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
107 lines (105 loc) · 3.85 KB
/
circle.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
version: 2
defaults: &defaults
working_directory: /go/src/github.com/apprenda/kismatic
docker:
- image: circleci/golang:1.9.4
jobs:
build:
<<: *defaults
steps:
- checkout
- run:
name: Install glide packages
command: make vendor && make glide-install-host
- run:
name: Unit tests
command: make TEST_OPTS="-v" test-host
- run:
name: Verify gofmt
command: diff -u <(echo -n) <(gofmt -d ./pkg ./cmd)
- run:
name: Verify reference documentation is up to date
command: diff -u <(cat docs/plan-file-reference.md) <(make docs/generate-plan-file-reference.md)
- run:
name: Create release directory # Used for releasing to GH
command: mkdir release
- run:
name: Darwin, Linux dists
command: make all-host
- run:
name: Darwin tarball
command: GOOS=darwin make tarball
- run:
name: Linux tarball
command: GOOS=linux make tarball
- store_artifacts:
path: kismatic-darwin.tar.gz
destination: kismatic-darwin-amd64.tar.gz
- run:
name: Copy darwin pkg to release dir
command: mv kismatic-darwin.tar.gz release/kismatic-${CIRCLE_TAG}-darwin-amd64.tar.gz
- store_artifacts:
path: kismatic-linux.tar.gz
destination: kismatic-linux-amd64.tar.gz
- run:
name: Copy linux pkg to release dir # Used for releasing to GH
command: cp kismatic-linux.tar.gz release/kismatic-${CIRCLE_TAG}-linux-amd64.tar.gz
- run:
name: Set integration test SSH Key
command: echo "$KISMATIC_INT_TEST_KEY" | base64 -d > ~/.ssh/kismatic-integration-testing.pem
- run:
name: Set permissions on SSH key
command: chmod 0600 ~/.ssh/kismatic-integration-testing.pem
- run:
name: Focused tests
command: |
if [[ -n "$FOCUS" ]]
then
make focus-integration-test-host
fi
no_output_timeout: 30m
environment:
GINKGO_OPTS: "-nodes=32 --flakeAttempts=2"
ANSIBLE_SSH_CONTROL_PATH: "/tmp/ssh-%%r-%%h-%%p"
ANSIBLE_SSH_ARGS: "-o ControlMaster=auto -o ControlPersist=1800s -o ControlPath=/tmp/ssh-%r-%h-%p"
- run:
name: Integration tests
command: |
if [[ -z "$FOCUS" ]]
then
make integration-test-host
fi
no_output_timeout: 30m
environment:
GINKGO_OPTS: "-nodes=32 --flakeAttempts=2"
ANSIBLE_SSH_CONTROL_PATH: "/tmp/ssh-%%r-%%h-%%p"
ANSIBLE_SSH_ARGS: "-o ControlMaster=auto -o ControlPersist=1800s -o ControlPath=/tmp/ssh-%r-%h-%p"
- run:
name: Slow integration tests
command: |
if [[ -n "$CIRCLE_TAG" || -n "$RUN_SLOW_TESTS" ]]
then
make slow-integration-test-host
fi
no_output_timeout: 90m
environment:
GINKGO_OPTS: "-nodes=32 --flakeAttempts=2"
ANSIBLE_SSH_CONTROL_PATH: "/tmp/ssh-%%r-%%h-%%p"
ANSIBLE_SSH_ARGS: "-o ControlMaster=auto -o ControlPersist=1800s -o ControlPath=/tmp/ssh-%r-%h-%p"
- store_test_results:
path: /tmp/ket-junit-results
- run:
name: Create draft release on GitHub
command: |
if [[ -n "$CIRCLE_TAG" ]]
then
apt-get update && apt-get install -y unzip
wget https://github.com/tcnksm/ghr/releases/download/v0.5.4/ghr_v0.5.4_linux_amd64.zip
unzip ghr_v0.5.4_linux_amd64.zip
./ghr -draft -u "$CIRCLE_PROJECT_USERNAME" "${CIRCLE_TAG}-draft" release/
fi
deployment:
fake_deploy_for_cci2:
tag: /.*/
commands:
- echo "make tags run in 2.0"