If you already have a GitHub account, please proceed to Step 2. Otherwise, please follow below:
1.a Go to Github page.
1.b Enter your desired username, your email address and then your desired password. Afterwards, click the Sign up for GitHub button.
Please refer to Bluemix Get Started on how to create account or follow the previous example on how to create your Bluemix account on this page.
3.a If you do not know how to use Git, please read the Git Tutorial or you can use the SourceTree a GUI based Git implementation. Please read the SourceTree Tutorial to learn more about SourceTree.
3.b Upload your Rest API code to GitHub using the git push command. In contrast, you can fork or clone my Rest API on GitHub then apply your own changes as needed then upload the code to your GitHub account. Note: My sample Rest API contains a sample implementation of MongoDB and APICache.
4.a Log-on to your Bluemix account.
4.b Click Menu to show other items.
Then select "Services".
And then, click "DevOps".
4.c Select Toolchains. Then, click Create a Toolchain button.
4.d Select Other Templates
4.e Enter desired Toolchain Name, please note this will show in your URL for API's.
4.f Wait for a few seconds for Bluemix to create your Toolchain. Afterwards, click Add a Tool.
4.g Choose GitHub
4.h Now, we need to link our existing repository on GitHub to this Toolchain. Under Repository type, please choose Existing. Then, choose the correct repository URL for your Rest API source. After that, it is up to you if you want to track the changes of the repository via Toolchain. To do that please check the Track deployment of code changes check box.
4.i Now what we need is something to build and deploy our Rest API repository automatically. So we need to add another tool.
4.j Let's add the Delivery Pipeline
Then, name it Build and Deploy.
After a few seconds, the newly added Delivery Pipeline will show up. Click it.
4.k We need to add stages to our Delivery Pipeline. Click Add Stage.
4.l Create the Build stage in which will automatically build our package. Follow the steps on the figure below:
We need to Add a JOB that will run the npm install command.
Select the Build option.
Then, select npm under the Builder Type. And then, under the Build Shell Command automatically configure that it will run the npm install command.
Make sure to click Save button to save the changes.
4.m After creating the build stage, now we need to create the Deploy stage. Go and add another stage by clicking the Add Stage.
Follow the steps defined in the figure below:
Then, under JOBS tab, click Add Job.
And then, select Deploy option.
Under Deployer Type select Cloud Foundry (IBM Bluemix default Cloud Service).
In this case, I selected dev space. For real project, you may want to select a better space that can handle your actual production usage. Afterwards, click the Save button.
4.n Now all stages are all configured. By default, all stages is in Stop status. We need to Run all our stages by clicking the Play like buttons.
4.o If you see similar figure below means you successfully configured and implemented our Continuous Deployment of our RESTful API's via IBM Bluemix using ToolChain.
Try clicking the link as define above figure to see if the API is running as expected.
Postman is a powerful API testing tool and can be install via Google Chrome as an extension. Make sure on your testing to follow the route convention you defined on your express code. To know more how to use the Postman tool, please see the Postman Blog.
I do not own any external link given in this example. Credit to those who own those links.