- Download and install Docker Desktop
- Download and install Node JS
- Download and install Git
- Clone the cns-connector-service repository
- Install the following npm packages globally:
- typescript
- cpx
Only for Developers:
To run a single Business Connector instance, execute the following command:
docker compose -f .dev/docker-compose.debug.yml -f .dev/docker-compose.debug.[env].yml up --build
(replace [env]
with dev
, stage
or prod
, depending on which Backbone environment you want the Business Connector to run in)
After a few seconds you should see the following output:
bc-api-1-stage | [2021-01-25T11:27:40.788] [INFO] Transport.Transport - Transportinitialized
...
bc-api-1-stage | [2021-01-25T11:27:41.241] [INFO] HttpServerModule - Listening on port 80
...
bc-api-1-stage | [2021-01-25T11:27:41.241] [INFO] Runtime - Started all modules.
You can access the Swagger UI of the Business Connector under http://localhost:3000/docs.
Do NOT execute the steps from the previous chapter.
- Execute the VS Code task
Compile
- Execute the VS Code task
Run 1
and select the appropriate Backbone environment and components to start. - Wait until you see the following output on the console:
bc-api-1-stage | [2021-01-25T11:27:40.788] [INFO] Transport.Transport - Transport initialized ... bc-api-1-stage | [2021-01-25T11:27:41.241] [INFO] HttpServerModule - Listening on port 80 ... bc-api-1-stage | [2021-01-25T11:27:41.241] [INFO] Runtime - Started all modules.
- To attach the debugger, switch to the VS Code "Run" view, select the Run configuration "Attach to BC 1" and click the Run button.
If you're running on Linux (or wsl), every time you save a file, the server is restarted, as long as you don't cancel the Compile
task.
If you're running on Windows you have to execute the Restart
task after you saved a file. This is because when mounting a folder from the Windows file system into a Linux Docker container, the file system events are not being mapped properly.
install zx with npm i -g zx
and make sure it is in your path
- on linux run
./scripts/publishVersionToPublic.mjs
on windows you can runzx ./scripts/publishVersionToPublic.mjs
- answer the questions (specify a source and target tag and verify the images)
> ./scripts/publishVersionToPublic.mjs
What source image tag should be deployed? 2.2.2
What target image tag should be deployed (leave empty for "2.2.2")?
Deploying "dockerhub.js-soft.com/nmshd-connector:2.2.2" to "registry.enmeshed.eu/nmshd-connector:2.2.2"
Continue? y/n y
$ docker pull dockerhub.js-soft.com/nmshd-connector:2.2.2
latest: Pulling from bc
cbdbe7a5bc2a: Pulling fs layer
....
> ./scripts/publishVersionToPublic.mjs
What source image tag should be deployed? 2.2.5
What target image tag should be deployed (leave empty for "2.2.2")? latest
Deploying "dockerhub.js-soft.com/nmshd-connector:2.2.5" to "registry.enmeshed.eu/nmshd-connector:latest"
Continue? y/n y
$ docker pull dockerhub.js-soft.com/nmshd-connector:2.2.5
latest: Pulling from bc
cbdbe7a5bc2a: Pulling fs layer
....
- run
npx lerna bootstrap
(this will symlink the SDK in the node_modules of the BC) - run
lerna run build
to build the changes for the BC
The SDK is published, when you merge the project to master while having changed the package version.