These are instructions to deploy Logistic Wizard to IBM Cloud. The Webui, ERP, and Controller can be deployed to IBM Cloud Cloud Foundry. The ERP and Controller services will be pushed to IBM Cloud CF using docker images while the Webui will be deployed as a regular CF app.
- Set up the database for the ERP:
ibmcloud cf create-service cloudantNoSQLDB Standard logistics-wizard-erp-db
- Open the Cloudant dashboard and create a database named
logistics-wizard
. - Then clone
logistics-wizard-erp
repo:git clone https://github.com/IBM-Cloud/logistics-wizard-erp cd logistics-wizard-erp
- Build and push the image to docker hub.
docker build -t <username>/logistics-wizard-erp:latest . docker push <username>/logistics-wizard-erp:latest
- Create the ERP microservice in IBM Cloud without starting it using the docker image you created above
ibmcloud cf push <erp-name> --docker-image=<username>/logistics-wizard-erp:latest --no-start ibmcloud cf bind-service <erp-name> logistics-wizard-erp-db --no-manifest
- Start the ERP microservice:
ibmcloud cf start <erp-name>
- After starting the ERP microservice, you can verify it is running by hitting
https://<erp-name>.mybluemix.net/explorer
- Clone the controller repo:
git clone https://github.com/IBM-Cloud/logistics-wizard-controller cd logistics-wizard-controller
- Build and push the image to docker hub.
docker build -t <username>/logistics-wizard-controller:latest . docker push <username>/logistics-wizard-controller:latest
- Create the controller microservice in bluemix without starting it using the docker image you created above
ibmcloud cf push <controller-name> --docker-image=<username>/logistics-wizard-controller:latest --no-start --no-manifest
- Clone the logistics-wizard-webui repo:
git clone https://github.com/IBM-Cloud/logistics-wizard-webui cd logistics-wizard-webui
- Install the dependencies
npm install
- Build the static files for the UI using the appropriate environment variables
CONTROLLER_SERIVCE='<controller-service-url>' npm run deploy:prod
- Deploy the app to bluemix
cd dist ibmcloud cf push <webui-name> -b staticfile_buildpack --no-manifest
-
Clone the logistics-wizard-recommendation repo.
git clone https://github.com/IBM-Cloud/logistics-wizard-recommendation cd logistics-wizard-recommendation
-
Create a
Cloudant
instance.ibmcloud cf create-service cloudantNoSQLDB Standard logistics-wizard-recommendation-db
-
Create a service key, take note of the URL values as it would be needed in a later step.
ibmcloud cf create-service-key logistics-wizard-recommendation-db for-openwhisk
-
Retrieve the Cloudant credentials
ibmcloud cf service-key logistics-wizard-recommendation-db for-openwhisk
-
Copy the local env template file.
cp template-local.env local.env
-
Using the URL values from the terimal output above, update the local.env file to look like the following:
-
Build your Cloud Functions actions. Note: node version >=6.9.1 required and npm >=3.10.8
npm install npm run build
-
Verify your setup, Here, we perform a blocking (synchronous) invocation of
echo
, passing it "hello" as an argument.ibmcloud fn action invoke /whisk.system/utils/echo -p message hello --result
Output should be something like
{ "message": "hello" }
. -
Deploy your Cloud Functions actions:
./deploy.sh --install
-
Make note of the URL to call functions.
- Set the environment variables for the controller to connect to the ERP and to the Recommendation service. Run the below commands by providing appropriate values:
ibmcloud cf set-env <controller-name> ERP_SERVICE 'https://<erp-URL>'
ibmcloud cf set-env <controller-name> FUNCTIONS_NAMESPACE_URL <url-to-call-functions>