Aura Mocks server installation

Guidelines for the installation, testing and deployment of Aura Mocks Server

Introduction

These instructions will allow you to get a copy of the project running on your local machine for development and testing purposes.

The following pre-requirements are needed:

  • nodeJS installed version: 12 or higher
    $ node --version

Installation

  • Download from git:
    $ git clone https://github.com/Telefonica/aura-mocks-server.git
    
  • Build project:
    $ npm run build
    

Run tests

This project uses tslint to validate the coding style.

Code style tests

These tests perform the validation coding rules defined in aura using the tslint tool.

You can validate the code using:

   $ npm run lint

Deployment

This project uses Jenkins to generate the docker image in the azure registry.

You can download the image using pull:

docker pull auraregistry.azurecr.io/aura/aura-mocks-server:<VERSION>

Build local docker image

To build docker image execute:

$ docker build -f ./delivery/docker/Dockerfile -t auraregistry.azurecr.io/aura-mocks-server .

Run server

To start mock server:

    $ docker run -d -p 3000:3000 auraregistry.azurecr.io/aura-mocks-server

This starts a server listening on port 3000

Deploy

To deploy in performance environments, there is a convinient deployment yaml in aurak8s repository at tools/mocks/deployment.yml so you just need to run kubectl apply -f tools/mocks/deployment.yml.

Developer notes

The folder structure used for development is:

src
├── api             // Statics API code
├── modules         // Modules code (jsonserver)
├── scripts         // Scripts
└── shared          // Shared code between APIs and modules.
    ├── common
    └── services

Versioning

We use [SemVer] (http://semver.org/) for versioning.

For all available versions, look at the tags in this repository.