Skip to content

Commit

Permalink
feat: Add support for nginx static file (#1161)
Browse files Browse the repository at this point in the history
  • Loading branch information
lemaitre-aneo authored Aug 11, 2023
2 parents 4e99b7e + 46bac14 commit 3b1b4da
Show file tree
Hide file tree
Showing 13 changed files with 102 additions and 2 deletions.
41 changes: 41 additions & 0 deletions .docs/content/2.guide/differentiate-environments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Differentiate environments

It's important to be able to differentiate environments, to be able to rapidly identify which environment you are working on. This is especially important when you are working on multiple environments at the same time to avoid confusion and mistakes.

In order to achieve this differentiation, we serve a file called `environment.json` that you can access at `/static/environment.json`.

::alert{type="info"}
In the [Admin GUI](https://github.com/aneoconsulting/ArmoniK.Admin.GUI), we use this file to display the environment name and version in the top middle.
::

## Content of the `environment.json` file

This file contains the following keys:

```json
{
"name": "<string>",
"description": "<string>",
"color": "<string>",
"version": "<string>"
}
```

::alert{type="info"}
You can use any valide CSS color in the `color` key. [Read more about CSS colors](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
::

## Personalize the `environment.json` file

You can personalize the content of the file but you need to keep the `name`, `description`, `color` and `version` keys. If you change the name of the keys, the [Admin GUI](https://github.com/aneoconsulting/ArmoniK.Admin.GUI) will not be able to read the file.

In your `parameters.tfvars` (in `armonik` layer or in the `all-in-one`), you can update the `environment.description` key to serve different content for each environment.

```hcl
environment_description = {
name = "aws-dev"
version = "0.1.0"
description = "AWS environment"
color = "#80ff80"
}
```
2 changes: 2 additions & 0 deletions infrastructure/quick-deploy/aws/all-in-one/armonik.tf
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,6 @@ module "armonik" {
# Force the dependency on Keda and metrics-server for the HPA
keda_chart_name = module.keda.keda.chart_name
metrics_server_chart_name = concat(module.metrics_server[*].metrics_server.chart_name, ["metrics-server"])[0]

environment_description = var.environment_description
}
7 changes: 7 additions & 0 deletions infrastructure/quick-deploy/aws/all-in-one/parameters.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -639,3 +639,10 @@ extra_conf = {
Submitter__MaxErrorAllowed = 50
}
}

environment_description = {
name = "aws-dev"
version = "0.0.0"
description = "AWS environment"
color = "#80ff80"
}
8 changes: 7 additions & 1 deletion infrastructure/quick-deploy/aws/all-in-one/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -732,4 +732,10 @@ variable "ecr" {
encryption_type = optional(string, "KMS")
})
default = {}
}
}

variable "environment_description" {
description = "Description of the environment"
type = any
default = null
}
2 changes: 2 additions & 0 deletions infrastructure/quick-deploy/aws/multi-stages/armonik/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ module "armonik" {
ingress = merge(var.ingress, { image = local.ingress_image })
job_partitions_in_database = merge(var.job_partitions_in_database, { image = local.job_partitions_in_database_image })
authentication = merge(var.authentication, { image = local.authentication_image })

environment_description = var.environment_description
}
Original file line number Diff line number Diff line change
Expand Up @@ -432,3 +432,9 @@ extra_conf = {
}
}

environment_description = {
name = "aws-dev"
version = "0.0.0"
description = "AWS environment"
color = "#80ff80"
}
Original file line number Diff line number Diff line change
Expand Up @@ -275,4 +275,10 @@ variable "authentication" {
require_authentication = bool
require_authorization = bool
})
}
}

variable "environment_description" {
description = "Description of the environment"
type = any
default = null
}
2 changes: 2 additions & 0 deletions infrastructure/quick-deploy/localhost/all-in-one/armonik.tf
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,6 @@ module "armonik" {
# Force the dependency on Keda and metrics-server for the HPA
keda_chart_name = module.keda.keda.chart_name
metrics_server_chart_name = concat(module.metrics_server[*].metrics_server.chart_name, ["metrics-server"])[0]

environment_description = var.environment_description
}
Original file line number Diff line number Diff line change
Expand Up @@ -312,3 +312,10 @@ extra_conf = {
Submitter__MaxErrorAllowed = 50
}
}

environment_description = {
name = "local-dev"
version = "0.0.0"
description = "Local development environment"
color = "blue"
}
6 changes: 6 additions & 0 deletions infrastructure/quick-deploy/localhost/all-in-one/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -496,3 +496,9 @@ variable "helm_charts" {
version = string
}))
}

variable "environment_description" {
description = "Description of the environment"
type = any
default = null
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ module "armonik" {
ingress = var.ingress
job_partitions_in_database = var.job_partitions_in_database
authentication = var.authentication

environment_description = var.environment_description
}
Original file line number Diff line number Diff line change
Expand Up @@ -245,3 +245,10 @@ extra_conf = {
Submitter__MaxErrorAllowed = 50
}
}

environment_description = {
name = "local-dev"
version = "0.0.0"
description = "Local development environment"
color = "blue"
}
Original file line number Diff line number Diff line change
Expand Up @@ -252,3 +252,9 @@ variable "authentication" {
require_authorization = bool
})
}

variable "environment_description" {
description = "Description of the environment"
type = any
default = null
}

0 comments on commit 3b1b4da

Please sign in to comment.