# リリース前テスト

## 概要 <a href="#overview" id="overview"></a>

KCMコンテナへの早期アクセスが提供されている場合は、以下の手順を行います。

{% hint style="warning" %}
リリース前のテストは必ず非本番環境で実行するようにしてください。
{% endhint %}

{% stepper %}
{% step %}
アクセスをリクエストする

Keeperチームまでご連絡の上、Docker Hubのユーザー名をご提供ください。リリース前コンテナへの読み取り専用アクセス権が付与されたベータテスターチームに追加いたします。また、必要な構成をロードする最新の`kcm-setup.run`ファイルを提供いたします。
{% endstep %}

{% step %}
DockerHubにログインする

Keeperのリリース前リポジトリへの参加招待を受諾した後、[https://hub.docker.com](https://hub.docker.com/)へアクセスし、**\[Settings]** > **\[Security]**&#x306B;移動し&#x3066;**\[New Access Token]**&#x3092;クリックしてマシンの個人用アクセストークンを作成します。

生成されたトークンを使用して、マシンからDockerにログインします。

```
docker login --username YOUR_USERNAME
```

パスワードの入力を求められた場合は、パスワードの代わりに個人用アクセストークンを入力します。
{% endstep %}

{% step %}

#### 最新のkcm-setup.runを入手する <a href="#id-3-get-the-latest-kcm-setup.run" id="id-3-get-the-latest-kcm-setup.run"></a>

Keeperから最新のkcm-setup.runファイルを提供いたします。このファイルをサーバーにコピーし、実行ファイルのステータスを更新します。

```
chmod +x kcm-setup.run
```

{% endstep %}

{% step %}

#### コンテナをインストールする <a href="#id-4-install-the-containers" id="id-4-install-the-containers"></a>

既存のインストールか新規インストールかに応じて、以下の項目をご参照ください。

* [インストール - 新しいマシン](#installation-new-machine)
* [インストール - 既存のマシン](#installation-existing-machine)
  {% endstep %}
  {% endstepper %}

## インストール - 新しいマシン <a href="#installation-new-machine" id="installation-new-machine"></a>

### 新しいマシンのセットアップ

以下のように入力します。

```
export KCM_SETUP_IMAGE_PATTERN="keepersecurityinc/%s-dev"
sudo -E ./kcm-setup.run
```

ライセンスキーの入力を求められた場合は、Keeper サポートチームから提供されたキーを入力します。

## インストール - 既存のマシン <a href="#installation-existing-machine" id="installation-existing-machine"></a>

{% hint style="warning" %}
これらの変更を行う前に、docker-compose.ymlファイルをバックアップし、マシンのスナップショットを作成してデータベースをバックアップしてください。
{% endhint %}

`docker-compose.yml`ファイル (通常は`/etc/kcm-setup/docker-compose.yml`にあります) を更新し、以下のように画像を置き換えます。

* 下のguacdイメージで見られるように、`shm_size`および`security_opt`の部分を追加します。
* guacdイメージを`keepersecurityinc/guacd-dev`置き換えます。
* MySQLの場合、dbイメージを`keepersecurityinc/guacamole-db-mysql-dev`に置き換えます。
* PostreSQLの場合、dbイメージを`keepersecurityinc/guacamole-db-postgres-dev`に置き換えます。
* guacamoleイメージを`keepersecurityinc/guacamole-dev`に置き換えます。
* sslイメージを`keepersecurityinc/guacamole-ssl-nginx-dev`に置き換えます。
* `KCM_LICENSE`にKeeperコネクションマネージャーのライセンスキーが入力されていることを確認します。

以下はイメージ置き換えの例となります。

```
version: "3"
services:

    guacd:
        image: keepersecurityinc/guacd-dev
        restart: unless-stopped
        shm_size: 2007372k
        security_opt:
            - "seccomp:/etc/kcm-setup/guacd-docker-seccomp.json"

...
 
     db:
        image: keepersecurityinc/guacamole-db-mysql-dev
...

     guacamole:
        image: keepersecurityinc/guacamole-dev
        restart: unless-stopped
        ...
        environment:
            KCM_LICENSE: "XXXXXXXXXXXXXX"

...
    ssl:
        image: keepersecurityinc/guacamole-ssl-nginx-dev
```

上記のように`docker-compose.yml`ファイルを更新した後、以下のコマンドを使用してコンテナを更新します。

```
export KCM_SETUP_IMAGE_PATTERN="keepersecurityinc/%s-dev"

sudo docker exec kcm-guacd-1 cat /opt/keeper/share/guacd/docker-seccomp.json > guacd-docker-seccomp.json
sudo mv guacd-docker-seccomp.json /etc/kcm-setup/

sudo -E ./kcm-setup.run stop
sudo -E ./kcm-setup.run upgrade
```

これによりプレビュービルドが取得され、サービスが再起動されます。

## その後のアップデート <a href="#subsequent-updates" id="subsequent-updates"></a>

新しいビルドが公開されると、以下のコマンドを使用して更新してください (-Eは、スクリプトに正しいコンテナをロードするように指示しますので重要となります)。

```
export KCM_SETUP_IMAGE_PATTERN="keepersecurityinc/%s-dev"
sudo -E ./kcm-setup.run stop
sudo -E ./kcm-setup.run upgrade
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.keeper.io/jp/keeper-connection-manager/rirsutesuto.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
