> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ale.run/llms.txt
> Use this file to discover all available pages before exploring further.

# デプロイ

> エール CLIを使用したサービスのデプロイと管理ガイド

## デプロイ

### サービスのデプロイ

<Steps>
  <Step title="デプロイしたいサービスのYAMLファイルパスをパラメータとして指定し、コマンドを実行します">
    ```bash theme={null}
    ale apply -f <YAMLファイルパス>
    # apply -f ./node-express.yaml
    ```
  </Step>

  <Step title="プロジェクトのデプロイが開始されると、以下のようなメッセージが表示されます">
    ```bash theme={null}
    1 apps deployed to @admin/test
      └ app "node-express" deployed to stage main
    ```
  </Step>
</Steps>

### サービスの更新

<Steps>
  <Step title="更新したいサービスのYAMLファイルパスをパラメータとして指定し、コマンドを実行します">
    ```bash theme={null}
    ale apply -f <YAMLファイルパス>
    # ale apply -f ./node-express.yaml
    ```
  </Step>

  <Step title="更新された内容でデプロイが開始されると、以下のようなメッセージが表示されます">
    ```bash theme={null}
    1 apps deployed to @admin/test
      └ app "node-express" deployed to stage main
    ```
  </Step>
</Steps>

### サービスの削除

<Steps>
  <Step title="削除したいサービス名をパラメータとして指定し、コマンドを実行します">
    ```bash theme={null}
    ale remove <サービス名>
    # ale remove node-express
    ```
  </Step>

  <Step title="サービスが正常に削除されると、以下のような結果が表示されます">
    ```bash theme={null}
    deployment "node-express" removed from @admin/test:main.
    1 deployments removed
    ```
  </Step>
</Steps>

***

## サービス情報とアクセス

### サービスログの確認

<Steps>
  <Step title="ログを確認したいサービス名をパラメータとして指定し、以下のコマンドを実行します">
    ```bash theme={null}
    ale logs <サービス名>
    # ale logs node-express
    ```
  </Step>

  <Step title="サービスが正常に実行されている場合、ログが表示されます">
    ```bash theme={null}

    > myapp@0.0.0 start
    > node ./bin/www

    ```
  </Step>
</Steps>

### サービスターミナルへの接続

<Steps>
  <Step title="ターミナルでアクセスしたいサービス名をパラメータとして指定し、以下のコマンドを実行します">
    ```bash theme={null}
    ale logs <サービス名>
    # ale terminal node-express
    ```
  </Step>

  <Step title="サービスが正常に実行されている場合、ターミナルを通じてサービスに接続されます。">
    ```bash theme={null}
    node@node-express:/app$
    ```
  </Step>
</Steps>
