File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -131,6 +131,11 @@ Follow logs (limited to _n_ lines):
131131$ stack manage --deployment-dir ~/deployments/todo logs -f -n 10
132132```
133133
134+ List service names:
135+ ```
136+ $ stack manage --dir ~/deployments/todo services
137+ ```
138+
134139Execute a command in a running container:
135140```
136141$ stack manage --dir ~/deployments/todo exec frontend 'node --version'
Original file line number Diff line number Diff line change 1515# along with this program. If not, see <http:#www.gnu.org/licenses/>.
1616
1717import click
18- from pathlib import Path
1918import sys
19+
20+ from pathlib import Path
21+
2022from stack import constants
2123from stack .deploy .images import push_images_operation
2224from stack .deploy .deploy import (
3436)
3537from stack .deploy .deploy_types import DeployCommandContext
3638from stack .deploy .deployment_context import DeploymentContext
39+ from stack .deploy .stack import Stack
3740
3841
3942@click .group ()
@@ -173,3 +176,14 @@ def reload(ctx):
173176 """reload the stack to pick up config changes"""
174177 ctx .obj = make_deploy_context (ctx )
175178 update_operation (ctx )
179+
180+
181+ @command .command ()
182+ @click .pass_context
183+ def services (ctx ):
184+ """list stack service names"""
185+ ctx .obj = make_deploy_context (ctx )
186+ stack = Stack (ctx .obj .stack ).init_from_file (ctx .obj .stack .joinpath (constants .stack_file_name ))
187+ services = list (stack .get_services ().keys ())
188+ services .sort ()
189+ print ("\n " .join (services ))
You can’t perform that action at this time.
0 commit comments