diff --git a/distro/core/Dockerfile b/distro/core/Dockerfile index 9b4d24524..1850b38e6 100644 --- a/distro/core/Dockerfile +++ b/distro/core/Dockerfile @@ -4,4 +4,4 @@ FROM outofcoffee/imposter-base:${BASE_IMAGE_TAG} LABEL MAINTAINER="Pete Cornish " -CMD ["--plugin=openapi", "--plugin=rest", "--configDir=/opt/imposter/config"] +CMD ["--plugin=openapi", "--plugin=rest", "--plugin=soap", "--configDir=/opt/imposter/config"] diff --git a/distro/openapi/Dockerfile b/distro/openapi/Dockerfile deleted file mode 100644 index 204621e6e..000000000 --- a/distro/openapi/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -ARG BASE_IMAGE_TAG=latest - -FROM outofcoffee/imposter-base:${BASE_IMAGE_TAG} - -LABEL MAINTAINER="Pete Cornish " - -WORKDIR /opt/imposter/config - -CMD ["--plugin", "openapi", "--configDir", "/opt/imposter/config"] diff --git a/distro/openapi/build.gradle b/distro/openapi/build.gradle deleted file mode 100644 index d1c0835d4..000000000 --- a/distro/openapi/build.gradle +++ /dev/null @@ -1,53 +0,0 @@ -apply plugin: 'java' -apply plugin: 'application' -apply plugin: 'com.github.johnrengelman.shadow' - -compileJava { - sourceCompatibility = JavaVersion.VERSION_11 -} - -dependencies { - implementation project (':imposter-cmd') - implementation project (':distro:distro-base') - - // plugins - implementation project (':core:plugin-detector') - implementation project (':mock:mock-openapi') -} - -mainClassName = 'io.gatehill.imposter.cmd.ImposterLauncher' - -jar { - manifest { - attributes 'Main-Class': mainClassName - - // duplicates attribute from core so it is present in the merged jar - attributes 'Imposter-Version': project.version - - // workaround for 'getCallerClass' warning due to log4j repackaging - // see https://stackoverflow.com/questions/52953483/logmanager-getlogger-is-unable-to-determine-class-name-on-java-11 - attributes 'Multi-Release': 'true' - } -} - -application { - applicationName = 'imposter' -} - -shadowJar { - archiveBaseName = 'imposter-openapi' - archiveVersion = '' - archiveClassifier = '' - - append 'META-INF/imposter.properties' - append 'META-INF/plugin.properties' - append 'META-INF/config-resolver.properties' - - mergeServiceFiles { - include 'META-INF/services/io.vertx.core.spi.VerticleFactory' - } -} - -task dist { - dependsOn installDist -} diff --git a/distro/openapi/src/main/resources/META-INF/imposter.properties b/distro/openapi/src/main/resources/META-INF/imposter.properties deleted file mode 100644 index 6d1c24f80..000000000 --- a/distro/openapi/src/main/resources/META-INF/imposter.properties +++ /dev/null @@ -1,2 +0,0 @@ -# List of comma-separated plugin classes to load if none specified -plugins=openapi diff --git a/distro/rest/Dockerfile b/distro/rest/Dockerfile deleted file mode 100644 index a88ff7222..000000000 --- a/distro/rest/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -ARG BASE_IMAGE_TAG=latest - -FROM outofcoffee/imposter-base:${BASE_IMAGE_TAG} - -LABEL MAINTAINER="Pete Cornish " - -CMD ["--plugin", "rest", "--configDir", "/opt/imposter/config"] diff --git a/distro/rest/build.gradle b/distro/rest/build.gradle deleted file mode 100644 index e12eb0a5b..000000000 --- a/distro/rest/build.gradle +++ /dev/null @@ -1,53 +0,0 @@ -apply plugin: 'java' -apply plugin: 'application' -apply plugin: 'com.github.johnrengelman.shadow' - -compileJava { - sourceCompatibility = JavaVersion.VERSION_11 -} - -dependencies { - implementation project (':imposter-cmd') - implementation project (':distro:distro-base') - - // plugins - implementation project (':core:plugin-detector') - implementation project (':mock:mock-rest') -} - -mainClassName = 'io.gatehill.imposter.cmd.ImposterLauncher' - -jar { - manifest { - attributes 'Main-Class': mainClassName - - // duplicates attribute from core so it is present in the merged jar - attributes 'Imposter-Version': project.version - - // workaround for 'getCallerClass' warning due to log4j repackaging - // see https://stackoverflow.com/questions/52953483/logmanager-getlogger-is-unable-to-determine-class-name-on-java-11 - attributes 'Multi-Release': 'true' - } -} - -application { - applicationName = 'imposter' -} - -shadowJar { - archiveBaseName = 'imposter-rest' - archiveVersion = '' - archiveClassifier = '' - - append 'META-INF/imposter.properties' - append 'META-INF/plugin.properties' - append 'META-INF/config-resolver.properties' - - mergeServiceFiles { - include 'META-INF/services/io.vertx.core.spi.VerticleFactory' - } -} - -task dist { - dependsOn installDist -} diff --git a/distro/rest/src/main/resources/META-INF/imposter.properties b/distro/rest/src/main/resources/META-INF/imposter.properties deleted file mode 100644 index 188bac822..000000000 --- a/distro/rest/src/main/resources/META-INF/imposter.properties +++ /dev/null @@ -1,2 +0,0 @@ -# List of comma-separated plugin classes to load if none specified -plugins=rest diff --git a/docs/getting_started.md b/docs/getting_started.md index 942d3b6d2..c3e88f69d 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -34,7 +34,7 @@ CLI example: Docker example: - docker run -ti -p 8080:8080 -v $PWD/config:/opt/imposter/config outofcoffee/imposter-rest + docker run -ti -p 8080:8080 -v $PWD/config:/opt/imposter/config outofcoffee/imposter Standalone Java example: diff --git a/docs/openapi_plugin.md b/docs/openapi_plugin.md index cbbb0893c..808775d17 100644 --- a/docs/openapi_plugin.md +++ b/docs/openapi_plugin.md @@ -116,11 +116,11 @@ Docker example: docker run --rm -ti -p 8080:8080 \ -v $PWD/examples/openapi/simple:/opt/imposter/config \ - outofcoffee/imposter-openapi + outofcoffee/imposter Java JAR example: - java -jar distro/openapi/build/libs/imposter-openapi.jar \ + java -jar distro/openapi/build/libs/imposter.jar \ --configDir ./examples/openapi/simple This starts a mock server using the OpenAPI plugin. Responses are served based on the OpenAPI specification `petstore.yaml`. diff --git a/docs/rest_plugin.md b/docs/rest_plugin.md index 97dbbb289..abc87d210 100644 --- a/docs/rest_plugin.md +++ b/docs/rest_plugin.md @@ -44,11 +44,11 @@ Docker example: docker run --rm -ti -p 8080:8080 \ -v $PWD/examples/rest/simple:/opt/imposter/config \ - outofcoffee/imposter-rest + outofcoffee/imposter Standalone Java example: - java -jar distro/rest/build/libs/imposter-rest.jar \ + java -jar distro/rest/build/libs/imposter.jar \ --configDir ./examples/rest/simple Send an HTTP request to the `/example` path defined in the configuration file to see the example response: @@ -121,7 +121,7 @@ Start the server: docker run --rm -ti -p 8080:8080 \ -v $PWD/examples/rest/multiple:/opt/imposter/config \ - outofcoffee/imposter-rest + outofcoffee/imposter Send an HTTP request to the `/cats/1` path defined in the configuration file to see the first item in the array: diff --git a/docs/run_imposter_docker.md b/docs/run_imposter_docker.md index b878a8876..ea4e6171b 100644 --- a/docs/run_imposter_docker.md +++ b/docs/run_imposter_docker.md @@ -26,7 +26,7 @@ You must have [Docker](https://docs.docker.com/get-docker/) installed. The easiest way to get started is to use an Imposter Docker container, such as: - docker run -ti -p 8080:8080 outofcoffee/imposter-rest [args] + docker run -ti -p 8080:8080 outofcoffee/imposter [args] ## Docker images @@ -37,8 +37,6 @@ The following images are available: | Image | Docker Hub link | Plugins | Notes | |-------------|---------------------------------------------------------------------------------------|---------------------|-----------------------------------------------------------------------------------------------------------------------------------| | **core** | [outofcoffee/imposter](https://hub.docker.com/r/outofcoffee/imposter) | openapi, rest, soap | This is the primary Imposter Docker image supporting OpenAPI, plain REST APIs and SOAP/WSDL mocks. Most users should choose this. | -| **openapi** | [outofcoffee/imposter-openapi](https://hub.docker.com/r/outofcoffee/imposter-openapi) | openapi | Only contains the [OpenAPI mock plugin](./openapi_plugin.md). | -| **rest** | [outofcoffee/imposter-rest](https://hub.docker.com/r/outofcoffee/imposter-rest) | rest | Only contains the [REST mock plugin](./rest_plugin.md). | | **all** | [outofcoffee/imposter-all](https://hub.docker.com/r/outofcoffee/imposter-all) | All plugins | Contains all mock plugins, and is the largest and has the most dependencies. | > You can also use the these images to create your own custom images with embedded configuration. diff --git a/scripts/docker-build.sh b/scripts/docker-build.sh index e42379eec..b30d5ffd8 100755 --- a/scripts/docker-build.sh +++ b/scripts/docker-build.sh @@ -1,4 +1,47 @@ #!/usr/bin/env bash +# +# Copyright (c) 2023. +# +# This file is part of Imposter. +# +# "Commons Clause" License Condition v1.0 +# +# The Software is provided to you by the Licensor under the License, as +# defined below, subject to the following condition. +# +# Without limiting other conditions in the License, the grant of rights +# under the License will not include, and the License does not grant to +# you, the right to Sell the Software. +# +# For purposes of the foregoing, "Sell" means practicing any or all of +# the rights granted to you under the License to provide to third parties, +# for a fee or other consideration (including without limitation fees for +# hosting or consulting/support services related to the Software), a +# product or service whose value derives, entirely or substantially, from +# the functionality of the Software. Any license notice or attribution +# required by the License must also include this Commons Clause License +# Condition notice. +# +# Software: Imposter +# +# License: GNU Lesser General Public License version 3 +# +# Licensor: Peter Cornish +# +# Imposter is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Imposter is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with Imposter. If not, see . +# + set -e SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" @@ -8,8 +51,6 @@ IMAGE_REPOSITORY="outofcoffee/" DEFAULT_IMAGE_DIRS=( "base" "core" - "openapi" - "rest" "all" ) PUSH_IMAGES="true" @@ -48,7 +89,7 @@ shift $((OPTIND - 1)) IMAGE_TAG="${1-dev}" function get_image_names() { case $1 in - core) echo "imposter" ;; + core) echo "imposter imposter-openapi imposter-rest" ;; **) echo "imposter-$1" ;; esac } diff --git a/scripts/tag-latest-to-release-version.sh b/scripts/tag-latest-to-release-version.sh index 6ea6986be..cd5dae1e8 100755 --- a/scripts/tag-latest-to-release-version.sh +++ b/scripts/tag-latest-to-release-version.sh @@ -1,4 +1,47 @@ #!/usr/bin/env bash +# +# Copyright (c) 2023. +# +# This file is part of Imposter. +# +# "Commons Clause" License Condition v1.0 +# +# The Software is provided to you by the Licensor under the License, as +# defined below, subject to the following condition. +# +# Without limiting other conditions in the License, the grant of rights +# under the License will not include, and the License does not grant to +# you, the right to Sell the Software. +# +# For purposes of the foregoing, "Sell" means practicing any or all of +# the rights granted to you under the License to provide to third parties, +# for a fee or other consideration (including without limitation fees for +# hosting or consulting/support services related to the Software), a +# product or service whose value derives, entirely or substantially, from +# the functionality of the Software. Any license notice or attribution +# required by the License must also include this Commons Clause License +# Condition notice. +# +# Software: Imposter +# +# License: GNU Lesser General Public License version 3 +# +# Licensor: Peter Cornish +# +# Imposter is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Imposter is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with Imposter. If not, see . +# + set -e SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" @@ -6,9 +49,8 @@ ROOT_DIR="${SCRIPT_DIR}/../" IMAGES=( outofcoffee/imposter + outofcoffee/imposter-all outofcoffee/imposter-base - outofcoffee/imposter-openapi - outofcoffee/imposter-rest ) cd "${ROOT_DIR}" diff --git a/settings.gradle b/settings.gradle index da301f387..d97eb5cf0 100644 --- a/settings.gradle +++ b/settings.gradle @@ -103,12 +103,6 @@ project(':distro:core').name = 'distro-core' include ':distro:embedded' project(':distro:embedded').name = 'distro-embedded' -include ':distro:openapi' -project(':distro:openapi').name = 'distro-openapi' - -include ':distro:rest' -project(':distro:rest').name = 'distro-rest' - // libraries include ':lib:fake-data'