Skip to content

Commit 9cf25e3

Browse files
almas-liaqatalmas-liaqat
authored andcommitted
named mock-provider to sandbox+old sandbox to temp
1 parent 654342c commit 9cf25e3

36 files changed

+51
-51
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ env
2020
.dir-locals.el
2121
*.pyc
2222
.python-version
23-
mock_provider/specification/
23+
sandbox/specification/

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ clean:
2828
publish: clean
2929
mkdir -p build
3030
npm run publish 2> /dev/null
31-
cp build/immunisation-fhir-api.json mock_provider/
32-
cp -r specification mock_provider/specification
31+
cp build/immunisation-fhir-api.json sandbox/
32+
cp -r specification sandbox/specification
3333

3434
#Runs build proxy script
3535
build-proxy:
3636
scripts/build_proxy.sh
3737

3838
#Files to loop over in release
39-
_dist_include="pytest.ini poetry.lock poetry.toml pyproject.toml Makefile build/. tests specification mock_provider"
39+
_dist_include="pytest.ini poetry.lock poetry.toml pyproject.toml Makefile build/. tests specification sandbox"
4040

4141
#Create /dist/ sub-directory and copy files into directory
4242
release: clean publish build-proxy

azure/azure-build-pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ extends:
3131
service_name: ${{ variables.service_name }}
3232
short_service_name: ${{ variables.short_service_name }}
3333
post_ecs_push:
34-
- template: ./templates/build-mock-receiver-image.yml
34+
- template: ./templates/build-sandbox-image

azure/templates/build-mock-receiver-image.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
steps:
2+
- bash: |
3+
mkdir -p build
4+
npm run publish 2> /dev/null
5+
cp build/immunisation-fhir-api.json sandbox/
6+
7+
cd sandbox
8+
docker build -t sandbox .
9+
displayName: Build sandbox image
10+
workingDirectory: "$(Pipeline.Workspace)/s/$(SERVICE_NAME)"

azure/templates/post-deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ steps:
3030
3131
if [[ $APIGEE_ENVIRONMENT =~ .*-*sandbox ]]
3232
then
33-
poetry run pytest -v -m "not nhsd_apim_authorization and not mock_provider_int" --api-name=immunisation-fhir-api --proxy-name=$PROXY_NAME -o junit_logging=all --junitxml=test-report.xml
33+
poetry run pytest -v -m "not nhsd_apim_authorization and not sandbox_int" --api-name=immunisation-fhir-api --proxy-name=$PROXY_NAME -o junit_logging=all --junitxml=test-report.xml
3434
3535
elif [[ $APIGEE_ENVIRONMENT == "int" ]]
3636
then
3737
echo "Int tests to be set as of now"
3838
3939
else
40-
poetry run pytest -v -m "not mock_provider_int" --api-name=immunisation-fhir-api --proxy-name=$PROXY_NAME -o junit_logging=all --junitxml=test-report.xml
40+
poetry run pytest -v -m "not sandbox_int" --api-name=immunisation-fhir-api --proxy-name=$PROXY_NAME -o junit_logging=all --junitxml=test-report.xml
4141
fi
4242
workingDirectory: "$(Pipeline.Workspace)/s/$(SERVICE_NAME)/$(SERVICE_ARTIFACT_NAME)/tests"
4343
displayName: Run full test suite

ecs-proxies-containers.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
docker_containers:
22
- name: sandbox
3-
dockerfile: "mock_provider/Dockerfile"
4-
path: "mock_provider"
3+
dockerfile: "sandbox/Dockerfile"
4+
path: "sandbox"

mock_provider/Dockerfile

Lines changed: 0 additions & 22 deletions
This file was deleted.

sandbox/Dockerfile

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
1-
FROM python:3.9-slim
1+
#First Stage
2+
FROM alpine:latest
3+
#Installing Jq
4+
RUN apk add jq
5+
#Copying OAS spec file in container
6+
COPY "immunisation-fhir-api.json" ./
7+
#Copyign HeslthStatus OAS file in container
8+
COPY "HealthStatusEndpoint.json" ./
9+
#Copying whole specification directory , to get inline examples and schemas
10+
COPY ./specification ./specification
11+
#Adding Health status endpoint to main spec file
12+
RUN jq ".paths+=$(cat HealthStatusEndpoint.json)" immunisation-fhir-api.json > updated-spec.json
213

3-
RUN pip install poetry
414

5-
WORKDIR /sandbox
15+
#Second stage
16+
FROM stoplight/prism:latest
17+
#Inheriting from previous image and copying updated OAS spec file to current container
18+
COPY --from=0 /specification /usr/src/prism/packages/cli/immunisation-fhir-api/specification
19+
COPY --from=0 /updated-spec.json /usr/src/prism/packages/cli/immunisation-fhir-api/specification/immunisation-fhir-api.json
620

7-
ADD pyproject.toml .
8-
RUN poetry config virtualenvs.create false
9-
RUN poetry install
10-
11-
COPY . /sandbox
12-
13-
CMD uvicorn fhir_api:app --reload --host 0.0.0.0 --port 9000 --log-level=warning
21+
#Running command of mock with OAS file
22+
CMD ["mock" , "-h", "0.0.0.0", "-p" ,"9000" ,"immunisation-fhir-api/specification/immunisation-fhir-api.json"]

0 commit comments

Comments
 (0)