2017-08-10 03:49:03 -07:00
|
|
|
# Copyright 2017 The Kubernetes Authors.
|
|
|
|
|
#
|
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
|
#
|
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
#
|
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
|
|
|
|
FROM maven:3.5-jdk-7
|
|
|
|
|
ARG SWAGGER_CODEGEN_COMMIT
|
|
|
|
|
ARG GENERATION_XML_FILE
|
2017-08-10 12:26:39 -07:00
|
|
|
ARG SWAGGER_CODEGEN_USER_ORG=swagger-api
|
2017-08-10 03:49:03 -07:00
|
|
|
|
|
|
|
|
# Install preprocessing script requirements
|
|
|
|
|
RUN apt-get update && apt-get -y install python-pip && pip install urllib3
|
|
|
|
|
|
|
|
|
|
# Check out specific commit of swagger-codegen
|
|
|
|
|
RUN mkdir /source && \
|
|
|
|
|
cd /source && \
|
2017-08-10 12:26:39 -07:00
|
|
|
git clone -n https://github.com/${SWAGGER_CODEGEN_USER_ORG}/swagger-codegen.git && \
|
2017-08-10 03:49:03 -07:00
|
|
|
cd swagger-codegen && \
|
|
|
|
|
git checkout $SWAGGER_CODEGEN_COMMIT
|
|
|
|
|
|
|
|
|
|
# Build it and persist local repository
|
|
|
|
|
RUN cd /source/swagger-codegen && \
|
|
|
|
|
mvn install -DskipTests -Dmaven.test.skip=true -pl modules/swagger-codegen-maven-plugin -am && \
|
|
|
|
|
cp -r /root/.m2/* /usr/share/maven/ref
|
|
|
|
|
|
2017-10-19 00:45:06 +00:00
|
|
|
# Install Autorest
|
2017-10-21 00:23:23 +00:00
|
|
|
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
|
2017-10-19 00:45:06 +00:00
|
|
|
RUN apt-get update && apt-get -y install \
|
|
|
|
|
nodejs \
|
|
|
|
|
libunwind8-dev \
|
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
2017-10-21 00:23:23 +00:00
|
|
|
RUN npm install -g autorest@preview #TODO-krabhishek8260: Remove preview as soon as the required bits are in release version
|
2017-10-19 00:45:06 +00:00
|
|
|
|
2017-08-10 03:49:03 -07:00
|
|
|
# Copy required files
|
|
|
|
|
COPY ${GENERATION_XML_FILE} /generation_params.xml
|
|
|
|
|
COPY generate_client_in_container.sh /generate_client.sh
|
|
|
|
|
COPY preprocess_spec.py /
|
|
|
|
|
COPY custom_objects_spec.json /
|
|
|
|
|
|
|
|
|
|
ENTRYPOINT ["mvn-entrypoint.sh", "/generate_client.sh"]
|