Skip to content

Commit

Permalink
Completing demo with devcontainers.json
Browse files Browse the repository at this point in the history
Signed-off-by: Laurent Broudoux <laurent.broudoux@gmail.com>
  • Loading branch information
lbroudoux committed Aug 21, 2023
1 parent cc281c9 commit dffc548
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/java
{
"name": "Spring Boot Order Service",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-22.04",

"features": {
"ghcr.io/devcontainers/features/java:1": {
"version": "17",
"installMaven": "true",
"installGradle": "false"
},
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [
9090 // The Microcks Http port onxe started with postCreateCommand
],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "docker compose -f microcks-docker-compose.yml up -d"

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ services:
restart: on-failure
image: quay.io/microcks/microcks-cli:latest
volumes:
- "./src/test/resources/third-parties:/resources"
- "./src/main/resources:/resources"
- "./src/test/resources/third-parties:/third-parties"
entrypoint:
- microcks-cli
- import
- '/resources/apipastries-openapi.yaml:true,/resources/apipastries-postman-collection.json:false'
- '/resources/order-service-openapi.yaml:true,/third-parties/apipastries-openapi.yaml:true,/third-parties/apipastries-postman-collection.json:false'
- --microcksURL=http://microcks:8080/api
- --insecure
- --keycloakClientId=foo
Expand Down
5 changes: 5 additions & 0 deletions shift-left-demo/spring-boot-order-service/microcks-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
docker run -it quay.io/microcks/microcks-cli:latest microcks-cli test 'Order Service API:0.1.0' \
http://host.docker.internal:8080/api OPEN_API_SCHEMA \
--microcksURL=http://host.docker.internal:9090/api/ \
--keycloakClientId=foo --keycloakClientSecret=bar --insecure --waitFor=8sec

2 changes: 1 addition & 1 deletion shift-left-demo/spring-boot-order-service/microcks.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
docker-compose -f microcks-docker-compose.yml up
docker compose -f microcks-docker-compose.yml up

0 comments on commit dffc548

Please sign in to comment.