Skip to content

Commit

Permalink
Merge pull request #50 from elasticio/sailor-update
Browse files Browse the repository at this point in the history
update
  • Loading branch information
olegosh authored May 4, 2022
2 parents c7d4918 + b25f606 commit a485557
Show file tree
Hide file tree
Showing 8 changed files with 2,568 additions and 9,485 deletions.
10 changes: 0 additions & 10 deletions .circleci/build_slug.sh

This file was deleted.

132 changes: 116 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,125 @@
version: 2
version: 2.1
parameters:
node-version:
type: string
default: "16.13.2"
orbs:
node: circleci/[email protected]
slack: circleci/[email protected]
commands:
notify_on_failure:
steps:
- slack/notify:
event: fail
custom: |
{
"blocks": [
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": ":red_circle: *$CIRCLE_PROJECT_REPONAME*:*$CIRCLE_TAG* build failed"
}
]
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": "View Job"
},
"url": "${CIRCLE_BUILD_URL}"
}
]
}
]
}
notify_on_pass:
steps:
- slack/notify:
event: pass
custom: |
{
"blocks": [
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": ":tada: *$CIRCLE_PROJECT_REPONAME*:*$CIRCLE_TAG* was successfully built and published"
}
]
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": "View Job"
},
"url": "${CIRCLE_BUILD_URL}"
}
]
}
]
}
jobs:
test:
docker:
- image: circleci/node:12-stretch
docker: # run the steps with Docker
- image: cimg/base:stable
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- node/install:
node-version: << pipeline.parameters.node-version >>
- node/install-packages:
cache-path: ./node_modules
override-ci-command: npm install
- run:
name: Installing Dependencies
command: npm install
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
paths:
- node_modules
name: Audit Dependencies
command: npm audit --production --audit-level=high
- run:
name: Running Mocha Integration Tests
name: test
command: npm test

build:
docker:
- image: cimg/base:stable
user: root
steps:
- checkout
- node/install:
node-version: << pipeline.parameters.node-version >>
- setup_remote_docker:
version: 19.03.13
docker_layer_caching: true
# build and push Docker image
- run:
name: Install component-build-helper lib
command: npm install -g @elastic.io/component-build-helper
- run:
name: Build and publish docker image
command: build_component_docker
- notify_on_failure
- notify_on_pass
workflows:
version: 2
build_and_test:
test:
jobs:
- test:
name: "Running tests"
filters:
tags:
ignore: /.*/
publish_release:
jobs:
- test
- build:
name: "Build and publish docker image"
filters:
branches:
ignore: /.*/
tags:
only: /^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$/
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 1.3.5 (April 13, 2022)

* Update Sailor version to 2.6.27
* Get rid of vulnerabilities in dependencies
* Add component pusher job to Circle.ci config
* Update component-commons-library version to 2.0.2

## 1.3.4 (February 12, 2021)

* Update sailor version to 2.6.24
Expand Down
1 change: 1 addition & 0 deletions component.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"title": "XML",
"version": "1.3.5",
"description": "Component to convert between XML and JSON data",
"buildType": "docker",
"actions": {
Expand Down
5 changes: 3 additions & 2 deletions lib/actions/jsonToXml.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ module.exports.process = async function process(msg, cfg) {
this.logger.info(`Will create XML attachment of size ${attachmentSize} byte(s)`);

const attachmentProcessor = new AttachmentProcessor();
const uploadResult = await attachmentProcessor.uploadAttachment(xmlString);
const attachmentUrl = uploadResult.config.url;
const uploadResult = await attachmentProcessor.uploadAttachment(xmlString, 'stream');
const attachmentId = uploadResult.data.objectId;
const attachmentUrl = `${uploadResult.config.url}${attachmentId}?storage_type=maester`;
this.logger.info('Attachment created successfully');

const outboundMessage = messages.newEmptyMessage();
Expand Down
Loading

0 comments on commit a485557

Please sign in to comment.