Skip to content

Commit 03975b7

Browse files
authored
CI/CD (#80)
* circle ci build docker
1 parent ba59a3b commit 03975b7

File tree

1 file changed

+109
-4
lines changed

1 file changed

+109
-4
lines changed

.circleci/config.yml

Lines changed: 109 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,76 @@
1-
version: 2
1+
version: 2.1
2+
parameters:
3+
node-version:
4+
type: string
5+
default: "16.13.2"
6+
orbs:
7+
node: circleci/[email protected]
8+
slack: circleci/[email protected]
9+
commands:
10+
notify_on_failure:
11+
steps:
12+
- slack/notify:
13+
event: fail
14+
custom: |
15+
{
16+
"blocks": [
17+
{
18+
"type": "section",
19+
"fields": [
20+
{
21+
"type": "mrkdwn",
22+
"text": ":red_circle: *$CIRCLE_PROJECT_REPONAME*:*$CIRCLE_TAG* build failed"
23+
}
24+
]
25+
},
26+
{
27+
"type": "actions",
28+
"elements": [
29+
{
30+
"type": "button",
31+
"text": {
32+
"type": "plain_text",
33+
"text": "View Job"
34+
},
35+
"url": "${CIRCLE_BUILD_URL}"
36+
}
37+
]
38+
}
39+
]
40+
}
41+
notify_on_pass:
42+
steps:
43+
- slack/notify:
44+
event: pass
45+
custom: |
46+
{
47+
"blocks": [
48+
{
49+
"type": "section",
50+
"fields": [
51+
{
52+
"type": "mrkdwn",
53+
"text": ":tada: *$CIRCLE_PROJECT_REPONAME*:*$CIRCLE_TAG* was successfully built and published"
54+
}
55+
]
56+
},
57+
{
58+
"type": "actions",
59+
"elements": [
60+
{
61+
"type": "button",
62+
"text": {
63+
"type": "plain_text",
64+
"text": "View Job"
65+
},
66+
"url": "${CIRCLE_BUILD_URL}"
67+
}
68+
]
69+
}
70+
]
71+
}
72+
73+
openjdk-install: cloudesire/[email protected]
274
jobs:
375
test:
476
docker:
@@ -20,8 +92,41 @@ jobs:
2092
- run:
2193
name: Run Integration Tests
2294
command: ./gradlew integrationTest --daemon --stacktrace
95+
build:
96+
docker:
97+
- image: cimg/base:stable
98+
user: root
99+
steps:
100+
- checkout
101+
- node/install:
102+
node-version: << pipeline.parameters.node-version >>
103+
- setup_remote_docker:
104+
version: 19.03.13
105+
docker_layer_caching: true
106+
# build and push Docker image
107+
- run:
108+
name: Install component-build-helper lib
109+
command: npm install -g @elastic.io/component-build-helper
110+
- run:
111+
name: Build and publish docker image
112+
command: build_component_docker
113+
- notify_on_failure
114+
- notify_on_pass
115+
23116
workflows:
24-
version: 2
25-
build_and_test:
117+
test:
118+
jobs:
119+
- test:
120+
name: "Running tests"
121+
filters:
122+
tags:
123+
ignore: /.*/
124+
publish_release:
26125
jobs:
27-
- test
126+
- build:
127+
name: "Build and publish docker image"
128+
filters:
129+
branches:
130+
ignore: /.*/
131+
tags:
132+
only: /^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$/

0 commit comments

Comments
 (0)