Quick Start

This page contains the following topics:

  • How to create a new micro service by cloning from a template

  • Develop the new micro service locally and debugging it locally

  • How to build it and test it and deploy it through CI/CD

  • How to check the build history

  • How to register the APIs

  • How to call the api

Create a new micro service by cloning from a template

  1. Login to eBaoCloud Container Console, and then click the icon in the following area. Local Image

  2. Click Create, in the pop up window. Local Image

  3. Select Clone From Template, key in Service Name like dev-sample-nodejs, then in the Template drop down list, select nodejs-template.Tick the Create Git Repo, in the Host drop down list, select oss.ebaotech.com.Use the default branch named dev.Then click submit. Like below (Note in this demo the programming stack for the micro service is nodejs) Local Image

  4. Then you will be able to see the record for the newly created micro service Local Image

Develop the new micro service locally and debugging it locally

  1. Clone the source code and do your local development, debugging. (note for security consideration, we hide the user name and password) Local Image

  2. Use your local IDE like Visual Studio Code for the coding /debugging.

    • In the api.js file, write your own source code, Local Image

    • Write your test cases in the test.js file under test folder. Local Image

    • If user wants to expose APIs through this micro service then user can write their API swagger spec in the file route.js like below. Local Image

  1. Commit your souce code to git once your finish coding/debugging.

Build it and test it and deploy it through CICD

  1. Click the Deploy button. PNG

  2. Select Build & Deploy,then submit, the CI/CD will be triggered. During CI, the unit testing cases written in the test.js will be executed, if unit testing fails, the CI step will stop. PNG

  3. Once the service is deployed successfully, the status of the service will be displayed as below. PNG

Check the build history

  1. The user can view the build history by clicking the menu Build History.

    • In the screen below, the status is Build Start, it means that CI and CD have not been completed yet. No result can be showed,you need to wait. PNG

    • In the screen below, the status is SUCCESS, it means the service has been deployed successfully.

  1. When CI/CD is completed, click the View button. PNG

  2. User can click View from the above screen, and see the detailed build history.If your source contains unit test, you can check the result here.In the screen below, it contains unit test log. PNG

Register APIs

  1. After the service is running, user can click Register button to register the APIs exposed by this micro service to the Container’s API gateway. PNG

  2. Once the API is registered, user can see this newly registered API in the API of Container like below. Here search by part of micro service name: PNG PNG

  3. Click button API Spec to view. PNG

Call the APIs

Online call

  1. User can click Test API from the above screen, then it will show online test page.
    • Click the Send Request button , the response will be showed in the red area. PNG

Call APIs by Postman

PNG

results matching ""

    No results matching ""