stoobly-agent 1.2.1__py3-none-any.whl → 1.2.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- stoobly_agent/__init__.py +1 -1
- stoobly_agent/app/cli/scaffold/docker/builder.py +1 -1
- stoobly_agent/app/cli/scaffold/templates/app/.Makefile +11 -11
- stoobly_agent/app/cli/scaffold/workflow_run_command.py +3 -0
- stoobly_agent/app/cli/scaffold_cli.py +14 -3
- {stoobly_agent-1.2.1.dist-info → stoobly_agent-1.2.3.dist-info}/METADATA +1 -1
- {stoobly_agent-1.2.1.dist-info → stoobly_agent-1.2.3.dist-info}/RECORD +10 -10
- {stoobly_agent-1.2.1.dist-info → stoobly_agent-1.2.3.dist-info}/LICENSE +0 -0
- {stoobly_agent-1.2.1.dist-info → stoobly_agent-1.2.3.dist-info}/WHEEL +0 -0
- {stoobly_agent-1.2.1.dist-info → stoobly_agent-1.2.3.dist-info}/entry_points.txt +0 -0
stoobly_agent/__init__.py
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
COMMAND = 'stoobly-agent'
|
2
|
-
VERSION = '1.2.
|
2
|
+
VERSION = '1.2.3'
|
@@ -4,7 +4,7 @@
|
|
4
4
|
# STOOBLY_CA_CERTS_DIR: path to folder where ca certs are stored
|
5
5
|
# STOOBLY_CERTS_DIR: path to a folder to store certs
|
6
6
|
# STOOBLY_CONTEXT_DIR: path to the folder containing the .stoobly folder
|
7
|
-
#
|
7
|
+
# STOOBLY_WORKFLOW_OPTIONS: extra options to pass to 'stoobly-agent scaffold workflow' commands
|
8
8
|
|
9
9
|
# Constants
|
10
10
|
DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
|
@@ -17,7 +17,7 @@ app_dir=$$(realpath "$${STOOBLY_APP_DIR:-$(CONTEXT_DIR_DEFAULT)}")
|
|
17
17
|
ca_certs_dir=$$(realpath "$${STOOBLY_CA_CERTS_DIR:-$$(realpath ~)/.mitmproxy}")
|
18
18
|
certs_dir=$$(realpath "$${STOOBLY_CERTS_DIR:-$(app_data_dir)/certs}")
|
19
19
|
context_dir=$$(realpath "$${STOOBLY_CONTEXT_DIR:-$(CONTEXT_DIR_DEFAULT)}")
|
20
|
-
|
20
|
+
workflow_options=$${STOOBLY_WORKFLOW_OPTIONS:+$$STOOBLY_WORKFLOW_OPTIONS }
|
21
21
|
|
22
22
|
app_data_dir=$(app_dir)/.stoobly
|
23
23
|
data_dir=$(context_dir)/.stoobly
|
@@ -67,37 +67,37 @@ intercept/enable:
|
|
67
67
|
$(stoobly_exec)
|
68
68
|
mock: nameservers
|
69
69
|
@export EXEC_COMMAND=bin/.up && \
|
70
|
-
export EXEC_OPTIONS="$(
|
70
|
+
export EXEC_OPTIONS="$(workflow_options)$(options)" && \
|
71
71
|
export EXEC_ARGS="mock" && \
|
72
72
|
$(stoobly_exec_run) && \
|
73
73
|
$(workflow_run)
|
74
74
|
mock/logs:
|
75
75
|
@export EXEC_COMMAND=bin/.logs && \
|
76
|
-
export EXEC_OPTIONS="$(options)" && \
|
76
|
+
export EXEC_OPTIONS="$(workflow_options)$(options)" && \
|
77
77
|
export EXEC_ARGS="mock" && \
|
78
78
|
$(stoobly_exec_run) && \
|
79
79
|
$(workflow_run)
|
80
80
|
mock/down:
|
81
81
|
@export EXEC_COMMAND=bin/.down && \
|
82
|
-
export EXEC_OPTIONS="$(options)" && \
|
82
|
+
export EXEC_OPTIONS="$(workflow_options)$(options)" && \
|
83
83
|
export EXEC_ARGS="mock" && \
|
84
84
|
$(stoobly_exec_run) && \
|
85
85
|
$(workflow_run)
|
86
86
|
record: nameservers
|
87
87
|
@export EXEC_COMMAND=bin/.up && \
|
88
|
-
export EXEC_OPTIONS="$(
|
88
|
+
export EXEC_OPTIONS="$(workflow_options)$(options)" && \
|
89
89
|
export EXEC_ARGS="record" && \
|
90
90
|
$(stoobly_exec_run) && \
|
91
91
|
$(workflow_run)
|
92
92
|
record/logs:
|
93
93
|
@export EXEC_COMMAND=bin/.logs && \
|
94
|
-
export EXEC_OPTIONS="$(options)" && \
|
94
|
+
export EXEC_OPTIONS="$(workflow_options)$(options)" && \
|
95
95
|
export EXEC_ARGS="record" && \
|
96
96
|
$(stoobly_exec_run) && \
|
97
97
|
$(workflow_run)
|
98
98
|
record/down:
|
99
99
|
@export EXEC_COMMAND=bin/.down && \
|
100
|
-
export EXEC_OPTIONS="$(options)" && \
|
100
|
+
export EXEC_OPTIONS="$(workflow_options)$(options)" && \
|
101
101
|
export EXEC_ARGS="record" && \
|
102
102
|
$(stoobly_exec_run) && \
|
103
103
|
$(workflow_run)
|
@@ -132,19 +132,19 @@ scenario/snapshot:
|
|
132
132
|
$(stoobly_exec)
|
133
133
|
test:
|
134
134
|
@export EXEC_COMMAND=bin/.up && \
|
135
|
-
export EXEC_OPTIONS="$(
|
135
|
+
export EXEC_OPTIONS="$(workflow_options)$(options)" && \
|
136
136
|
export EXEC_ARGS="test" && \
|
137
137
|
$(stoobly_exec_run) && \
|
138
138
|
$(workflow_run)
|
139
139
|
test/logs:
|
140
140
|
@export EXEC_COMMAND=bin/.logs && \
|
141
|
-
export EXEC_OPTIONS="$(options)" && \
|
141
|
+
export EXEC_OPTIONS="$(workflow_options)$(options)" && \
|
142
142
|
export EXEC_ARGS="test" && \
|
143
143
|
$(stoobly_exec_run) && \
|
144
144
|
$(workflow_run)
|
145
145
|
test/down:
|
146
146
|
@export EXEC_COMMAND=bin/.down && \
|
147
|
-
export EXEC_OPTIONS="$(options)" && \
|
147
|
+
export EXEC_OPTIONS="$(workflow_options)$(options)" && \
|
148
148
|
export EXEC_ARGS="test" && \
|
149
149
|
$(stoobly_exec_run) && \
|
150
150
|
$(workflow_run)
|
@@ -91,6 +91,9 @@ class WorkflowRunCommand(WorkflowCommand):
|
|
91
91
|
def create_network(self):
|
92
92
|
return f"docker network create {self.network} 2> /dev/null"
|
93
93
|
|
94
|
+
def remove_network(self):
|
95
|
+
return f"docker network rm {self.network} > /dev/null"
|
96
|
+
|
94
97
|
def up(self, **options: UpOptions):
|
95
98
|
if not os.path.exists(self.compose_path):
|
96
99
|
return ''
|
@@ -249,6 +249,7 @@ def copy(**kwargs):
|
|
249
249
|
Log levels can be "debug", "info", "warning", or "error"
|
250
250
|
''')
|
251
251
|
@click.option('--namespace', help='Workflow namespace.')
|
252
|
+
@click.option('--network', help='Workflow network namespace.')
|
252
253
|
@click.option('--rmi', is_flag=True, help='Remove images used by containers.')
|
253
254
|
@click.option('--service', multiple=True, help='Select which services to log. Defaults to all.')
|
254
255
|
@click.argument('workflow_name')
|
@@ -279,7 +280,6 @@ def down(**kwargs):
|
|
279
280
|
commands.append(command)
|
280
281
|
|
281
282
|
commands = sorted(commands, key=lambda command: command.service_config.priority)
|
282
|
-
|
283
283
|
for command in commands:
|
284
284
|
__print_header(f"SERVICE {command.service_name}")
|
285
285
|
|
@@ -292,6 +292,18 @@ def down(**kwargs):
|
|
292
292
|
else:
|
293
293
|
print(exec_command)
|
294
294
|
|
295
|
+
# After services are stopped, their network needs to be removed
|
296
|
+
if len(commands) > 0:
|
297
|
+
command: WorkflowRunCommand = commands[0]
|
298
|
+
remove_network_command = command.remove_network()
|
299
|
+
|
300
|
+
if not kwargs['dry_run']:
|
301
|
+
command.write_nameservers()
|
302
|
+
|
303
|
+
exec_stream(remove_network_command)
|
304
|
+
else:
|
305
|
+
print(remove_network_command)
|
306
|
+
|
295
307
|
@workflow.command()
|
296
308
|
@click.option('--app-dir-path', default=os.getcwd(), help='Path to application directory.')
|
297
309
|
@click.option(
|
@@ -332,7 +344,6 @@ def logs(**kwargs):
|
|
332
344
|
commands.append(command)
|
333
345
|
|
334
346
|
commands = sorted(commands, key=lambda command: command.service_config.priority)
|
335
|
-
|
336
347
|
for index, command in enumerate(commands):
|
337
348
|
__print_header(f"SERVICE {command.service_name}")
|
338
349
|
|
@@ -404,7 +415,7 @@ def up(**kwargs):
|
|
404
415
|
|
405
416
|
# Before services can be started, their network needs to be created
|
406
417
|
if len(commands) > 0:
|
407
|
-
command = commands[0]
|
418
|
+
command: WorkflowRunCommand = commands[0]
|
408
419
|
create_network_command = command.create_network()
|
409
420
|
|
410
421
|
if not kwargs['dry_run']:
|
@@ -1,4 +1,4 @@
|
|
1
|
-
stoobly_agent/__init__.py,sha256=
|
1
|
+
stoobly_agent/__init__.py,sha256=CneMHh5wCk5_3Nri2IBj6xzTJmILmqH9cH5EfHON1QA,44
|
2
2
|
stoobly_agent/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
3
|
stoobly_agent/app/api/__init__.py,sha256=ctkB8KR-eXO0SFhj602huHiyvQ3PslFWd8fkcufgrAI,1000
|
4
4
|
stoobly_agent/app/api/application_http_request_handler.py,sha256=jf4fkqjOiCeI2IM5Ro7ie0v_C6y0-7-5TIE_IKMPOfg,5513
|
@@ -76,7 +76,7 @@ stoobly_agent/app/cli/scaffold/config.py,sha256=HZU5tkvr3dkPr4JMXZtrJlu2wxxO-134
|
|
76
76
|
stoobly_agent/app/cli/scaffold/constants.py,sha256=KBZj-eQoDmoUOJgcekyfeyi1UB0_UlxqrcWZyXEmBXA,1950
|
77
77
|
stoobly_agent/app/cli/scaffold/docker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
78
78
|
stoobly_agent/app/cli/scaffold/docker/app_builder.py,sha256=IsXZFUumWEBA8NYDFdAohuKmxocoqHqlVFg0-E92QLI,621
|
79
|
-
stoobly_agent/app/cli/scaffold/docker/builder.py,sha256=
|
79
|
+
stoobly_agent/app/cli/scaffold/docker/builder.py,sha256=OE7r8vEdEkW3vwpmIctePiO0S5jvao5zMJNpxc-Yayw,2851
|
80
80
|
stoobly_agent/app/cli/scaffold/docker/constants.py,sha256=fGHH_DlGd4mTogggJLHLigUscZmBrigkNmDwKQq6src,461
|
81
81
|
stoobly_agent/app/cli/scaffold/docker/service/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
82
82
|
stoobly_agent/app/cli/scaffold/docker/service/build_decorator.py,sha256=ZU7z4bkvdS3OK5O4fJhlA9_PNwnFtZW6t7vNF7V5obQ,1003
|
@@ -104,7 +104,7 @@ stoobly_agent/app/cli/scaffold/service_workflow_validate_command.py,sha256=z7Z_v
|
|
104
104
|
stoobly_agent/app/cli/scaffold/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
105
105
|
stoobly_agent/app/cli/scaffold/templates/app/.Dockerfile.context,sha256=a4PUVIJ_0CEIwUTCEhvtiGJSnu--AWFE1lKv-8q17fU,193
|
106
106
|
stoobly_agent/app/cli/scaffold/templates/app/.Dockerfile.proxy,sha256=L0yDlJfPD775NM-HgPx4E5-r-AflVBGfBf5DYl1nfME,1027
|
107
|
-
stoobly_agent/app/cli/scaffold/templates/app/.Makefile,sha256=
|
107
|
+
stoobly_agent/app/cli/scaffold/templates/app/.Makefile,sha256=fRazlUstXloCAtH1fmB5LAPlGclMflAYr7wtSbn16AI,5601
|
108
108
|
stoobly_agent/app/cli/scaffold/templates/app/.docker-compose.base.yml,sha256=LNNuygX6hMtmElxaO6jTIYq3psYmxNv7xax7ra6JzO4,407
|
109
109
|
stoobly_agent/app/cli/scaffold/templates/app/Makefile,sha256=t7xRaCc9q3k7W34S0h9KX02GljSVwGpPnFmiLUvWxsw,80
|
110
110
|
stoobly_agent/app/cli/scaffold/templates/app/build/.config.yml,sha256=8Wt8ZZ5irvBYYS44xGrR_EWlZDuXH9kyWmquzsh7s8g,19
|
@@ -193,9 +193,9 @@ stoobly_agent/app/cli/scaffold/workflow_copy_command.py,sha256=R9hh5dWVz7vGld7pE
|
|
193
193
|
stoobly_agent/app/cli/scaffold/workflow_create_command.py,sha256=5xnRYrVb2KlSDARZFjLGGWeURXRu63OHoRLEhO-EAvw,3401
|
194
194
|
stoobly_agent/app/cli/scaffold/workflow_env.py,sha256=x8V5pJmIiklD3f2q2-qq-CORf4YaXYq_r2JpR2MmSwk,416
|
195
195
|
stoobly_agent/app/cli/scaffold/workflow_log_command.py,sha256=Bke4lMOMxuDUFuAx9nlXHbKgYMO4KAg9ASHvjz4aVWc,1372
|
196
|
-
stoobly_agent/app/cli/scaffold/workflow_run_command.py,sha256=
|
196
|
+
stoobly_agent/app/cli/scaffold/workflow_run_command.py,sha256=CJjemLFjcr7YlakTNIAhT71e2Y6z3nWGt9mzxsmJ0-8,8383
|
197
197
|
stoobly_agent/app/cli/scaffold/workflow_validate_command.py,sha256=fhHciJXg_u32Wmh8us8LhgQj8D1SxkBADtuBBF4K0FM,4377
|
198
|
-
stoobly_agent/app/cli/scaffold_cli.py,sha256=
|
198
|
+
stoobly_agent/app/cli/scaffold_cli.py,sha256=rCSGrw9DQJx2r_M9V2Rm0-MtUCPf8iohT6l6tEzn_u0,20244
|
199
199
|
stoobly_agent/app/cli/scenario_cli.py,sha256=3J1EiJOvunkfWrEkOsanw-XrKkOk78ij_GjBlE9p7CE,8229
|
200
200
|
stoobly_agent/app/cli/snapshot_cli.py,sha256=XNxpTm5z3bnBGNGI3_XZIif0ypN62WqYfDmShL5fXg4,9965
|
201
201
|
stoobly_agent/app/cli/trace_cli.py,sha256=K7E-vx3JUcqEDSWOdIOi_AieKNQz7dBfmRrVvKDkzFI,4605
|
@@ -729,8 +729,8 @@ stoobly_agent/test/mock_data/scaffold/docker-compose-local-service.yml,sha256=x7
|
|
729
729
|
stoobly_agent/test/mock_data/scaffold/index.html,sha256=qJwuYajKZ4ihWZrJQ3BNObV5kf1VGnnm_vqlPJzdqLE,258
|
730
730
|
stoobly_agent/test/mock_data/uspto.yaml,sha256=6U5se7C3o-86J4m9xpOk9Npias399f5CbfWzR87WKwE,7835
|
731
731
|
stoobly_agent/test/test_helper.py,sha256=m_oAI7tmRYCNZdKfNqISWhMv3e44tjeYViQ3nTUfnos,1007
|
732
|
-
stoobly_agent-1.2.
|
733
|
-
stoobly_agent-1.2.
|
734
|
-
stoobly_agent-1.2.
|
735
|
-
stoobly_agent-1.2.
|
736
|
-
stoobly_agent-1.2.
|
732
|
+
stoobly_agent-1.2.3.dist-info/LICENSE,sha256=8QKGyy45eN76Zk52h8gu1DKX2B_gbWgZ3nzDLofEbaE,548
|
733
|
+
stoobly_agent-1.2.3.dist-info/METADATA,sha256=NTZtZPT5h79vhU9uCuYb2cM5iFDUdTqyirMsZmEyoTU,3384
|
734
|
+
stoobly_agent-1.2.3.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
735
|
+
stoobly_agent-1.2.3.dist-info/entry_points.txt,sha256=aq5wix5oC8MDQtmyPGU0xaFrsjJg7WH28NmXh2sc3Z8,56
|
736
|
+
stoobly_agent-1.2.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|