Repositories
Introduction
This modules provides the mechanism to integrate with 3rd party Git Providers, activate repositories.
Repositories contain your source code and after you activate them, you can deploy that source code in created environments.
You can also integrate and turn on continuous integration per repo per provider as well as follow on the build logs when code is committed.
Overview
How it Works
Git Repositories contain your code and once activated, the repository gets labeled based on the content inside it.
Label | Description |
---|---|
service | The content of the repository represents a microservice. |
daemon | The content of the repository represents a daemon. |
config | The content of the repository represents a configuration that can be attached when deploying source code or resources. |
static | The content of the repository represents static html files. |
custom | The content of the repository is unknown or SOAJS was not able to parse it and understand what it represents. |
multi | The repo contains multiple types from the above options, this type of repo is considered as a parent hosting multiple sub entries. Example:Â https://github.com/soajs/soajs.examples |
When activating a repository, SOAJS runs the following algorithm in attempt to understand what the content of the repository represents.Â
- Look for soa.js at the root level and parse it
- Tag the repo based on the schema found in soa.js
- If the content represents a multi repo, loop inside child array and repeat step 1 and 2
- If soa.js is not found, look for config.js and parse it
- Tag the repo based on the schema found in config.js
- If the content represents a multi repo, loop inside child array and repeat step 1 and 2
- If neither files are found or after parsing any of the two, soajs is not able to understand what the content is about, tag the repository as custom.
Microservice
A microservice is a Restful HTTP server that contains APIs. Click here to see how to build a microservice. If the repository contains only 1 microservice, the schema should be similar to:
'use strict'; module.exports = { type: 'service', //type is service prerequisites: { cpu: '', memory: '' }, serviceVersion: 1, serviceName: "example03", serviceGroup: "SOAJS Example Service", requestTimeout: 30, requestTimeoutRenewal: 5, servicePort: 4012, extKeyRequired: true, session: true, oauth:true, errors: {}, schema: { //api list } };
Daemon
A Daemon is nodeJS script that supplies jobs to be executed in a certain order. Click here to see how to build a daemon. If the repository contains only 1 daemon, the schema should be similar to:
'use strict'; module.exports = { 'type': 'daemon', //type is daemon 'prerequisites': { 'cpu': '', 'memory': '' }, 'serviceName': 'myDaemon', 'serviceGroup': 'myDaemonGroup', 'servicePort': 4177, 'errors': { 400: 'Mongo Database connection error', 401: 'Error while executing Count Query.', 402: 'Model not found' }, 'schema': { //job list } };
Static Content
Static content represents html, css and front end javascript files. If the repository contains only 1 static content, the schema should be similar to:
'use strict'; module.exports = { 'type': 'static', //type is static 'name': 'myCustomUI' };
Configuration Repo
This type of repo contains configuration files that can be attached via Catalog Recipes and then used when deploying source code and resources in environments. the schema in this case should be similar to:
'use strict'; module.exports = { 'type': 'config' //type is config };
Multi Repo
A multi repo is a collection of any of the above types. If the repository contains a multi repo, the schema should be similar to:
"use strict"; module.exports = { "type":"multi", "folders": [ "mySrv1/", //service "myDaemon/", //daemon "myUI/", //static "myOther/", //custom "myConf" //config ] };
Activate, Configure & turn on Continuous Integration
Activate your repository then click its configuration button, the configuration page opens up showing all the continuous integration providers that are a linked and that you can integrate with for this repository. For each provider, you can see the configuration of the repository and modify the settings as well as monitor the latest build information per branch.
Configuration