Skip to content

Commit

Permalink
Merge pull request #1518 from mia-platform/main
Browse files Browse the repository at this point in the history
RN v13.0.4 preview in public docs
  • Loading branch information
albertotessarotto authored Jul 4, 2024
2 parents 0bd2dd9 + 7198f80 commit abbce3b
Show file tree
Hide file tree
Showing 34 changed files with 940 additions and 96 deletions.
12 changes: 6 additions & 6 deletions docs/cli/miactl/20_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ If you have [Golang] installed with a version >= 1.13 in your system and you hav
install `miactl` like this:

```sh
go install github.com/mia-platform/miactl/cmd/miactl@v0.12.2
go install github.com/mia-platform/miactl/cmd/miactl@v0.13.0
```

Or like this if the `install` command is not available

```sh
go get -u github.com/mia-platform/miactl/cmd/miactl@0.12.2
go get -u github.com/mia-platform/miactl/cmd/miactl@0.13.0
```

#### Binary Download
Expand All @@ -53,11 +53,11 @@ You can install `miactl` with the use of `curl` or `wget` and downloading the la
choosing the correct platform and operating system:

```sh
curl -fsSL https://github.com/mia-platform/miactl/releases/download/v0.12.2/miactl-linux-amd64 -o /tmp/miactl
curl -fsSL https://github.com/mia-platform/miactl/releases/download/v0.13.0/miactl-linux-amd64 -o /tmp/miactl
```

```sh
wget -q https://github.com/mia-platform/miactl/releases/download/v0.12.2/miactl-linux-amd64 -O /tmp/miactl
wget -q https://github.com/mia-platform/miactl/releases/download/v0.13.0/miactl-linux-amd64 -O /tmp/miactl
```

After you have downloaded the file you can validate it against the checksum you can find at this [url] running the
Expand Down Expand Up @@ -85,7 +85,7 @@ sudo mv /tmp/miactl /usr/local/bin
If you want to run the cli in its environment or you want to test the cli you can use the Docker image:

```sh
docker run ghcr.io/mia-platform/miactl:v0.12.2 miactl
docker run ghcr.io/mia-platform/miactl:v0.13.0 miactl
```

### Windows
Expand Down Expand Up @@ -184,7 +184,7 @@ only via APIs.

[Homebrew]: https://brew.sh "The Missing Package Manager for macOS (or Linux)"
[Golang]: https://go.dev "Build simple, secure, scalable systems with Go"
[url]: https://github.com/mia-platform/miactl/releases/download/v0.12.2/checksums.txt "miactl checksums"
[url]: https://github.com/mia-platform/miactl/releases/download/v0.13.0/checksums.txt "miactl checksums"
[`bash-completion`]: https://github.com/scop/bash-completion "Programmable completion functions for bash"
[`oh-my-zsh`]: https://ohmyz.sh "Oh My Zsh is a delightful, open source, community-driven
framework for managing your Zsh configuration"
Expand Down
182 changes: 181 additions & 1 deletion docs/cli/miactl/30_commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,19 @@ miactl context set CONTEXT [flags]

Available flags for the command:

- `--auth-name`, to set the name of the authentication to use (discover more on the [dedicated documentation section](#auth))
- `--endpoint`, to set the Console endpoint
- `--certificate-authority`, to provide the path to a custom CA certificate
- `--insecure-skip-tls-verify`, to disallow the check the validity of the certificate of the remote endpoint
- `--company-id`, to set the ID of the desired Company
- `--project-id`, to set the ID of the desired Project
- `--environment`, to set the environment scope for the command


:::warning
If you want to use `miactl` with a _Service Account_, **remember to specify** the `--auth-name` flag, otherwise _miactl_ will try to perform a _User Login_, opening the browser for authentication the user.
:::

### use

The `context use` subcommand allows you to select an existing context as the current one.
Expand Down Expand Up @@ -566,6 +572,180 @@ Available flags for the command:
- `--no-semver`, to force the deploy without `semver`
- `--revision`, to specify the revision of the commit to deploy

## extensions

The `extensions` command allows you to manage Company extensions.

Available subcommands are the following ones:

```sh
list List registered extensions
apply Create or update an extension
activate Activate an extension
deactivate Deactivate an extension
delete Delete extension
```

### list

The `extensions list` command helps you gathering available extension in your Company

Usage:

```sh
miactl extensions list [flags]
```

Available flags for the command:

- `--company-id` to set the ID of the desired Company

### apply

The `extensions apply` command can be used to register new extensions or update an existing one.

It accepts an Extension Manifest either in `yaml` or `json` format

<details>
<summary>Example JSON Manifest</summary>

```json
{
"name": "Extension 1",
"description": "My extension 1",
"entry": "https://example.com/",
"contexts": [
"project"
],
"routes": [
{
"id": "extension-1",
"parentId": "workloads",
"locationId": "runtime",
"renderType": "menu",
"labelIntl": {
"en": "SomeLabel",
"it": "SomeLabelInItalian"
},
"destinationPath": "/",
"order": 200.0,
"icon": {
"name": "PiHardDrives"
}
}
]
}
```

</details>

<details>
<summary>Example YAML Manifest</summary>

```yaml
name: "Extension 1"
description: "My extension 1"
entry: "https://example.com/"
contexts:
- project
routes:
- id: "extension-1"
parentId: "workloads"
locationId: "runtime"
labelIntl:
en: "SomeLabel"
it: "SomeLabelInItalian"
destinationPath: "/"
renderType: "menu"
order: 200
icon:
name: "PiHardDrives"
```
</details>
Usage:
```sh
miactl extensions apply [flags]
```

Available flags for the command:

- `--company-id` to set the ID of the desired Company
- `--file-path` (`-f`) **required** to specify the path to the extension manifest
- `--extension-id` to set the ID of the extension Company, required for updating an existing extension.

:::tip
In order to specify whether a create or an update is needed you have to use the `--extension-id`
flag or specify the `extensionId` property in the manifest file.

You can get the **extension id** by using the [extensions list](#list-5) command or
in the apply response after creating the extension.
:::

### activate

The `extensions activate` command can be used to activate an existing extension.

:::tip
Please note that, based on provided `contexts`, an extension can be activated for the whole Company or for specific Projects.

By using the `routes.locationId` option, you can specify where the extension is available, therefore
you can create an extension shown on the Project runtime and activate it for the whole Company context.
Such extension will be visible by all the Projects.

For further information checkout the [official documentation](../../console/console-extensibility/extension-activation).
:::

Usage:

```sh
miactl extensions activate [flags]
```

Available flags for the command:

- `--company-id` to set the ID of the desired Company
- `--project-id` to set the ID of the desired project, if specified, the extension will be activated only for this project only
- `--extension-id` **required** to set the ID of the extension

### deactivate

The `extensions deactivate` command can be used to deactivate an existing extension.

:::tip
Please note that if an extension has been activated on the whole Company it can't be deactivated on a specific Project;
you have to deactivate on the whole Company and activate it on the desired Projects.
:::

Usage:

```sh
miactl extensions deactivate [flags]
```

Available flags for the command:

- `--company-id` to set the ID of the desired Company
- `--project-id` to set the ID of the desired project, if specified, the extension will be deactivated only for this project only
- `--extension-id` **required** to set the ID of the extension.

### delete

The `extensions delete` command can be used to delete an existing extension.

Usage:

```sh
miactl extensions delete [flags]
```

Available flags for the command:

- `--company-id` to set the ID of the desired Company
- `--extension-id` **required** to set the ID of the extension, required for updating an existing extension.

## runtime

### environment list
Expand Down Expand Up @@ -701,7 +881,7 @@ View and manage Marketplace items

All the subcommands inherit the following flags:

```
```sh
--auth-name string the name of the miactl auth to use
--certificate-authority string path to a cert file for the certificate authority for the selected endpoint
--company-id string the ID of the Company
Expand Down
63 changes: 63 additions & 0 deletions docs/cli/miactl/40_examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,66 @@ You can customize the way your Project is deployed:
```sh
miactl deploy development --no-semver --revision tags/v1.0.0
```

## Deploy Project using a service account from a CD pipeline

The commands are the same used above in the [Deploy Project](#deploy-project) section, but you need to use a _Service Account_ for that.
If you don't know how to create a _Service Account_, read the [dedicated documentation](../../development_suite/identity-and-access-management/manage-service-accounts).

The _Service Account_ can be created with [two different authentication methods](../../development_suite/identity-and-access-management/manage-service-accounts#adding-a-service-account):
* _Client Secret Basic_: the service account authenticates by presenting its `client_id` and `client_secret`;
* _Private Key JWT_: the service account authenticates by signing a `JWT` (JSON Web Token) using its private key.


After creating the _Service Account_, the first step to setup the `miactl` is **create an auth context**.
With an _auth context_ you can choose how to be authenticated with the Mia-Platform APIs in all your different contexts you create with the `miactl`.

Based on the authentication method of your _Service Account_, you can create the auth context with the following command:

* _Client Secret Basic_:
```sh
miactl context auth <miactl-auth-name> --client-id <sa-client-id> --client-secret <sa-client-secret>
```

* _Private Key JWT_:
```sh
miactl context auth <miactl-auth-name> --jwt-json <path-to-json-containing-the-json-config-of-a-jwt-service-account>
```

Now you can create the context you want use the `miactl` to.

:::warning
Remember to specify the auth context to be used with the `---auth-name` flag, otherwise the `miactl` will try to perform a user authentication through the default browser.
:::

```sh
miactl context set <my-context-name> --endpoint https://console.private --company-id <my-company-id> --project-id <my-project-id> --auth-name <miactl-auth-name>
```

After that, just set the context as the used one:

```sh
miactl context use <my-context-name>
```

and deploy the pipeline:

```sh
miactl deploy development --no-semver --revision main
```

Finally, you can group the commands above and run them inside a pipeline, e.g. a GitLab pipeline:

```yaml
# Insert that after your pipeline stages
delivery:
stage: deploy
image: ghcr.io/mia-platform/miactl:v0.13.0
script:
- miactl version
- miactl context auth deployer-sa --client-id sa-client-id --client-secret sa-super-secret
- miactl context set my-private-console --endpoint https://console.private --company-id id-of-my-company --project-id id-of-my-project --auth-name deployer-sa
- miactl use my-private-console
- miactl deploy DEV --no-semver --deploy-type smart_deploy --revision main
```
23 changes: 22 additions & 1 deletion docs/cli/miactl/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,26 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.13.0] - 2024-06-26

### Added

- `extensions list` command
- `extensions apply` command
- `extensions delete` command
- `extensions activate` command
- `extensions deactivate` command
- `context use` autocomplete contexts with tab

### Changed

- update go version to 1.22.3
- update logr to v1.4.2
- update oauth2 to v0.20.0
- update sync to v0.7.0
- update text to v0.15.0
- introduced Printer interface with Table implementation

## [0.12.2] - 2024-03-07

## Changed
Expand Down Expand Up @@ -253,7 +273,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- create cli sdk
- create cli renderer

[unreleased]: https://github.com/mia-platform/miactl/compare/v0.12.2...HEAD
[unreleased]: https://github.com/mia-platform/miactl/compare/v0.13.0...HEAD
[0.13.0]: https://github.com/mia-platform/miactl/compare/v0.12.2...v0.13.0
[0.12.2]: https://github.com/mia-platform/miactl/compare/v0.12.1...v0.12.2
[0.12.1]: https://github.com/mia-platform/miactl/compare/v0.12.0...v0.12.1
[0.12.0]: https://github.com/mia-platform/miactl/compare/v0.11.0...v0.12.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"urandom",
"CTYPE",
"uuidgen",
"micro-lc"
"micro-lc",
"microlc"
],
"flagWords": [],
"ignorePaths": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ configurations:
keyRing: "<KMS_GCP_KEY_RING>"
keyName: "<KMS_GCP_KEY_NAME>"
privateKey: "<CRUD_ENCRYPTION_KEY>"
assistant:
enabled: true
keys:
llm: "<YOUR_OPENAI_API_KEY>"
embeddings: "<YOUR_OPENAI_API_KEY>"

apiGateway:
deploy:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,7 @@ mia-console:
| `configurations.enableFastData` | boolean | Enables Fast Data configurator | `true` | ✅ |
| `configurations.enableDebugArea` | boolean | Enables debug area in Console | `true` | ✅ |
| `configurations.enableMergeConfiguration` | boolean | Enables Merge Configuration | `true` | ✅ |
| `configurations.enableClustersAndEnvironmentsManagement` | boolean | Enables Clusters and Environments management | `true` | ✅ |
| `configurations.projectTemplateArchiveUrl` | string | New project template url | | ✅ |
| `configurations.enableRuntimeServiceClusterSelection` | boolean | Enable selection from supported runtime providers during cluster setup, if you disable it you will have to manually fill all the required information | `true` | ✅ |
| `configurations.enableBackofficeConfigurator` | boolean | Enable Backoffice Configurator | `true` | ✅ |
| `configurations.enableFlowManager` | boolean | Enable Flow Manager | `true` | ✅ |

Expand Down
Loading

0 comments on commit abbce3b

Please sign in to comment.