Skip to content

Use this as template to have an immediately working and docker-based Heisenware extension.

License

Notifications You must be signed in to change notification settings

heisenware/heisenware-docker-extension-starter-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

heisenware-docker-extension-starter-js

Use this as template to have a immediately working docker-based extension project structure.

Adding custom code

You must add your class in the src directory and register it in the index.js. Use the Greeter.js class as a reference.

It is possible to register not only one, but any number of classes.

Building the extension

  1. In the app folder run:
npm install
  1. Then in the root folder run:
docker build -t myusername/myimage:1.0.0 .
  1. Push the image:
docker push myusername/myimage:1.0.0

Done.

Running the extension

There are two options of running the extension:

Start within the platform (running in cloud)

Once your image is publicly available you can start is as part of your cloud platform.

In the App Builder functionality panel click the Install Extensions icon, select Custom Extension and provide the full path to your image (e.g. myusername/myimage:1.0.0).

Start locally (running on premises)

You can also start the container locally, that way you can run code that for example connects to on-premises servers / machines.

To do that simply run the container using standard Docker technology and provide the required credentials via environmental variables:

docker run -it \
-e HW_DOMAIN=<account>.<workspace> \
-e HW_BROKER=mqtts:\\<account>.heisenware.cloud \
-e HW_USERNAME=<username> \
-e HW_PASSWORD=<password> \
myusername\myimage:1.0.0

In order to retrieve a valid username and password, create a VRPC integration in the App Manager.

Example

For an account named my-company, an integration with username agentRunner and a password called secret the call would be:

docker run -it \
-e HW_DOMAIN=my-company.default \
-e HW_BROKER=mqtts:\\my-company.heisenware.cloud \
-e HW_USERNAME=agentRunner \
-e HW_PASSWORD=secret \
myusername\myimage:1.0.0

About

Use this as template to have an immediately working and docker-based Heisenware extension.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published