Azure / Azure/static-web-apps-cli

feat: ability to tear down preview environments

オープン
#548 コメント 2 件 リアクション 15 件 担当者 0 名 GitHub で見る
command: deploy complexity: days priority: low (P2) scope: cli type: enhancement type: RFC
主要言語
TypeScript
スター
668
フォーク
156
PR マージ指標
30日以内にマージされた PR はありません

説明

**Is your feature request related to a problem? Please describe.**
I'm frustrated that I can not tear down preview environments using the `swa` tool.

Our organization is on a private gitlab installation and due to our insane security policies I can't use the regular `image : registry.gitlab.com/static-web-apps/azure-static-web-apps-deploy` because it's blocked. So I am installing the 'swa` tool in our node images to do deployments to our SWA instance as part of a job in Gitlab's pipeline.

So, I'm trying to setup GitLab's review apps in our project. I would love for when a pull request is closed / merged the `on_stop` job runs and then removes the preview environment created for that particular job. (NB: I create the preview environment during a deploy job using the `swa` tool earlier in the pipeline)

This would also be helpful as the free tier only has a limit of 3 (three) preview environments, so keeping the number of preview environments taken up to the absolute lowest is key.

**Describe the solution you'd like**
A simple tear down flag on the deploy command so that when you run it, it removes a preview environment from your `swa` instance.

## Options

- `-tre, --tear-down-env [environment]`: Removes a preview environment based on the name provided

```
swa deploy --tear-down-env "preview-environment-name"
```

**Describe alternatives you've considered**
The only alternative I can think of is logging into the Azure portal and manually deleting the preview environments.

**Additional context**
No additional context just to saw that I'm so happy you even created the `swa` tool. It's a lifesaver for me already, and I appreciate the continued support and enhancement to this tool and our unique use cases.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

swa deploy コマンドから開始し、名前付き環境に対してプレビュー環境がどのように作成されるかを確認します。要求された環境名を受け取り、そのプレビュー環境を削除する teardown 経路を追加し、その後、GitLab on_stop のユースケースでコマンドが機能し、他の環境に影響しないことを検証します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
azure, typescript
領域
cli, cloud
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
48/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。