This repository has been archived by the owner on Jul 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
/
config.yml
227 lines (217 loc) · 6.82 KB
/
config.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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
version: 2.1
commands:
early_return_for_forked_pull_requests:
description: >-
If this build is from a fork, stop executing the current job and return success.
This is useful to avoid steps that will fail due to missing credentials.
steps:
- run:
name: Early return if this build is from a forked PR
command: |
if [ -n "$CIRCLE_PR_NUMBER" ]; then
echo "Nothing to do for forked PRs, so marking this step successful"
circleci step halt
fi
jobs:
checkout_code:
docker:
- image: circleci/clojure:lein-2.8.3
working_directory: ~/build
steps:
- checkout
- save_cache:
key: v1-repo-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/build
bundle_dependencies:
docker:
- image: circleci/clojure:lein-2.8.3-node
working_directory: ~/build
steps:
- restore_cache:
keys:
- v1-repo-{{ .Environment.CIRCLE_SHA1 }}
- v1-dependencies-{{ checksum "project.clj" }}
- v1-node-dependencies-{{ checksum "package.json" }}
- run: lein deps
- run: npm install
- save_cache:
key: v1-dependencies-{{ checksum "project.clj" }}
paths:
- ~/.m2
- save_cache:
key: v1-node-dependencies-{{ checksum "package.json" }}
paths:
- ~/node_modules
verify_license_headers:
docker:
- image: circleci/clojure:lein-2.8.3
working_directory: ~/build
steps:
- restore_cache:
keys:
- v1-repo-{{ .Environment.CIRCLE_SHA1 }}
- v1-dependencies-{{ checksum "project.clj" }}
- run: ./.circleci/scripts/verify-license-headers.sh "clj" "^;; Copyright 2015-[0-9]{4} Workiva Inc.$" project.clj profiles.clj
- run: ./.circleci/scripts/verify-license-headers.sh "java" "^// Copyright 2015-[0-9]{4} Workiva Inc.$"
verify_docs:
docker:
- image: circleci/clojure:lein-2.8.3-node
working_directory: ~/build
steps:
- restore_cache:
keys:
- v1-repo-{{ .Environment.CIRCLE_SHA1 }}
- v1-dependencies-{{ checksum "project.clj" }}
- v1-node-dependencies-{{ checksum "package.json" }}
# Verify Docs
- run: ./.circleci/scripts/verify-docs.sh
- run: cd ./docs/api && tar cvfz "../../eva-api-docs.tgz" ./
- run: mkdir -p ./artifacts/docs
- run: mv ./eva-api-docs.tgz ./artifacts/docs/
- store_artifacts:
path: ./artifacts
unit_tests:
docker:
- image: circleci/clojure:lein-2.8.3
working_directory: ~/build
steps:
- restore_cache:
keys:
- v1-repo-{{ .Environment.CIRCLE_SHA1 }}
- v1-dependencies-{{ checksum "project.clj" }}
- run: lein with-profile aot,-dynamodb-local test
build_transactor:
docker:
- image: circleci/clojure:lein-2.8.3
working_directory: ~/build
steps:
- restore_cache:
keys:
- v1-repo-{{ .Environment.CIRCLE_SHA1 }}
- v1-dependencies-{{ checksum "project.clj" }}
- run: LEIN_SNAPSHOTS_IN_RELEASE=true lein with-profile deployment uberjar
- run: cp ./target/transactor.jar /tmp/transactor.jar
- store_artifacts:
path: ./target/transactor.jar
- persist_to_workspace:
root: /tmp
paths:
- transactor.jar
verify_workiva_ci:
docker:
- image: circleci/clojure:lein-2.8.3
working_directory: ~/build
steps:
- restore_cache:
keys:
- v1-repo-{{ .Environment.CIRCLE_SHA1 }}
- setup_remote_docker:
docker_layer_caching: false
- run: ./.circleci/scripts/verify-dockerfile.sh
# Verify that internal CI system will not fail after a merged PR
build_and_push_docker_image:
docker:
- image: circleci/clojure:lein-2.8.3
working_directory: ~/build
steps:
- restore_cache:
keys:
- v1-repo-{{ .Environment.CIRCLE_SHA1 }}
- setup_remote_docker:
docker_layer_caching: false
- attach_workspace:
at: /tmp/workspace
- run: mkdir -p ./target/
- run: mv /tmp/workspace/transactor.jar ./target/transactor.jar
- run: docker build -f transactor.Dockerfile -t workivadocker/eva:latest-release -t workivadocker/eva:$CIRCLE_TAG .
- run: docker login -u $DOCKERHUB_USER -p $DOCKERHUB_PASS
- run: docker push workivadocker/eva:latest-release
- run: docker push workivadocker/eva:$CIRCLE_TAG
deploy_clojars:
docker:
- image: circleci/clojure:lein-2.8.3
working_directory: ~/build
steps:
- early_return_for_forked_pull_requests
- restore_cache:
keys:
- v1-repo-{{ .Environment.CIRCLE_SHA1 }}
- v1-dependencies-{{ checksum "project.clj" }}
- run: mkdir -p ~/.lein
- run: cp ./.circleci/clojars/profiles.clj ~/.lein/profiles.clj
- run: LEIN_SNAPSHOTS_IN_RELEASE=true lein deploy clojars
workflows:
eva_workflow:
jobs:
- checkout_code:
filters:
tags:
only: /.*/
branches:
ignore: /[0-9a-f]{7}_cr_no_smithy/
- bundle_dependencies:
requires:
- checkout_code
filters:
tags:
only: /.*/
- verify_workiva_ci:
requires:
- checkout_code
filters:
tags:
only: /.*/
- verify_license_headers:
requires:
- bundle_dependencies
- checkout_code
filters:
tags:
only: /.*/
- verify_docs:
requires:
- bundle_dependencies
- checkout_code
filters:
tags:
only: /.*/
- unit_tests:
requires:
- bundle_dependencies
- checkout_code
filters:
tags:
only: /.*/
- build_transactor:
requires:
- unit_tests
filters:
tags:
only: /.*/
- build_and_push_docker_image:
context: DockerHub
requires:
- verify_workiva_ci
- verify_license_headers
- build_transactor
# Only run on tagged builds starting with 'v'
# Therefore, releases MUST start with 'v'
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
- deploy_clojars:
context: Clojars
requires:
- verify_workiva_ci
- verify_license_headers
- build_transactor
# Only run on tagged builds starting with 'v'
# Therefore, releases MUST start with 'v'
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/