Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into update-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita-Smirnov-Exactpro committed Feb 26, 2025
2 parents a4dbe98 + 6ca6ff7 commit 52d8e56
Show file tree
Hide file tree
Showing 17 changed files with 690 additions and 55 deletions.
3 changes: 3 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ updates:
- dependencies
schedule:
interval: daily
allow:
- dependency-name: '*'
dependency-type: production
- package-ecosystem: github-actions
directory: /
reviewers:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/build-dev-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ jobs:
docker-username: ${{ github.actor }}
secrets:
docker-password: ${{ secrets.GITHUB_TOKEN }}
nvd-api-key: ${{ secrets.NVD_APIKEY }}
nvd-api-key: ${{ secrets.NVD_APIKEY }}
cisa-domain: ${{ secrets.CISA_DOMAIN }}
cisa-user: ${{ secrets.CISA_USER }}
cisa-password: ${{ secrets.CISA_PWD }}
5 changes: 4 additions & 1 deletion .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ jobs:
docker-username: ${{ github.actor }}
secrets:
docker-password: ${{ secrets.GITHUB_TOKEN }}
nvd-api-key: ${{ secrets.NVD_APIKEY }}
nvd-api-key: ${{ secrets.NVD_APIKEY }}
cisa-domain: ${{ secrets.CISA_DOMAIN }}
cisa-user: ${{ secrets.CISA_USER }}
cisa-password: ${{ secrets.CISA_PWD }}
3 changes: 3 additions & 0 deletions .github/workflows/build-sanpshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ jobs:
secrets:
docker-password: ${{ secrets.GITHUB_TOKEN }}
nvd-api-key: ${{ secrets.NVD_APIKEY }}
cisa-domain: ${{ secrets.CISA_DOMAIN }}
cisa-user: ${{ secrets.CISA_USER }}
cisa-password: ${{ secrets.CISA_PWD }}
10 changes: 1 addition & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,7 @@ COPY ./ .
RUN gradle clean build dockerPrepare -p cradle-admin-tool-http -Prelease_version=${Prelease_version}

FROM adoptopenjdk/openjdk11:alpine
ENV CRADLE_INSTANCE_NAME=instance1 \
CASSANDRA_DATA_CENTER=kos \
CASSANDRA_HOST=cassandra \
CASSANDRA_PORT=9042 \
CASSANDRA_KEYSPACE=demo \
CASSANDRA_USERNAME=guest \
CASSANDRA_PASSWORD=guest \
HTTP_PORT=8080 \
HTTP_HOST=localhost
RUN apk add bash jq curl grep # These utils are required for running embedded scripts
WORKDIR /home
COPY --from=build /home/gradle/cradle-admin-tool-http/build/docker .
ENTRYPOINT ["/home/service/bin/service", "run", "com.exactpro.th2.cradle.adm.http.Application"]
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ spec:
* `page-name` - name of the new page (optional). If you miss this argument, name is generated automatically
* `page-start` - start time of the new page (required)
* `page-comment` - comment for the new page (optional)
* `/update-page?book-id=test_book&page-name=first_page&new-page-comment=my_second_page&new-page-name=second_page` - update existed page by arguments:
* `book-id` - name (id) where the new page will be created (required).
* `page-name` - name of the updated page (required).
* `new-page-name` - new name for updated page (optional). Only pages in future can be renamed.
* `new-page-comment` - new comment for updated page (optional). Comment of any page can be updated
* `/remove-page?book-id=test_book&page-name=first_page` - removes a page by arguments:
* `book-id` - name (id) where the removed page is (required).
* `page-name` - name of the removed page (required).
Expand All @@ -68,8 +73,13 @@ spec:
### 2.0.0-dev
* Updated:
* migrated to jetty: `11.0.24`
* th2-gradle-plugin: `0.1.6` (th2-bom: `4.9.0`)
* Cradle API to `5.4.4-dev`

### 1.11.2-dev

* Included scripts for REST API interaction and installed required utils into docker image
* Updated
* th2-gradle-plugin: `0.1.8` (th2-bom: `4.10.0`)
* jackson-datatype-jsr310: `2.18.2`

### 1.11.1-dev
Expand Down
8 changes: 6 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ dependencyCheck {
subprojects {
apply plugin: 'java'

sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
th2JavaRelease {
targetJavaVersion.set(JavaVersion.VERSION_11)
}

compileJava.options.debugOptions.debugLevel = 'source,lines,vars' // Include debug information

group = 'com.exactpro.th2'
Expand All @@ -34,6 +36,8 @@ subprojects {
}

dependencies {
implementation(libs.cradle.core)
implementation(libs.cradle.cassandra)
implementation "org.slf4j:slf4j-api"

testImplementation(libs.th2.junit.jupiter.integration)
Expand Down
3 changes: 0 additions & 3 deletions cradle-admin-tool-cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ dependencies {
exclude group: 'com.squareup.okhttp3', module: 'okhttp'
}

implementation(libs.cradle.core)
implementation(libs.cradle.cassandra)

implementation(libs.commons.cli)

testImplementation project(':cradle-admin-tool-test')
Expand Down
2 changes: 0 additions & 2 deletions cradle-admin-tool-core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
dependencies {
implementation(libs.cradle.core)
implementation(libs.cradle.cassandra)
implementation 'org.apache.commons:commons-lang3'
}
28 changes: 28 additions & 0 deletions cradle-admin-tool-http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,34 @@ spec:
page-recheck-interval: 60
```
## Scripts
### cradle-admin-tool-http/scripts/update-pages-comment.sh
```
Help:
Description: this script provide ability to update comment for pages covered by time rage where page.started is included and page.ended is excluded
Required utils: jq curl paste grep head
Arguments:
--mode (optional) - work mode. Default value is 'get'
* 'append' - appends existed pages' comment by text specified using --comment. 'auto-page' default page comment is removed
Final comment has JSON string array format, for example: '["<existed comment>","<specified comment>"]'
* 'set' - sets text specified using --comment as pages' comment
Final comment has JSON string array format, for example: '["<specified comment>"]'
* 'reset' - resets pages' comment to 'auto-page' default page comment
Final comment is 'auto-page'
* 'get' - prints pages and their comments
--cradle-admin-tool-url (required) - cradle admin tool URL
--book (required) - th2 book for searching and updating pages
--start-timestamp (conditional) - start timestamp for searching page to add --comment comment.
- ['append','set','reset'] modes (required)
- 'get' mode (optional) - default is min timestamp
--end-timestamp (conditional) - end timestamp for searching page to add --comment comment.
- ['append','set','reset'] modes (required)
- 'get' mode (optional) - default is max timestamp
--comment (conditional) - comment for adding to pages found from --start-timestamp to --end-timestamp. Required for ['append','set'] modes
```

## Release notes

### 2.0.0-dev
Expand Down
12 changes: 10 additions & 2 deletions cradle-admin-tool-http/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ dependencies {
implementation(libs.th2.common) {
exclude group: 'com.squareup.okhttp3', module: 'okhttp'
}
implementation(libs.cradle.core)
implementation(libs.cradle.cassandra)

implementation "org.eclipse.jetty:jetty-server"
implementation "org.eclipse.jetty:jetty-servlet"
Expand All @@ -25,4 +23,14 @@ dependencies {

application {
mainClassName = "com.exactpro.th2.cradle.adm.http.Application"
}

distributions {
main {
contents {
into('scripts') {
from 'scripts'
}
}
}
}
Loading

0 comments on commit 52d8e56

Please sign in to comment.