Skip to content

Commit

Permalink
refactor: replaces openapi and rest distributions with core distribut…
Browse files Browse the repository at this point in the history
…ion.
  • Loading branch information
outofcoffee committed Nov 17, 2023
1 parent da549ff commit 2c640ff
Show file tree
Hide file tree
Showing 14 changed files with 96 additions and 147 deletions.
2 changes: 1 addition & 1 deletion distro/core/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ FROM outofcoffee/imposter-base:${BASE_IMAGE_TAG}

LABEL MAINTAINER="Pete Cornish <outofcoffee@gmail.com>"

CMD ["--plugin=openapi", "--plugin=rest", "--configDir=/opt/imposter/config"]
CMD ["--plugin=openapi", "--plugin=rest", "--plugin=soap", "--configDir=/opt/imposter/config"]
9 changes: 0 additions & 9 deletions distro/openapi/Dockerfile

This file was deleted.

53 changes: 0 additions & 53 deletions distro/openapi/build.gradle

This file was deleted.

This file was deleted.

7 changes: 0 additions & 7 deletions distro/rest/Dockerfile

This file was deleted.

53 changes: 0 additions & 53 deletions distro/rest/build.gradle

This file was deleted.

2 changes: 0 additions & 2 deletions distro/rest/src/main/resources/META-INF/imposter.properties

This file was deleted.

2 changes: 1 addition & 1 deletion docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
4 changes: 2 additions & 2 deletions docs/openapi_plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
6 changes: 3 additions & 3 deletions docs/rest_plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:

Expand Down
4 changes: 1 addition & 3 deletions docs/run_imposter_docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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.
Expand Down
47 changes: 44 additions & 3 deletions scripts/docker-build.sh
Original file line number Diff line number Diff line change
@@ -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 <https://www.gnu.org/licenses/>.
#

set -e

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
Expand All @@ -8,8 +51,6 @@ IMAGE_REPOSITORY="outofcoffee/"
DEFAULT_IMAGE_DIRS=(
"base"
"core"
"openapi"
"rest"
"all"
)
PUSH_IMAGES="true"
Expand Down Expand Up @@ -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 }

Expand Down
46 changes: 44 additions & 2 deletions scripts/tag-latest-to-release-version.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,56 @@
#!/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 <https://www.gnu.org/licenses/>.
#

set -e

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ROOT_DIR="${SCRIPT_DIR}/../"

IMAGES=(
outofcoffee/imposter
outofcoffee/imposter-all
outofcoffee/imposter-base
outofcoffee/imposter-openapi
outofcoffee/imposter-rest
)

cd "${ROOT_DIR}"
Expand Down
6 changes: 0 additions & 6 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down

0 comments on commit 2c640ff

Please sign in to comment.