master | |
---|---|
dev |
This repository is part of the larger Cloud Insurance Co. project.
In order to deploy the full set of microservices involved, check out the insurance-toolchain repo. Otherwise, you can deploy just the app by following the steps here.
-
If you do not already have a Bluemix account, sign up here
-
Download and install the Cloud Foundry CLI tool
-
The app depends on the Catalog and Orders microservices. Make sure to deploy them first.
-
Clone the app to your local environment from your terminal using the following command:
git clone https://github.com/IBM-Bluemix/insurance-bot.git
-
cd
into this newly created directory -
Open the
manifest.yml
file and change thehost
value to something unique.
The host you choose will determinate the subdomain of your application's URL: <host>.mybluemix.net
- Connect to Bluemix in the command line tool and follow the prompts to log in
cf login -a https://api.ng.bluemix.net
- Create a Cloudant service in Bluemix
cf create-service cloudantNoSQLDB Lite insurance-bot-db
- Create a Conversation service in Bluemix
cf create-service conversation standard insurance-bot-conversation
- Push the app to Bluemix
cf push --no-start
- Define a variable pointing to the Catalog API deployment.
cf set-env insurance-bot CATALOG_URL https://your-insurance-catalog.mybluemix.net
- Define a variable pointing to the Orders API deployment.
cf set-env insurance-bot ORDERS_URL https://your-insurance-orders.mybluemix.net
- Define the Watson Conversation workspace ID to use. Refer to this step to get a workspace id.
cf set-env insurance-bot CONVERSATION_WORKSPACE <your-workspace-id>
- Start your app
cf start insurance-bot
And voila! You now have your very own instance of the app running on Bluemix.
-
If you do not already have a Bluemix account, sign up here
-
If you have not already, download Node.js and install it on your local machine.
-
The app depends on the Catalog and Orders microservices. Make sure to have them running first.
-
Create a Cloudant service in Bluemix
cf create-service cloudantNoSQLDB Lite insurance-bot-db
- Create a Conversation service in Bluemix
cf create-service conversation standard insurance-bot-conversation
- In the checkout directory, copy the file
vcap-local.template.json
tovcap-local.json
. Editvcap-local.json
and update the credentials for the Cloudant and Conversation services. You can retrieve the service credentials from the Bluemix console.
cp vcap-local.template.json vcap-local.json
- In the checkout directory, copy the file
.template.env
to.env
. Edit.env
and update the credentials for the Cloudant and Conversation services. Refer to this step to get a workspace id.
cp .template.env .env
- Run
npm install
- Run
npm start
-
Go to the Watson Conversation service in Bluemix.
-
Launch the Watson Conversation tool.
-
Select the option to import a workspace from a JSON file.
-
Select
Ana.json
from the conversation folders. -
Once you have imported the workspace, retrieve the workspace ID by using the
View Details
option
-
If you are using the toolchain, edit the DEPLOY step of
bot (dev)
andbot (prod)
pipelines, set the value of the CONVERSATION_WORKSPACE environment variable to the workspace ID, save and re-run the DEPLOY step. -
If you are running the app on Bluemix, define a CONVERSATION_WORKSPACE environment variable with the workspace ID;
-
If you are running the app locally, edit the
.env
file and set the value of the CONVERSATION_WORKSPACE variable to the workspace ID.
If you find a bug, please report it via the Issues section or even better, fork the project and submit a pull request with your fix! We are more than happy to accept external contributions to this project if they address something noted in an existing issue. In order to be considered, pull requests must pass the initial Travis CI build and/or add substantial value to the sample application.
The primary source of debugging information for your Bluemix app is the logs. To see them, run the following command using the Cloud Foundry CLI:
$ cf logs insurance-bot --recent
For more detailed information on troubleshooting your application, see the Troubleshooting section in the Bluemix documentation.
See License.txt for license information.
This application is configured to track deployments to IBM Bluemix and other Cloud Foundry platforms. The following information is sent to a Deployment Tracker service on each deployment:
- Node.js package version
- Node.js repository URL
- Application Name (
application_name
) - Space ID (
space_id
) - Application Version (
application_version
) - Application URIs (
application_uris
) - Labels of bound services
- Number of instances for each bound service and associated plan information
This data is collected from the package.json
file in the application and the VCAP_APPLICATION
and VCAP_SERVICES
environment variables in IBM Bluemix and other Cloud Foundry platforms. This data is used by IBM to track metrics around deployments of sample applications to IBM Bluemix to measure the usefulness of our examples, so that we can continuously improve the content we offer to you. Only deployments of sample applications that include code to ping the Deployment Tracker service will be tracked.
Deployment tracking can be disabled by removing require("cf-deployment-tracker-client").track();
from the beginning of the app.js
file.