Azure / Azure/static-web-apps-cli
feat: ability to tear down preview environments
- Langage dominant
- TypeScript
- Étoiles
- 668
- Forks
- 156
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
**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.
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par la commande swa deploy et examinez la façon dont les environnements de prévisualisation sont créés pour un environnement nommé. Ajoutez un chemin de suppression qui accepte le nom de l’environnement demandé et supprime cet environnement de prévisualisation, puis vérifiez que la commande fonctionne pour le cas d’utilisation GitLab on_stop et n’affecte pas les autres environnements.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- azure, typescript
- Domaine
- cli, cloud
- Type d'issue
- Fonctionnalité
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- Calme
- Clarté
- Plutôt claire
- Accessibilité débutants
- 48/100