Skip to content

Commit

Permalink
Merge pull request #79 from 4urcloud/dev-adrien
Browse files Browse the repository at this point in the history
config
  • Loading branch information
aeppling authored Nov 24, 2023
2 parents f65a934 + 6e91af5 commit b5c4d86
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
6 changes: 4 additions & 2 deletions Kexa/services/analyse.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,10 @@ function getListNeedRules(): string[]{
for(let cloudProvider of Object.keys(config)){
let configAssign = config[cloudProvider];
for(let config of configAssign){
for(let rule of config.rules){
if(!listNeedRules.includes(rule)) listNeedRules.push(rule);
if (Array.isArray(config.rules)) {
for (let rule of config.rules) {
if (!listNeedRules.includes(rule)) listNeedRules.push(rule);
}
}
}
}
Expand Down
8 changes: 8 additions & 0 deletions config/env/office365.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
"rules": [
"BenchmarkOffice365"
]
},
{
"name": "O365 project B",
"description": "organization 4urcloud",
"prefix": "O365PROJECTB_",
"rules": [
"BenchmarkOffice365"
]
}
]
}
29 changes: 28 additions & 1 deletion documentation/Documentation-Kexa.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<ul>
<li><a href="#basic-configuration">Basic Configuration</a></li>
<li><a href="#multiple-environments-provider-prefix">Multiple Environments provider prefix</a></li>
<li><a href="#custom-and-multiple-configurations">Custom and multiple Configurations</a></li>
<li><a href="#regions">Regions</a></li>
</ul>
</li>
Expand Down Expand Up @@ -234,6 +235,32 @@ Each projects in this list refers to a "subscription"/"environment". It's a good
```
<br/>

<div id="custom-and-multiple-configurations"></div>

## **Custom and multiple configurations**

As we said before, `/config/default.json` is the default file path for your Kexa projects configuration.
But you can edit this and have multiple configuration files to switch between.

First, delete the `default.json` configuration file, so it won't be taken into account. (think about backup if you need it)

There is a `/config/env/` folder available in Kexa, if not, you can create it.
In this folder you will be able to store multiple configuration files, each having a custom name.

To use a custom file, set the following environment variable :

```sh
NODE_CONFIG_TS_ENV=customName
```

Replace `customName` by your file name (that will always be a .json).
Do not forget to delete or move away `default.json` to avoid conflicts.

In addition, you can also use the `/config/deployment` and `/config/user`, by using `DEPLOYMENT=customName` or `USER=customName`.
For more information, check [node-config-ts](https://www.npmjs.com/package/node-config-ts#custom-config-directory) documentation.

<br/>

<div id="regions"></div>

## **Regions**
Expand Down Expand Up @@ -1036,4 +1063,4 @@ NAME SCHEDULE SUSPEND ACTIVE LAST SCHEDULE AGE
kexacronjob 0 0 * * * False 0 <none> 3m33s
```
<p align="right">(<a href="#top">back to top</a>)</p>
<p align="right">(<a href="#top">back to top</a>)</p>

0 comments on commit b5c4d86

Please sign in to comment.