From b4be654c412b3180fe13a50ebf0781b06d2b0952 Mon Sep 17 00:00:00 2001 From: jordigiam Date: Wed, 5 May 2021 11:46:08 +0200 Subject: [PATCH] build(general): replaced jdk by docker openapitool Signed-off-by: jordigiam --- .devcontainer/Dockerfile | 6 ------ .github/workflows/ci.yml | 7 ------- BUILD.md | 1 - .../package.json | 2 +- .../package.json | 2 +- examples/carbon-accounting/Dockerfile | 3 --- examples/supply-chain-app/Dockerfile | 3 --- packages/cactus-cmd-api-server/package.json | 2 +- packages/cactus-core-api/package.json | 2 +- packages/cactus-plugin-consortium-manual/package.json | 2 +- packages/cactus-plugin-keychain-memory/package.json | 2 +- packages/cactus-plugin-keychain-vault/package.json | 2 +- packages/cactus-plugin-ledger-connector-besu/package.json | 2 +- packages/cactus-plugin-ledger-connector-corda/package.json | 4 ++-- .../cactus-plugin-ledger-connector-fabric/package.json | 2 +- .../cactus-plugin-ledger-connector-quorum/package.json | 2 +- packages/cactus-plugin-ledger-connector-xdai/package.json | 2 +- 17 files changed, 13 insertions(+), 33 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 5f13c834c3..ef1e572ada 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -27,12 +27,6 @@ RUN apt-get update \ RUN apt-get update \ && apt-get install software-properties-common -y -# Install openJDK 8 -RUN apt-get update \ - && apt-add-repository 'deb http://security.debian.org/debian-security stretch/updates main' \ - && apt-get update \ - && apt-get install openjdk-8-jdk -y - # Install pip3 RUN apt-get update \ && apt-get install python3-pip -y diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b54bf0c22f..f05970d799 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,13 +47,6 @@ jobs: # - name: Set up Docker Buildx (ARM64 docker images once we are ready) # uses: docker/setup-buildx-action@v1.0.3 - - name: Set up JDK 8 (OpenAPI generator needs it) - uses: actions/setup-java@v1.4.3 - with: - java-version: '8.0.275' # The JDK version to make available on the path. - java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk - architecture: x64 # (x64 or x86) - defaults to x64 - - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v2.1.2 with: diff --git a/BUILD.md b/BUILD.md index 17a0ae92ca..bcc6f55935 100644 --- a/BUILD.md +++ b/BUILD.md @@ -90,7 +90,6 @@ The `npm run watch` script in action: * WSL1 or WSL2 or any virtual machine running Ubuntu LTS * Git * NodeJS 12 or newer LTS (we recommend using nvm if available for your OS) - * OpenJDK 11 * Docker Engine * Docker Compose diff --git a/examples/cactus-example-carbon-accounting-business-logic-plugin/package.json b/examples/cactus-example-carbon-accounting-business-logic-plugin/package.json index 61d47a7388..210c7b9e1f 100644 --- a/examples/cactus-example-carbon-accounting-business-logic-plugin/package.json +++ b/examples/cactus-example-carbon-accounting-business-logic-plugin/package.json @@ -12,7 +12,7 @@ "dist/*" ], "scripts": { - "generate-sdk": "openapi-generator generate --input-spec src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/", + "generate-sdk": "docker run --rm -v \"${PWD}:/local\" openapitools/openapi-generator-cli:v5.0.0-beta2 generate -i ./local/src/main/json/openapi.json -g typescript-axios -o ./local/src/main/typescript/generated/openapi/typescript-axios --reserved-words-mappings protected=protected", "tsc": "tsc --project ./tsconfig.json", "pretsc": "npm run generate-sdk", "watch": "npm-watch", diff --git a/examples/cactus-example-supply-chain-business-logic-plugin/package.json b/examples/cactus-example-supply-chain-business-logic-plugin/package.json index e7e1a90782..e582510bb3 100644 --- a/examples/cactus-example-supply-chain-business-logic-plugin/package.json +++ b/examples/cactus-example-supply-chain-business-logic-plugin/package.json @@ -12,7 +12,7 @@ "dist/*" ], "scripts": { - "generate-sdk": "openapi-generator generate --input-spec src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/", + "generate-sdk": "docker run --rm -v \"${PWD}:/local\" openapitools/openapi-generator-cli:v5.0.0-beta2 generate -i ./local/src/main/json/openapi.json -g typescript-axios -o ./local/src/main/typescript/generated/openapi/typescript-axios/", "tsc": "tsc --project ./tsconfig.json", "pretsc": "npm run generate-sdk", "watch": "npm-watch", diff --git a/examples/carbon-accounting/Dockerfile b/examples/carbon-accounting/Dockerfile index e45f3a7f68..b28c70bdd4 100644 --- a/examples/carbon-accounting/Dockerfile +++ b/examples/carbon-accounting/Dockerfile @@ -2,9 +2,6 @@ FROM node:12.20.1-alpine3.12 as builder RUN apk update -# Need JDK for the openapi-generator that is part of the build process -RUN apk add --no-cache openjdk8 - # Need git because some of our npm depedencies might be coming # straight from github instead of being an npm package on npmjs.com. RUN apk add --no-cache git diff --git a/examples/supply-chain-app/Dockerfile b/examples/supply-chain-app/Dockerfile index a0c75c4d72..14e64ab33f 100644 --- a/examples/supply-chain-app/Dockerfile +++ b/examples/supply-chain-app/Dockerfile @@ -2,9 +2,6 @@ FROM node:12.20.1-alpine3.12 as builder RUN apk update -# Need JDK for the openapi-generator that is part of the build process -RUN apk add --no-cache openjdk8 - # Need git because some of our npm depedencies might be coming # straight from github instead of being an npm package on npmjs.com. RUN apk add --no-cache git diff --git a/packages/cactus-cmd-api-server/package.json b/packages/cactus-cmd-api-server/package.json index 0b3c96c9d1..638bd1ab51 100644 --- a/packages/cactus-cmd-api-server/package.json +++ b/packages/cactus-cmd-api-server/package.json @@ -15,7 +15,7 @@ "module": "dist/lib/main/typescript/index.js", "types": "dist/types/main/typescript/index.d.ts", "scripts": { - "generate-sdk": "openapi-generator generate --input-spec src/main/json/openapi.json -g typescript-axios -o src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected", + "generate-sdk": "docker run --rm -v \"${PWD}:/local\" openapitools/openapi-generator-cli:v5.0.0-beta2 generate -i ./local/src/main/json/openapi.json -g typescript-axios -o ./local/src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected", "pretsc": "npm run generate-sdk", "tsc": "tsc --project ./tsconfig.json", "watch": "npm-watch", diff --git a/packages/cactus-core-api/package.json b/packages/cactus-core-api/package.json index 470909a5a2..326c4b9a41 100644 --- a/packages/cactus-core-api/package.json +++ b/packages/cactus-core-api/package.json @@ -12,7 +12,7 @@ "dist/*" ], "scripts": { - "generate-sdk": "openapi-generator generate --input-spec src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected", + "generate-sdk": "docker run --rm -v \"${PWD}:/local\" openapitools/openapi-generator-cli:v5.0.0-beta2 generate -i ./local/src/main/json/openapi.json -g typescript-axios -o ./local/src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected", "pretsc": "npm run generate-sdk", "tsc": "tsc --project ./tsconfig.json", "watch": "npm-watch", diff --git a/packages/cactus-plugin-consortium-manual/package.json b/packages/cactus-plugin-consortium-manual/package.json index 79c8b30251..8ede2c7db7 100644 --- a/packages/cactus-plugin-consortium-manual/package.json +++ b/packages/cactus-plugin-consortium-manual/package.json @@ -12,7 +12,7 @@ "dist/*" ], "scripts": { - "generate-sdk": "openapi-generator generate --input-spec src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected", + "generate-sdk": "docker run --rm -v \"${PWD}/../../:/local\" openapitools/openapi-generator-cli:v5.0.0-beta2 generate -i ./local/packages/cactus-plugin-consortium-manual/src/main/json/openapi.json -g typescript-axios -o ./local/packages/cactus-plugin-consortium-manual/src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected", "tsc": "tsc --project ./tsconfig.json", "pretsc": "npm run generate-sdk", "watch": "npm-watch", diff --git a/packages/cactus-plugin-keychain-memory/package.json b/packages/cactus-plugin-keychain-memory/package.json index 12f0cdeb19..9ff657a978 100644 --- a/packages/cactus-plugin-keychain-memory/package.json +++ b/packages/cactus-plugin-keychain-memory/package.json @@ -12,7 +12,7 @@ "dist/*" ], "scripts": { - "generate-sdk": "openapi-generator generate --input-spec src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected", + "generate-sdk": "docker run --rm -v \"${PWD}:/local\" openapitools/openapi-generator-cli:v5.0.0-beta2 generate -i ./local/src/main/json/openapi.json -g typescript-axios -o ./local/src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected", "pretsc": "npm run generate-sdk", "tsc": "tsc --project ./tsconfig.json", "watch": "npm-watch", diff --git a/packages/cactus-plugin-keychain-vault/package.json b/packages/cactus-plugin-keychain-vault/package.json index c1d29adef9..71ffcccc7e 100644 --- a/packages/cactus-plugin-keychain-vault/package.json +++ b/packages/cactus-plugin-keychain-vault/package.json @@ -12,7 +12,7 @@ "dist/*" ], "scripts": { - "generate-sdk": "openapi-generator generate --input-spec src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/", + "generate-sdk": "docker run --rm -v \"${PWD}/../../:/local\" openapitools/openapi-generator-cli:v5.0.0-beta2 generate -i ./local/packages/cactus-plugin-keychain-vault/src/main/json/openapi.json -g typescript-axios -o ./local/packages/cactus-plugin-keychain-vault/src/main/typescript/generated/openapi/typescript-axios/", "tsc": "tsc --project ./tsconfig.json", "watch": "npm-watch", "pretsc": "npm run generate-sdk", diff --git a/packages/cactus-plugin-ledger-connector-besu/package.json b/packages/cactus-plugin-ledger-connector-besu/package.json index e28d864838..dff0f8bb73 100644 --- a/packages/cactus-plugin-ledger-connector-besu/package.json +++ b/packages/cactus-plugin-ledger-connector-besu/package.json @@ -12,7 +12,7 @@ "dist/*" ], "scripts": { - "generate-sdk": "openapi-generator generate --input-spec src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected", + "generate-sdk": "docker run --rm -v \"${PWD}:/local\" openapitools/openapi-generator-cli:v5.0.0-beta2 generate -i ./local/src/main/json/openapi.json -g typescript-axios -o ./local/src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected", "pretsc": "npm run generate-sdk", "tsc": "tsc --project ./tsconfig.json", "watch": "npm-watch", diff --git a/packages/cactus-plugin-ledger-connector-corda/package.json b/packages/cactus-plugin-ledger-connector-corda/package.json index a3be1e0fe2..a9332fb41a 100644 --- a/packages/cactus-plugin-ledger-connector-corda/package.json +++ b/packages/cactus-plugin-ledger-connector-corda/package.json @@ -12,8 +12,8 @@ "dist/*" ], "scripts": { - "generate-sdk": "openapi-generator generate --input-spec src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/", - "generate-server": "openapi-generator generate --input-spec src/main/json/openapi.json -g kotlin-spring -o ./src/main-server/kotlin/gen/kotlin-spring/ -c ./src/main-server/openapi-generator-config.yaml", + "generate-sdk": "docker run --rm -v \"${PWD}:/local\" openapitools/openapi-generator-cli:v5.0.0-beta2 generate -i ./local/src/main/json/openapi.json -g typescript-axios -o ./local/src/main/typescript/generated/openapi/typescript-axios/", + "generate-server": "docker run --rm -v \"${PWD}:/local\" openapitools/openapi-generator-cli:v5.0.0-beta2 generate -i ./local/src/main/json/openapi.json -g kotlin-spring -o ./local/src/main-server/kotlin/gen/kotlin-spring/ -c ./local/src/main-server/openapi-generator-config.yaml", "pretsc": "npm-run-all generate-sdk generate-server", "tsc": "tsc --project ./tsconfig.json", "watch": "npm-watch", diff --git a/packages/cactus-plugin-ledger-connector-fabric/package.json b/packages/cactus-plugin-ledger-connector-fabric/package.json index 09a2db4d82..c9ab4eba80 100644 --- a/packages/cactus-plugin-ledger-connector-fabric/package.json +++ b/packages/cactus-plugin-ledger-connector-fabric/package.json @@ -12,7 +12,7 @@ "dist/*" ], "scripts": { - "generate-sdk": "openapi-generator generate --input-spec src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected", + "generate-sdk": "docker run --rm -v \"${PWD}:/local\" openapitools/openapi-generator-cli:v5.0.0-beta2 generate -i ./local/src/main/json/openapi.json -g typescript-axios -o ./local/src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected", "pretsc": "npm run generate-sdk", "tsc": "tsc --project ./tsconfig.json", "watch": "npm-watch", diff --git a/packages/cactus-plugin-ledger-connector-quorum/package.json b/packages/cactus-plugin-ledger-connector-quorum/package.json index d86150d41a..eee484c2b7 100644 --- a/packages/cactus-plugin-ledger-connector-quorum/package.json +++ b/packages/cactus-plugin-ledger-connector-quorum/package.json @@ -12,7 +12,7 @@ "dist/*" ], "scripts": { - "generate-sdk": "openapi-generator generate --input-spec src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected", + "generate-sdk": "docker run --rm -v \"${PWD}:/local\" openapitools/openapi-generator-cli:v5.0.0-beta2 generate -i ./local/src/main/json/openapi.json -g typescript-axios -o ./local/src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected", "pretsc": "npm run generate-sdk", "tsc": "tsc --project ./tsconfig.json", "watch": "npm-watch", diff --git a/packages/cactus-plugin-ledger-connector-xdai/package.json b/packages/cactus-plugin-ledger-connector-xdai/package.json index f7396fb4ea..5137fbe279 100644 --- a/packages/cactus-plugin-ledger-connector-xdai/package.json +++ b/packages/cactus-plugin-ledger-connector-xdai/package.json @@ -12,7 +12,7 @@ "dist/*" ], "scripts": { - "generate-sdk": "openapi-generator generate --input-spec src/main/json/openapi.json -g typescript-axios -o ./src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected", + "generate-sdk": "docker run --rm -v \"${PWD}:/local\" openapitools/openapi-generator-cli:v5.0.0-beta2 generate -i ./local/src/main/json/openapi.json -g typescript-axios -o ./local/src/main/typescript/generated/openapi/typescript-axios/ --reserved-words-mappings protected=protected", "pretsc": "npm run generate-sdk", "tsc": "tsc --project ./tsconfig.json", "watch": "npm-watch",