Azure / Azure/static-web-apps-cli
Deploying to production environment not working as expected
- Lingua principale
- TypeScript
- Stelle
- 668
- Fork
- 156
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Before filing this issue, please ensure you're using the latest CLI by running `swa --version` and comparing to the latest version on [npm](https://www.npmjs.com/package/@azure/static-web-apps-cli).
**Are you accessing the CLI from the default port `:4280` ?**
- [ ] No, I am using a different port number (`--port`) and accessing the CLI from that port
- [ ] Yes, I am accessing the CLI from port `:4280`
- [x] Yes, default port, but I'm not using the port at all
> Make sure you are accessing the URL printed in the console when running `swa start`!
**ℹ️ NOTE: Make sure to enable debug logs when running any `swa` commands using `--verbose=silly`**
**Describe the bug**
- ✅ Setting no environment with the `--env` option deploys to preview environment. **That's fine.**
- ❌ Setting environment to "Production" deploys to preview environment called "production". **NOT fine.**
- ❌ Setting environment to "production" deploys to preview environment called "production". **NOT fine.**
- ✅ Only setting environment to "prod" deploys to the production environment. **That's fine, but not documented.**
**To Reproduce**
Steps to reproduce the behavior:
1. Go to your app folder
2. Type in command 'swa deploy ./dist --env production'
3. It deploys without problem, but to a preview environment called "production"
**Expected behavior**
Looking at the documentation, I expect that setting the environment to "production" deploys the app to the production environment. I also expect that setting the environment to "Production" produces the same outcome (see #518). I'm fine with using "prod" as environment option, but this should be clearly documented then, otherwise I consider this is a bug, that cost me many hours debugging.
**Screenshots**
See screenshots in #518
**Desktop (please complete the following information):**
- OS: Docker image **node**
- Version: **lts-bullseye**
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia riproducendo `swa deploy ./dist --env production` con `--verbose=silly`, quindi esamina la gestione da parte della CLI del valore di `--env` e confrontala con l’opzione di produzione documentata. Il lavoro è completato quando `production` e `Production` puntano all’ambiente di produzione oppure quando il valore `prod` accettato è documentato chiaramente e coperto dai controlli di deployment pertinenti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- azure, typescript
- Ambito
- cli, cloud
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 42/100