Skip to content

Commit 43e92b0

Browse files
authored
Added docker component pusher (#7)
1 parent b33b502 commit 43e92b0

File tree

3 files changed

+114
-17
lines changed

3 files changed

+114
-17
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 3.1.1 (March 15, 2022)
2+
* Added component pusher build script
3+
14
## 3.1.0 (March 3, 2022)
25
* Added `Emit Batch` behavior for `Read CSV attachment` action
36

circle.yml

Lines changed: 110 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,122 @@
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/node@5.0.0
8+
slack: circleci/slack@4.5.3
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+
}
272
jobs:
373
test:
474
docker:
575
- image: circleci/node:14-stretch
676
steps:
777
- checkout
8-
- restore_cache:
9-
key: dependency-cache-{{ checksum "package.json" }}
10-
- run:
11-
name: Installing Dependencies
12-
command: npm install
13-
- save_cache:
14-
key: dependency-cache-{{ checksum "package.json" }}
15-
paths:
16-
- node_modules
78+
- node/install:
79+
node-version: << pipeline.parameters.node-version >>
80+
- node/install-packages:
81+
cache-path: ./node_modules
82+
override-ci-command: npm install
1783
- run:
1884
name: Running Mocha Tests
1985
command: npm test
86+
build:
87+
docker:
88+
- image: circleci/node:14-stretch
89+
user: root
90+
steps:
91+
- checkout
92+
- node/install:
93+
node-version: << pipeline.parameters.node-version >>
94+
- setup_remote_docker:
95+
version: 19.03.13
96+
docker_layer_caching: true
97+
# build and push Docker image
98+
- run:
99+
name: Install component-build-helper lib
100+
command: npm install -g @elastic.io/component-build-helper
20101
- run:
21-
name: Audit Dependencies
22-
command: npm audit --audit-level=critical
102+
name: Build and publish docker image
103+
command: build_component_docker
104+
- notify_on_failure
105+
- notify_on_pass
23106
workflows:
24-
version: 2
25-
build_and_test:
107+
test:
108+
jobs:
109+
- test:
110+
name: "Running tests"
111+
filters:
112+
tags:
113+
ignore: /.*/
114+
publish_release:
26115
jobs:
27-
- test
116+
- build:
117+
name: "Build and publish docker image"
118+
filters:
119+
branches:
120+
ignore: /.*/
121+
tags:
122+
only: /^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$/

component.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
"title": "CSV",
33
"description": "A comma-separated values (CSV) file stores tabular data (numbers and text) in plain-text form",
44
"docsUrl": "https://github.com/elasticio/csv-component",
5-
"buildType": "docker",
6-
"version": "3.1.0",
5+
"version": "3.1.1",
76
"actions": {
87
"read_action": {
98
"main": "./lib/actions/read.js",

0 commit comments

Comments
 (0)