From 9fa5e7eede9faf08c62bb37cf7d3d5ec15ddef7d Mon Sep 17 00:00:00 2001 From: Abel Salgado Romero Date: Fri, 26 Feb 2021 23:02:37 +0100 Subject: [PATCH] Update maven from 3.5 to 3.6.3 and required dependencies This also includes: * Upgraded openapi-generator-maven-plugin for all generators to 4.3.1. This is the latest v4.x. There's a 5.x but didn't want ot push too much. I'd rather do it in separated PR. * Added skipValidateSpec option to several generations, otherwise the k8s was considered not valid. * Updated installed packaged from Debian 9 to Debian 10. This is the version used by the new maven image. NOTE: using maven plugin for csharp would allow to get rid of this extra packages I suspect. * Updated dotnet installation according to official docs https://docs.microsoft.com/en-us/dotnet/core/install/linux-debian#debian-10- * Some minnor fixes: remove unnecessary maven depencies, format,... --- openapi/csharp.xml | 6 +++--- openapi/go.sh | 2 +- openapi/go.xml | 3 ++- openapi/java.xml | 6 ------ openapi/openapi-generator/Dockerfile | 20 +++++++++---------- openapi/openapi-generator/client-generator.sh | 2 +- openapi/perl.xml | 1 + openapi/python-asyncio.sh | 2 +- openapi/python.sh | 2 +- openapi/ruby.xml | 1 + openapi/typescript-jquery.sh | 2 +- openapi/typescript.sh | 2 +- 12 files changed, 22 insertions(+), 27 deletions(-) diff --git a/openapi/csharp.xml b/openapi/csharp.xml index d2684a3..f4847b3 100644 --- a/openapi/csharp.xml +++ b/openapi/csharp.xml @@ -1,5 +1,5 @@ - 4.0.0 io.kubernetes @@ -12,7 +12,7 @@ org.codehaus.mojo exec-maven-plugin - 1.1.1 + 3.0.0 generate diff --git a/openapi/go.sh b/openapi/go.sh index 876a2ca..66d7b5f 100755 --- a/openapi/go.sh +++ b/openapi/go.sh @@ -46,7 +46,7 @@ popd > /dev/null source "${SCRIPT_ROOT}/openapi-generator/client-generator.sh" source "${SETTING_FILE}" -OPENAPI_GENERATOR_COMMIT="${OPENAPI_GENERATOR_COMMIT:-v3.3.4}" \ +OPENAPI_GENERATOR_COMMIT="${OPENAPI_GENERATOR_COMMIT:-v4.3.1}" \ CLIENT_LANGUAGE=go; \ CLEANUP_DIRS=(pkg); \ kubeclient::generator::generate_client "${OUTPUT_DIR}" diff --git a/openapi/go.xml b/openapi/go.xml index 126b43c..89e0503 100644 --- a/openapi/go.xml +++ b/openapi/go.xml @@ -8,7 +8,7 @@ - org.openapitools + org.openapitools openapi-generator-maven-plugin ${openapi-generator-version} @@ -21,6 +21,7 @@ go kubernetes-client go + true ${generator.package.name} ${generator.client.version} diff --git a/openapi/java.xml b/openapi/java.xml index ae90213..763d329 100644 --- a/openapi/java.xml +++ b/openapi/java.xml @@ -109,15 +109,9 @@ swagger-annotations ${swagger-annotations-version} - - org.openapitools - openapi-generator-maven-plugin - ${openapi-generator-version} - 1.5.0 - 1.0.0 . swagger.json diff --git a/openapi/openapi-generator/Dockerfile b/openapi/openapi-generator/Dockerfile index dcad532..2349d53 100644 --- a/openapi/openapi-generator/Dockerfile +++ b/openapi/openapi-generator/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM maven:3.5-jdk-8-slim +FROM maven:3.6.3-openjdk-11-slim ARG OPENAPI_GENERATOR_COMMIT ARG GENERATION_XML_FILE ARG OPENAPI_GENERATOR_USER_ORG=OpenAPITools @@ -21,7 +21,7 @@ ARG OPENAPI_GENERATOR_USER_ORG=OpenAPITools RUN apt-get update && apt-get -y install git python-pip && pip install urllib3==1.24.2 # Install Autorest -RUN apt-get update && apt-get -qq -y install libunwind8 libicu57 libssl1.0 liblttng-ust0 libcurl3 libuuid1 libkrb5-3 zlib1g +RUN apt-get update && apt-get -qq -y install libunwind8 libssl1.0 liblttng-ust0 libcurl4 libuuid1 libkrb5-3 zlib1g RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - RUN apt-get update && apt-get -y install \ nodejs \ @@ -46,15 +46,13 @@ RUN mkdir -p /node_modules && chmod -R go+rwx /node_modules RUN npm install @microsoft.azure/autorest.csharp \ @microsoft.azure/autorest.modeler -RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg -RUN mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/ -RUN curl https://packages.microsoft.com/config/debian/9/prod.list > prod.list -RUN mv prod.list /etc/apt/sources.list.d/microsoft-prod.list -RUN chown root:root /etc/apt/trusted.gpg.d/microsoft.asc.gpg -RUN chown root:root /etc/apt/sources.list.d/microsoft-prod.list - -RUN apt-get update -RUN apt-get install -yy -q dotnet-hosting-2.0.8 +# Install dotnet +RUN curl https://packages.microsoft.com/config/debian/10/packages-microsoft-prod.deb --output packages-microsoft-prod.deb +RUN dpkg -i packages-microsoft-prod.deb +RUN apt-get update; \ + apt-get install -y apt-transport-https && \ + apt-get update && \ + apt-get install -y dotnet-sdk-5.0 # Copy required files diff --git a/openapi/openapi-generator/client-generator.sh b/openapi/openapi-generator/client-generator.sh index 19b16e1..2c10ed4 100755 --- a/openapi/openapi-generator/client-generator.sh +++ b/openapi/openapi-generator/client-generator.sh @@ -41,7 +41,7 @@ kubeclient::generator::generate_client() { : "${CLIENT_LANGUAGE?Must set CLIENT_LANGUAGE env var}" OPENAPI_GENERATOR_USER_ORG="${OPENAPI_GENERATOR_USER_ORG:-OpenAPITools}" - OPENAPI_GENERATOR_COMMIT="${OPENAPI_GENERATOR_COMMIT:-v3.3.4}" + OPENAPI_GENERATOR_COMMIT="${OPENAPI_GENERATOR_COMMIT:-v4.3.1}" OPENAPI_MODEL_LENGTH="${OPENAPI_MODEL_LENGTH:-}" OPENAPI_SKIP_FETCH_SPEC="${OPENAPI_SKIP_FETCH_SPEC:-}" OPENAPI_SKIP_BASE_INTERFACE="${OPENAPI_SKIP_BASE_INTERFACE:-}" diff --git a/openapi/perl.xml b/openapi/perl.xml index b55bec8..b5388da 100644 --- a/openapi/perl.xml +++ b/openapi/perl.xml @@ -21,6 +21,7 @@ perl kubernetes-client perl + true false false diff --git a/openapi/python-asyncio.sh b/openapi/python-asyncio.sh index 52c417f..4a0b653 100755 --- a/openapi/python-asyncio.sh +++ b/openapi/python-asyncio.sh @@ -45,7 +45,7 @@ source "${SETTING_FILE}" # use openapi-generator to generate library source "${SCRIPT_ROOT}/openapi-generator/client-generator.sh" -OPENAPI_GENERATOR_COMMIT="${OPENAPI_GENERATOR_COMMIT:-v4.2.3}" +OPENAPI_GENERATOR_COMMIT="${OPENAPI_GENERATOR_COMMIT:-v4.3.1}" CLIENT_LANGUAGE=python-asyncio CLEANUP_DIRS=(client/apis client/models docs test) diff --git a/openapi/python.sh b/openapi/python.sh index e068dfa..81e5f23 100755 --- a/openapi/python.sh +++ b/openapi/python.sh @@ -45,7 +45,7 @@ popd > /dev/null source "${SCRIPT_ROOT}/openapi-generator/client-generator.sh" source "${SETTING_FILE}" -OPENAPI_GENERATOR_COMMIT="${OPENAPI_GENERATOR_COMMIT:-v4.3.0}" +OPENAPI_GENERATOR_COMMIT="${OPENAPI_GENERATOR_COMMIT:-v4.3.1}" CLIENT_LANGUAGE=python; \ CLEANUP_DIRS=(client/api client/apis client/models docs test); \ diff --git a/openapi/ruby.xml b/openapi/ruby.xml index 5f70620..b4e4b48 100644 --- a/openapi/ruby.xml +++ b/openapi/ruby.xml @@ -21,6 +21,7 @@ ruby kubernetes-client ruby + true false false diff --git a/openapi/typescript-jquery.sh b/openapi/typescript-jquery.sh index 3f479d4..cf91d3f 100755 --- a/openapi/typescript-jquery.sh +++ b/openapi/typescript-jquery.sh @@ -46,7 +46,7 @@ popd > /dev/null source "${SCRIPT_ROOT}/openapi-generator/client-generator.sh" source "${SETTING_FILE}" -OPENAPI_GENERATOR_COMMIT="${OPENAPI_GENERATOR_COMMIT:-v4.0.3}"; \ +OPENAPI_GENERATOR_COMMIT="${OPENAPI_GENERATOR_COMMIT:-v4.3.1}"; \ CLIENT_LANGUAGE=typescript-jquery; \ CLEANUP_DIRS=(api model); \ kubeclient::generator::generate_client "${OUTPUT_DIR}" diff --git a/openapi/typescript.sh b/openapi/typescript.sh index 01e1405..44d5c5b 100755 --- a/openapi/typescript.sh +++ b/openapi/typescript.sh @@ -46,7 +46,7 @@ popd > /dev/null source "${SCRIPT_ROOT}/openapi-generator/client-generator.sh" source "${SETTING_FILE}" -OPENAPI_GENERATOR_COMMIT="${OPENAPI_GENERATOR_COMMIT:-v4.0.3}"; \ +OPENAPI_GENERATOR_COMMIT="${OPENAPI_GENERATOR_COMMIT:-v4.3.1}"; \ CLIENT_LANGUAGE=typescript; \ CLEANUP_DIRS=(api model); \ kubeclient::generator::generate_client "${OUTPUT_DIR}"