question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CLI command to list all deployed stages

See original GitHub issue

Currently info or deploy list inform about deployed endpoints and lambdas to current stage. It’ll be great to be able to gather information about all deployed stages.

Use case is cleanup purposes. In our projects each CI deployment goes to different stage (so they do not collide in case of concurrency), each deployment is cleaned by CI, unless something goes wrong. I’d like to be able to discover such abandoned stages and remove them via sls remove -s stageToRemove.

  • Serverless Framework Version you’re using: v1.17
  • Operating System: macOS 10.12.5

Implementation proposal

Introduce sls list command which should list all deployed services and stages.

  • Should be implemented at lib/plugins/aws/list.js location.
  • Should be service agnostic (it’s irrelevant whether we call it in service context or not)

Processing flow:

  • Show notice that it’s only services which rely on default serverless bucket and cloudformation stack name that are discvered
  • Resolve all S3 buckets for given account, and find all having {service}-{stage}-serverlessdeploymentbucket- string
  • Limit list to those for which {service}-{stage} CloudFormation stack exist
  • List all discovered services, grouping them by service, stage and region

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:8
  • Comments:26 (16 by maintainers)

github_iconTop GitHub Comments

5reactions
HyperBraincommented, Jul 21, 2017

@Verlet64 @horike37 @pmuens @medikoo I would not use the --stage option at all to enable listing of all stages, as the switch already has a fixed meaning and any values can clash with real stage names. The most stable approach would be to have an additional switch that will enable all stages. I consider reusing something that already has a specific meaning as bad behavior.

So my proposal is: Add a --all switch to list everything. When given, the --stage switch must not be specified. So serverless info --all would show all stages, serverless info would show the default stage (if defined as provider.stage) and serverless info --stage=mystage would show a specific stage. Same for deploy list.

2reactions
Verlet64commented, Aug 1, 2017

Cool, I’ll get started then.

I’ll let you know if i have any questions 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

get-stages — AWS CLI 1.27.32 Command Reference
The stages ' deployment identifiers. --cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format ...
Read more >
list-stage-deployments — AWS CLI 2.8.10 Command Reference
Gets a paginated list of stage deployment summaries from the game. See also: AWS API Documentation. list-stage-deployments is a paginated operation.
Read more >
Serverless Framework Commands - AWS Lambda - Deploy List
The sls deploy list [functions] command will list information about your deployments. You can either see all available deployments in your S3 deployment...
Read more >
The Octopus Command Line (CLI)
list -latestdeployments: Lists the releases last-deployed in each environment. list-machines: Lists all machines. list-projects: Lists all ...
Read more >
OpenShift CLI developer command reference
Run oc help to list all commands or run oc <command> --help to get ... by type/name in YAML. oc apply edit-last-applied deployment/nginx...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found