Skip to content

Commit 9230762

Browse files
committed
Merge branch 'master' of github.com:elasticio/petstore-component-java
# Conflicts: # build.gradle # gradle/wrapper/gradle-wrapper.jar # gradlew
2 parents 97cd7e8 + 66e673c commit 9230762

File tree

7 files changed

+201
-5
lines changed

7 files changed

+201
-5
lines changed

.circleci/config.yml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
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]
74+
jobs:
75+
test:
76+
docker:
77+
- image: circleci/openjdk:8
78+
steps:
79+
- checkout
80+
- restore_cache:
81+
key: gradle-{{ checksum "build.gradle" }}
82+
83+
- run: ./gradlew downloadDependencies --daemon
84+
- save_cache:
85+
key: gradle-{{ checksum "build.gradle" }}
86+
paths:
87+
- ~/.gradle/caches
88+
- ~/.gradle/wrapper
89+
- run:
90+
name: Audit Dependencies
91+
command: ./gradlew dependencyCheckAnalyze -PrunWithDependencyCheck
92+
build:
93+
docker:
94+
- image: cimg/base:stable
95+
user: root
96+
steps:
97+
- checkout
98+
- node/install:
99+
node-version: << pipeline.parameters.node-version >>
100+
- setup_remote_docker:
101+
version: 19.03.13
102+
docker_layer_caching: true
103+
# build and push Docker image
104+
- run:
105+
name: Install component-build-helper lib
106+
command: npm install -g @elastic.io/component-build-helper
107+
- run:
108+
name: Build and publish docker image
109+
command: build_component_docker
110+
- notify_on_failure
111+
- notify_on_pass
112+
113+
workflows:
114+
test:
115+
jobs:
116+
- test:
117+
name: "Running tests"
118+
filters:
119+
tags:
120+
ignore: /.*/
121+
publish_release:
122+
jobs:
123+
- build:
124+
name: "Build and publish docker image"
125+
filters:
126+
branches:
127+
ignore: /.*/
128+
tags:
129+
only: /^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$/

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
## 1.0.6 (May 11, 2022)
2+
* Made an automated vulnerability check run in CI/CD
3+
4+
## 1.0.5 (May 6, 2022)
5+
* Add an automated vulnerability check
6+
7+
## 1.0.4 (April 08, 2022)
8+
* Updated the Sailor version to 3.3.9
9+
10+
## 1.0.3 (March 16, 2022)
11+
* Updated the sailor version to 3.3.8
12+
* Add a component pusher to Docker hub

build.gradle

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,26 @@ apply plugin: 'groovy'
33
apply plugin: 'idea'
44
apply plugin: 'eclipse'
55
apply plugin: 'java-library-distribution'
6+
if (hasProperty('runWithDependencyCheck')) {
7+
apply plugin: org.owasp.dependencycheck.gradle.DependencyCheckPlugin
8+
9+
check.dependsOn dependencyCheckAnalyze
10+
11+
dependencyCheck {
12+
format = 'HTML'
13+
failBuildOnCVSS = 7
14+
suppressionFile='./dependencyCheck-suppression.xml'
15+
}
16+
}
617

718
group = 'io.elastic'
8-
version = '1.0.2'
19+
20+
task downloadDependencies() {
21+
description 'Download all dependencies to the Gradle cache'
22+
doLast {
23+
configurations.findAll { it.canBeResolved }.files
24+
}
25+
}
926

1027
sourceCompatibility = 1.8
1128
targetCompatibility = 1.8
@@ -31,9 +48,9 @@ repositories {
3148
}
3249

3350
dependencies {
34-
compile "io.elastic:sailor-jvm:4.0.0-SNAPSHOT"
35-
compile "org.glassfish.jersey.core:jersey-client:2.39"
36-
compile "org.glassfish.jersey.media:jersey-media-json-processing:2.39"
51+
compile "io.elastic:sailor-jvm:3.3.9"
52+
compile "org.glassfish.jersey.core:jersey-client:2.25.1"
53+
compile "org.glassfish.jersey.media:jersey-media-json-processing:2.25.1"
3754
}
3855

3956
uploadArchives {
@@ -42,6 +59,15 @@ uploadArchives {
4259
}
4360
}
4461

62+
buildscript {
63+
repositories {
64+
mavenCentral()
65+
}
66+
dependencies {
67+
classpath 'org.owasp:dependency-check-gradle:7.1.0.1'
68+
}
69+
}
70+
4571
wrapper {
4672
gradleVersion = '5.4.1'
4773
}

component.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"title": "Petstore API (Java)",
33
"description": "elastic.io component for the Petstore API",
44
"docsUrl": "https://github.com/elasticio/petstore-component-java",
5+
"version": "1.0.6",
56
"credentials": {
67
"fields": {
78
"apiKey": {

dependencyCheck-suppression.xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<suppressions xmlns="https://jeremylong.github.io/DependencyCheck/dependency-suppression.1.3.xsd">
3+
<suppress>
4+
<notes><![CDATA[
5+
file name: logback-jackson-0.1.5.jar
6+
]]>
7+
</notes>
8+
<packageUrl regex="true">^pkg:maven/ch\.qos\.logback\.contrib/logback\-jackson@.*$</packageUrl>
9+
<cve>CVE-2017-5929</cve>
10+
<cve>CVE-2021-42550</cve>
11+
</suppress>
12+
<suppress>
13+
<notes><![CDATA[
14+
file name: logback-json-classic-0.1.5.jar
15+
]]>
16+
</notes>
17+
<packageUrl regex="true">^pkg:maven/ch\.qos\.logback\.contrib/logback\-json\-classic@.*$</packageUrl>
18+
<cpe>cpe:/a:qos:logback</cpe>
19+
</suppress>
20+
<suppress>
21+
<notes><![CDATA[
22+
file name: logback-json-core-0.1.5.jar
23+
]]>
24+
</notes>
25+
<packageUrl regex="true">^pkg:maven/ch\.qos\.logback\.contrib/logback\-json\-core@.*$</packageUrl>
26+
<cpe>cpe:/a:qos:logback</cpe>
27+
</suppress>
28+
</suppressions>

gradle/wrapper/gradle-wrapper.jar

-9 Bytes
Binary file not shown.

gradlew

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ save () {
162162
APP_ARGS=$(save "$@")
163163

164164
# Collect all arguments for the java command, following the shell quoting and substitution rules
165-
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
165+
eval set -- $DEFAULT_JVM_OPTS --illegal-access=permit $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166166

167167
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168168
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then

0 commit comments

Comments
 (0)