stoobly-agent 1.5.5__py3-none-any.whl → 1.5.6__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/containerized_app.py +5 -0
- stoobly_agent/app/cli/scaffold/templates/app/.Makefile +7 -7
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/mock/bin/.configure +2 -2
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/record/bin/.configure +2 -2
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/test/bin/.configure +2 -2
- stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/exec/bin/.down +2 -3
- stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/exec/bin/.logs +1 -3
- stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/exec/bin/.up +4 -7
- stoobly_agent/app/cli/scaffold/templates/workflow/record/bin/configure +2 -2
- stoobly_agent/app/cli/scaffold_cli.py +81 -50
- stoobly_agent/test/app/models/schemas/.stoobly/db/VERSION +1 -1
- {stoobly_agent-1.5.5.dist-info → stoobly_agent-1.5.6.dist-info}/METADATA +1 -1
- {stoobly_agent-1.5.5.dist-info → stoobly_agent-1.5.6.dist-info}/RECORD +17 -16
- {stoobly_agent-1.5.5.dist-info → stoobly_agent-1.5.6.dist-info}/WHEEL +1 -1
- {stoobly_agent-1.5.5.dist-info → stoobly_agent-1.5.6.dist-info}/LICENSE +0 -0
- {stoobly_agent-1.5.5.dist-info → stoobly_agent-1.5.6.dist-info}/entry_points.txt +0 -0
stoobly_agent/__init__.py
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
COMMAND = 'stoobly-agent'
|
2
|
-
VERSION = '1.5.
|
2
|
+
VERSION = '1.5.6'
|
@@ -23,15 +23,15 @@ workflow_service_options=$(shell echo $$STOOBLY_WORKFLOW_SERVICE_OPTIONS)
|
|
23
23
|
|
24
24
|
user_id_option=--user-id $(USER_ID)
|
25
25
|
stoobly_exec_options=--profile $(EXEC_WORKFLOW_NAME) -p $(EXEC_WORKFLOW_NAME)
|
26
|
-
|
27
|
-
workflow_up_options=--app-dir-path $(app_dir) --context-dir-path $(context_dir) --ca-certs-dir-path $(ca_certs_dir) --certs-dir-path $(certs_dir)
|
26
|
+
workflow_run_options=--script-path $(workflow_script) $(workflow_service_options)
|
27
|
+
workflow_up_options=--app-dir-path $(app_dir) --context-dir-path $(context_dir) --ca-certs-dir-path $(ca_certs_dir) --certs-dir-path $(certs_dir) $(user_id_option)
|
28
28
|
|
29
29
|
app_data_dir=$(app_dir)/.stoobly
|
30
30
|
app_namespace_dir=$(app_data_dir)/docker
|
31
31
|
app_tmp_dir=$(app_data_dir)/tmp
|
32
32
|
dockerfile_path=$(app_namespace_dir)/.Dockerfile.context
|
33
33
|
docker_compose_file_path=$(app_namespace_dir)/stoobly-ui/exec/.docker-compose.exec.yml
|
34
|
-
|
34
|
+
workflow_script=.stoobly/tmp/$(WORKFLOW).sh
|
35
35
|
|
36
36
|
# Commands
|
37
37
|
docker_command=docker
|
@@ -55,7 +55,7 @@ stoobly_exec_run=$(stoobly_exec_build) && $(stoobly_exec_run_env) $(exec_up)
|
|
55
55
|
stoobly_exec_run_env=$(source_env) && $(exec_env) CONTEXT_DIR="$(app_dir)"
|
56
56
|
|
57
57
|
# Workflow run
|
58
|
-
workflow_run=$(source_env) && bash "$(
|
58
|
+
workflow_run=$(source_env) && bash "$(app_dir)/$(workflow_script)"
|
59
59
|
|
60
60
|
ca-cert/install: stoobly/install
|
61
61
|
@if [ -z "$$(ls $(ca_certs_dir) 2> /dev/null)" ]; then \
|
@@ -153,7 +153,7 @@ tmpdir:
|
|
153
153
|
@mkdir -p $(app_tmp_dir)
|
154
154
|
workflow/down:
|
155
155
|
@export EXEC_COMMAND=bin/.down && \
|
156
|
-
export EXEC_OPTIONS="$(
|
156
|
+
export EXEC_OPTIONS="$(user_id_option) $(workflow_run_options) $(options)" && \
|
157
157
|
export EXEC_ARGS="$(WORKFLOW)" && \
|
158
158
|
$(stoobly_exec_run) && \
|
159
159
|
$(workflow_run)
|
@@ -173,7 +173,7 @@ workflow/hostname/install: command/install workflow/hostname
|
|
173
173
|
workflow/hostname/uninstall: command/uninstall workflow/hostname
|
174
174
|
workflow/logs:
|
175
175
|
@export EXEC_COMMAND=bin/.logs && \
|
176
|
-
export EXEC_OPTIONS="$(
|
176
|
+
export EXEC_OPTIONS="$(workflow_run_options) $(options)" && \
|
177
177
|
export EXEC_ARGS="$(WORKFLOW)" && \
|
178
178
|
$(stoobly_exec_run) && \
|
179
179
|
$(workflow_run)
|
@@ -190,7 +190,7 @@ workflow/test:
|
|
190
190
|
$(eval WORKFLOW=test)
|
191
191
|
workflow/up:
|
192
192
|
@export EXEC_COMMAND=bin/.up && \
|
193
|
-
export EXEC_OPTIONS="$(workflow_up_options) $(
|
193
|
+
export EXEC_OPTIONS="$(user_id_option) $(workflow_up_options) $(workflow_run_options) $(options)" && \
|
194
194
|
export EXEC_ARGS="$(WORKFLOW)" && \
|
195
195
|
$(stoobly_exec_run) && \
|
196
196
|
$(workflow_run)
|
@@ -1,9 +1,9 @@
|
|
1
1
|
#!/bin/bash
|
2
2
|
|
3
|
-
echo "Configuring intercept
|
3
|
+
echo "Configuring intercept..."
|
4
4
|
stoobly-agent intercept configure --mode mock --policy all
|
5
5
|
|
6
|
-
echo "Enabling intercept"
|
6
|
+
echo "Enabling intercept..."
|
7
7
|
stoobly-agent intercept enable
|
8
8
|
|
9
9
|
entrypoint=$(dirname -- "$0")/configure
|
@@ -1,9 +1,9 @@
|
|
1
1
|
#!/bin/bash
|
2
2
|
|
3
|
-
echo "Configuring intercept
|
3
|
+
echo "Configuring intercept..."
|
4
4
|
stoobly-agent intercept configure --mode record --policy all
|
5
5
|
|
6
|
-
echo "Disabling intercept"
|
6
|
+
echo "Disabling intercept..."
|
7
7
|
stoobly-agent intercept disable
|
8
8
|
|
9
9
|
entrypoint=$(dirname -- "$0")/configure
|
@@ -1,9 +1,9 @@
|
|
1
1
|
#!/bin/bash
|
2
2
|
|
3
|
-
echo "Configuring intercept
|
3
|
+
echo "Configuring intercept..."
|
4
4
|
stoobly-agent intercept configure --mode mock --policy all
|
5
5
|
|
6
|
-
echo "Enabling intercept"
|
6
|
+
echo "Enabling intercept..."
|
7
7
|
stoobly-agent intercept enable
|
8
8
|
|
9
9
|
entrypoint=$(dirname -- "$0")/configure
|
@@ -1,13 +1,12 @@
|
|
1
1
|
#!/bin/bash
|
2
2
|
|
3
3
|
extra_options=$EXEC_OPTIONS
|
4
|
-
workflow=$1
|
5
4
|
|
6
5
|
mkdir -p .stoobly/tmp
|
7
6
|
|
8
7
|
stoobly-agent scaffold workflow down \
|
9
8
|
--app-dir-path "$(pwd)" \
|
9
|
+
--containerized \
|
10
10
|
--dry-run \
|
11
11
|
--log-level error \
|
12
|
-
$extra_options
|
13
|
-
$workflow > .stoobly/tmp/run.sh
|
12
|
+
$extra_options $1 > /dev/null
|
@@ -1,15 +1,12 @@
|
|
1
1
|
#!/bin/bash
|
2
2
|
|
3
3
|
extra_options=$EXEC_OPTIONS
|
4
|
-
workflow=$1
|
5
|
-
|
6
|
-
mkdir -p .stoobly/tmp
|
7
|
-
|
8
|
-
stoobly-agent scaffold app mkcert
|
9
4
|
|
10
5
|
stoobly-agent scaffold workflow up \
|
11
6
|
--app-dir-path "$(pwd)" \
|
7
|
+
--containerized \
|
12
8
|
--dry-run \
|
13
9
|
--log-level warning \
|
14
|
-
|
15
|
-
|
10
|
+
--mkcert \
|
11
|
+
--without-base \
|
12
|
+
$extra_options $1 > /dev/null
|
@@ -13,7 +13,7 @@ if [ "$scheme" = 'http' -a "$port" != '80' ] || [ "$scheme" = 'https' -a "$port"
|
|
13
13
|
fi
|
14
14
|
|
15
15
|
# Firewall
|
16
|
-
echo "Configuring firewall rules"
|
16
|
+
echo "Configuring firewall rules..."
|
17
17
|
stoobly-agent config firewall set \
|
18
18
|
--action include \
|
19
19
|
--method GET --method POST --method OPTIONS --method PUT --method DELETE \
|
@@ -21,7 +21,7 @@ stoobly-agent config firewall set \
|
|
21
21
|
--pattern "$url/.*?"
|
22
22
|
|
23
23
|
# Rewrite
|
24
|
-
echo "Configuring rewrite rules"
|
24
|
+
echo "Configuring rewrite rules..."
|
25
25
|
stoobly-agent config rewrite set \
|
26
26
|
--method GET --method POST --method OPTIONS --method PUT --method DELETE \
|
27
27
|
--mode record \
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import click
|
2
|
-
import errno
|
3
2
|
import os
|
4
3
|
import pdb
|
5
4
|
import sys
|
6
5
|
|
6
|
+
from io import TextIOWrapper
|
7
7
|
from typing import List
|
8
8
|
|
9
9
|
from stoobly_agent.app.cli.helpers.certificate_authority import CertificateAuthority
|
@@ -13,6 +13,7 @@ from stoobly_agent.app.cli.scaffold.app_create_command import AppCreateCommand
|
|
13
13
|
from stoobly_agent.app.cli.scaffold.constants import (
|
14
14
|
DOCKER_NAMESPACE, WORKFLOW_CONTAINER_PROXY, WORKFLOW_MOCK_TYPE, WORKFLOW_RECORD_TYPE, WORKFLOW_TEST_TYPE
|
15
15
|
)
|
16
|
+
from stoobly_agent.app.cli.scaffold.containerized_app import ContainerizedApp
|
16
17
|
from stoobly_agent.app.cli.scaffold.docker.service.set_gateway_ports import set_gateway_ports
|
17
18
|
from stoobly_agent.app.cli.scaffold.docker.workflow.decorators_factory import get_workflow_decorators
|
18
19
|
from stoobly_agent.app.cli.scaffold.hosts_file_manager import HostsFileManager
|
@@ -117,24 +118,7 @@ def mkcert(**kwargs):
|
|
117
118
|
app, service=kwargs['service'], without_core=True, workflow=kwargs['workflow']
|
118
119
|
)
|
119
120
|
|
120
|
-
|
121
|
-
service = Service(service_name, app)
|
122
|
-
__validate_service_dir(service.dir_path)
|
123
|
-
|
124
|
-
service_config = ServiceConfig(service.dir_path)
|
125
|
-
|
126
|
-
if service_config.scheme != 'https':
|
127
|
-
continue
|
128
|
-
|
129
|
-
hostname = service_config.hostname
|
130
|
-
|
131
|
-
if not hostname:
|
132
|
-
continue
|
133
|
-
|
134
|
-
ca = CertificateAuthority(app.ca_certs_dir_path)
|
135
|
-
if not ca.signed(hostname, app.certs_dir_path):
|
136
|
-
Logger.instance(LOG_ID).info(f"Creating cert for {hostname}")
|
137
|
-
ca.sign(hostname, app.certs_dir_path)
|
121
|
+
__services_mkcert(app, services)
|
138
122
|
|
139
123
|
@service.command(
|
140
124
|
help="Scaffold a service",
|
@@ -290,15 +274,16 @@ def copy(**kwargs):
|
|
290
274
|
@workflow.command()
|
291
275
|
@click.option('--app-dir-path', default=current_working_dir, help='Path to application directory.')
|
292
276
|
@click.option('--context-dir-path', default=data_dir.context_dir_path, help='Path to Stoobly data directory.')
|
277
|
+
@click.option('--containerized', is_flag=True, help='Set if run from within a container.')
|
293
278
|
@click.option('--dry-run', default=False, is_flag=True)
|
294
279
|
@click.option('--extra-entrypoint-compose-path', help='Path to extra entrypoint compose file.')
|
295
|
-
@click.option('--from-make', is_flag=True, help='Set if run from scaffolded Makefile.')
|
296
280
|
@click.option('--log-level', default=INFO, type=click.Choice([DEBUG, INFO, WARNING, ERROR]), help='''
|
297
281
|
Log levels can be "debug", "info", "warning", or "error"
|
298
282
|
''')
|
299
283
|
@click.option('--namespace', help='Workflow namespace.')
|
300
284
|
@click.option('--network', help='Workflow network name.')
|
301
285
|
@click.option('--rmi', is_flag=True, help='Remove images used by containers.')
|
286
|
+
@click.option('--script-path', help='Path to intermediate script path.')
|
302
287
|
@click.option('--service', multiple=True, help='Select which services to log. Defaults to all.')
|
303
288
|
@click.option('--user-id', default=os.getuid(), help='OS user ID of the owner of context dir path.')
|
304
289
|
@click.argument('workflow_name')
|
@@ -324,6 +309,8 @@ def down(**kwargs):
|
|
324
309
|
command.current_working_dir = current_working_dir
|
325
310
|
commands.append(command)
|
326
311
|
|
312
|
+
script = __build_script(**kwargs)
|
313
|
+
|
327
314
|
commands = sorted(commands, key=lambda command: command.service_config.priority)
|
328
315
|
for index, command in enumerate(commands):
|
329
316
|
__print_header(f"SERVICE {command.service_name}")
|
@@ -343,11 +330,8 @@ def down(**kwargs):
|
|
343
330
|
)
|
344
331
|
if not exec_command:
|
345
332
|
continue
|
346
|
-
|
347
|
-
|
348
|
-
exec_stream(exec_command)
|
349
|
-
else:
|
350
|
-
print(exec_command)
|
333
|
+
|
334
|
+
print(exec_command, file=script)
|
351
335
|
|
352
336
|
# After services are stopped, their network needs to be removed
|
353
337
|
if len(commands) > 0:
|
@@ -355,19 +339,15 @@ def down(**kwargs):
|
|
355
339
|
|
356
340
|
if kwargs['rmi']:
|
357
341
|
remove_image_command = command.remove_image(kwargs['user_id'])
|
358
|
-
|
359
|
-
exec_stream(remove_image_command)
|
360
|
-
else:
|
361
|
-
print(remove_image_command)
|
342
|
+
print(remove_image_command, file=script)
|
362
343
|
|
363
344
|
remove_network_command = command.remove_network()
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
print(remove_network_command)
|
345
|
+
print(remove_network_command, file=script)
|
346
|
+
|
347
|
+
__run_script(script, kwargs['dry_run'])
|
368
348
|
|
369
349
|
# Options are no longer valid
|
370
|
-
if kwargs['
|
350
|
+
if kwargs['containerized'] and os.path.exists(data_dir.mitmproxy_options_json_path):
|
371
351
|
os.remove(data_dir.mitmproxy_options_json_path)
|
372
352
|
|
373
353
|
@workflow.command()
|
@@ -381,6 +361,7 @@ def down(**kwargs):
|
|
381
361
|
Log levels can be "debug", "info", "warning", or "error"
|
382
362
|
''')
|
383
363
|
@click.option('--namespace', help='Workflow namespace.')
|
364
|
+
@click.option('--script-path', help='Path to intermediate script path.')
|
384
365
|
@click.option('--service', multiple=True, help='Select which services to log. Defaults to all.')
|
385
366
|
@click.argument('workflow_name')
|
386
367
|
def logs(**kwargs):
|
@@ -412,6 +393,8 @@ def logs(**kwargs):
|
|
412
393
|
command = WorkflowLogCommand(app, **config)
|
413
394
|
commands.append(command)
|
414
395
|
|
396
|
+
script = __build_script(**kwargs)
|
397
|
+
|
415
398
|
commands = sorted(commands, key=lambda command: command.service_config.priority)
|
416
399
|
for index, command in enumerate(commands):
|
417
400
|
__print_header(f"SERVICE {command.service_name}")
|
@@ -422,39 +405,41 @@ def logs(**kwargs):
|
|
422
405
|
)
|
423
406
|
|
424
407
|
for shell_command in shell_commands:
|
425
|
-
print(shell_command)
|
408
|
+
print(shell_command, file=script)
|
426
409
|
|
427
|
-
|
428
|
-
exec_stream(shell_command)
|
410
|
+
__run_script(script, kwargs['dry_run'])
|
429
411
|
|
430
412
|
@workflow.command()
|
431
413
|
@click.option('--app-dir-path', default=current_working_dir, help='Path to application directory.')
|
432
414
|
@click.option('--build', is_flag=True, help='Build images before starting containers.')
|
433
415
|
@click.option('--ca-certs-dir-path', default=data_dir.ca_certs_dir_path, help='Path to ca certs directory used to sign SSL certs.')
|
434
416
|
@click.option('--certs-dir-path', help='Path to certs directory. Defaults to the certs dir of the context.')
|
417
|
+
@click.option('--containerized', is_flag=True, help='Set if run from within a container.')
|
435
418
|
@click.option('--context-dir-path', default=data_dir.context_dir_path, help='Path to Stoobly data directory.')
|
436
419
|
@click.option('--detached', is_flag=True, help='If set, will not run the highest priority service in the foreground.')
|
437
420
|
@click.option('--dry-run', default=False, is_flag=True, help='If set, prints commands.')
|
438
421
|
@click.option('--extra-entrypoint-compose-path', help='Path to extra entrypoint compose file.')
|
439
|
-
@click.option('--from-make', is_flag=True, help='Set if run from scaffolded Makefile.')
|
440
422
|
@click.option('--log-level', default=INFO, type=click.Choice([DEBUG, INFO, WARNING, ERROR]), help='''
|
441
423
|
Log levels can be "debug", "info", "warning", or "error"
|
442
424
|
''')
|
425
|
+
@click.option('--mkcert', is_flag=True, help='Set to generate SSL certs for HTTPS services.')
|
443
426
|
@click.option('--namespace', help='Workflow namespace.')
|
444
427
|
@click.option('--network', help='Workflow network name.')
|
445
428
|
@click.option('--pull', is_flag=True, help='Pull image before running.')
|
429
|
+
@click.option('--script-path', help='Path to intermediate script path.')
|
446
430
|
@click.option('--service', multiple=True, help='Select which services to run. Defaults to all.')
|
447
431
|
@click.option('--user-id', default=os.getuid(), help='OS user ID of the owner of context dir path.')
|
448
432
|
@click.option('--verbose', is_flag=True)
|
433
|
+
@click.option('--without-base', is_flag=True, help='Disable building Stoobly base image.')
|
449
434
|
@click.argument('workflow_name')
|
450
435
|
def up(**kwargs):
|
451
436
|
os.environ[env_vars.LOG_LEVEL] = kwargs['log_level']
|
452
437
|
|
453
|
-
|
438
|
+
containerized = kwargs['containerized']
|
454
439
|
|
455
440
|
# Because we are running a docker-compose command which depends on APP_DIR env var
|
456
|
-
# when we are running this command
|
457
|
-
app_dir_path = current_working_dir if
|
441
|
+
# when we are running this command within a container, the host's app_dir_path will likely differ
|
442
|
+
app_dir_path = current_working_dir if containerized else kwargs['app_dir_path']
|
458
443
|
app = App(app_dir_path, DOCKER_NAMESPACE, **kwargs)
|
459
444
|
__validate_app(app)
|
460
445
|
|
@@ -466,6 +451,10 @@ def up(**kwargs):
|
|
466
451
|
app, service=kwargs['service'], workflow=[kwargs['workflow_name']]
|
467
452
|
)
|
468
453
|
|
454
|
+
if kwargs['mkcert']:
|
455
|
+
_app = ContainerizedApp(app_dir_path, DOCKER_NAMESPACE) if containerized else app
|
456
|
+
__services_mkcert(_app, services)
|
457
|
+
|
469
458
|
# Gateway ports are dynamically set depending on the workflow run
|
470
459
|
workflow = Workflow(kwargs['workflow_name'], app)
|
471
460
|
set_gateway_ports(workflow.service_paths_from_services(services))
|
@@ -478,23 +467,24 @@ def up(**kwargs):
|
|
478
467
|
command.current_working_dir = current_working_dir
|
479
468
|
commands.append(command)
|
480
469
|
|
470
|
+
script = __build_script(**kwargs)
|
471
|
+
|
481
472
|
# Before services can be started, their image and network needs to be created
|
482
473
|
if len(commands) > 0:
|
483
474
|
command: WorkflowRunCommand = commands[0]
|
484
475
|
|
485
476
|
init_commands = []
|
486
|
-
if not
|
477
|
+
if not kwargs['without_base']:
|
487
478
|
create_image_command = command.create_image(user_id=kwargs['user_id'], verbose=kwargs['verbose'])
|
488
479
|
init_commands.append(create_image_command)
|
489
480
|
|
490
481
|
init_commands.append(command.create_network())
|
491
482
|
joined_command = ' && '.join(init_commands)
|
492
483
|
|
493
|
-
if not
|
484
|
+
if not containerized:
|
494
485
|
command.write_nameservers()
|
495
|
-
|
496
|
-
|
497
|
-
print(joined_command)
|
486
|
+
|
487
|
+
print(joined_command, file=script)
|
498
488
|
|
499
489
|
commands = sorted(commands, key=lambda command: command.service_config.priority)
|
500
490
|
for index, command in enumerate(commands):
|
@@ -520,10 +510,9 @@ def up(**kwargs):
|
|
520
510
|
if not exec_command:
|
521
511
|
continue
|
522
512
|
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
print(exec_command)
|
513
|
+
print(exec_command, file=script)
|
514
|
+
|
515
|
+
__run_script(script, kwargs['dry_run'])
|
527
516
|
|
528
517
|
@workflow.command(
|
529
518
|
help="Validate a scaffold workflow"
|
@@ -625,6 +614,18 @@ scaffold.add_command(service)
|
|
625
614
|
scaffold.add_command(workflow)
|
626
615
|
scaffold.add_command(hostname)
|
627
616
|
|
617
|
+
def __build_script(**kwargs):
|
618
|
+
script_path = kwargs['script_path']
|
619
|
+
if not script_path:
|
620
|
+
script_file_name = f"{kwargs['workflow_name']}.sh"
|
621
|
+
script_path = os.path.join(data_dir.tmp_dir_path, script_file_name)
|
622
|
+
|
623
|
+
# Truncate
|
624
|
+
with open(script_path, 'w'):
|
625
|
+
pass
|
626
|
+
|
627
|
+
return open(script_path, 'a')
|
628
|
+
|
628
629
|
def __elevate_sudo():
|
629
630
|
import subprocess
|
630
631
|
|
@@ -667,6 +668,16 @@ def __get_services(app: App, **kwargs):
|
|
667
668
|
def __print_header(text: str):
|
668
669
|
Logger.instance(LOG_ID).info(f"{bcolors.OKBLUE}{text}{bcolors.ENDC}")
|
669
670
|
|
671
|
+
def __run_script(script: TextIOWrapper, dry_run = False):
|
672
|
+
script.close()
|
673
|
+
|
674
|
+
with open(script.name, 'r') as fp:
|
675
|
+
for line in fp:
|
676
|
+
if not dry_run:
|
677
|
+
exec_stream(line.strip())
|
678
|
+
else:
|
679
|
+
print(line.strip())
|
680
|
+
|
670
681
|
def __scaffold_build(app, **kwargs):
|
671
682
|
command = ServiceCreateCommand(app, **kwargs)
|
672
683
|
|
@@ -677,6 +688,26 @@ def __scaffold_delete(app, **kwargs):
|
|
677
688
|
|
678
689
|
command.delete()
|
679
690
|
|
691
|
+
def __services_mkcert(app: App, services):
|
692
|
+
for service_name in services:
|
693
|
+
service = Service(service_name, app)
|
694
|
+
__validate_service_dir(service.dir_path)
|
695
|
+
|
696
|
+
service_config = ServiceConfig(service.dir_path)
|
697
|
+
|
698
|
+
if service_config.scheme != 'https':
|
699
|
+
continue
|
700
|
+
|
701
|
+
hostname = service_config.hostname
|
702
|
+
|
703
|
+
if not hostname:
|
704
|
+
continue
|
705
|
+
|
706
|
+
ca = CertificateAuthority(app.ca_certs_dir_path)
|
707
|
+
if not ca.signed(hostname, app.certs_dir_path):
|
708
|
+
Logger.instance(LOG_ID).info(f"Creating cert for {hostname}")
|
709
|
+
ca.sign(hostname, app.certs_dir_path)
|
710
|
+
|
680
711
|
def __validate_app(app: App):
|
681
712
|
if not app.valid:
|
682
713
|
print(f"Error: {app.dir_path} is not a valid scaffold app", file=sys.stderr)
|
@@ -1 +1 @@
|
|
1
|
-
1.5.
|
1
|
+
1.5.6
|
@@ -1,4 +1,4 @@
|
|
1
|
-
stoobly_agent/__init__.py,sha256=
|
1
|
+
stoobly_agent/__init__.py,sha256=69eeJOFdZIj_u7CdBLLEJH5aoH4EApq0KmNGYpvoPMc,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=ZgCfmdr5um-OFAiuRHdBxFqPIeph9WqYkVg-oVQWw-E,5543
|
@@ -74,6 +74,7 @@ stoobly_agent/app/cli/scaffold/app_create_command.py,sha256=sy4017eiir9MK0TEbTi1
|
|
74
74
|
stoobly_agent/app/cli/scaffold/command.py,sha256=aoTsdkkBzyu7TkVSMdNQQGk0Gj874jNgFcjR14y3TuM,254
|
75
75
|
stoobly_agent/app/cli/scaffold/config.py,sha256=HZU5tkvr3dkPr4JMXZtrJlu2wxxO-134Em6jReFFcq0,688
|
76
76
|
stoobly_agent/app/cli/scaffold/constants.py,sha256=Vn7TLVmxbiLOb7_wFDE4mlwkcr4vs0ZEgMxhS1ANizA,2084
|
77
|
+
stoobly_agent/app/cli/scaffold/containerized_app.py,sha256=dAjn4RwcZV3aEL0POUmrbF_DC-r9h6s1zx7gT2t45v0,175
|
77
78
|
stoobly_agent/app/cli/scaffold/docker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
78
79
|
stoobly_agent/app/cli/scaffold/docker/app_builder.py,sha256=7z5pk5JKlRDHx2USxY-WurttLyyUkIVYfl34_u1x9dE,501
|
79
80
|
stoobly_agent/app/cli/scaffold/docker/builder.py,sha256=BQzjpDZmkUrii3VDcRCBXQkocxRwdS1omJFy5AkzJzw,2856
|
@@ -103,7 +104,7 @@ stoobly_agent/app/cli/scaffold/service_workflow.py,sha256=sQ_Edy_wGHKMXpD0DmhnOW
|
|
103
104
|
stoobly_agent/app/cli/scaffold/service_workflow_validate_command.py,sha256=iORyPZEQurgWVxrdMgkdD3VsCz3ar2D15dmyY3RoeKw,9904
|
104
105
|
stoobly_agent/app/cli/scaffold/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
105
106
|
stoobly_agent/app/cli/scaffold/templates/app/.Dockerfile.context,sha256=EVoSqGJH_H7Xw1Ktan5GH2SWaOXIr916NUpptr2hkiA,158
|
106
|
-
stoobly_agent/app/cli/scaffold/templates/app/.Makefile,sha256=
|
107
|
+
stoobly_agent/app/cli/scaffold/templates/app/.Makefile,sha256=iVlTpP0I8nbgO1EBhsomGrUFqIDdlhIEJEdD_aCeXRs,8083
|
107
108
|
stoobly_agent/app/cli/scaffold/templates/app/.docker-compose.base.yml,sha256=6tFqXh3ine8vaD0FCL5TMoY5NjKx2wLUR8XpW3tJtew,245
|
108
109
|
stoobly_agent/app/cli/scaffold/templates/app/Makefile,sha256=TEmPG7Bf0KZOnmfsgdzza3UdwcVMmM5Lj1YdLc4cgjA,79
|
109
110
|
stoobly_agent/app/cli/scaffold/templates/app/build/.config.yml,sha256=8Wt8ZZ5irvBYYS44xGrR_EWlZDuXH9kyWmquzsh7s8g,19
|
@@ -126,19 +127,19 @@ stoobly_agent/app/cli/scaffold/templates/app/build/test/bin/init,sha256=O7czui9G
|
|
126
127
|
stoobly_agent/app/cli/scaffold/templates/app/entrypoint/.config.yml,sha256=T9VQz6OwAQpKdIoFrnfKAxuX_to0c6EhuWRLKM34Sr4,22
|
127
128
|
stoobly_agent/app/cli/scaffold/templates/app/entrypoint/.docker-compose.base.yml,sha256=IHLz4eJyZDfQdKd8HG218Zc3egtOCK1IR8vfkMNJ0Ug,491
|
128
129
|
stoobly_agent/app/cli/scaffold/templates/app/entrypoint/mock/.docker-compose.mock.yml,sha256=-YbHd6BrAlBpT8PYg8kOsq0GyDeZ3g_q8IB0B0rGluU,551
|
129
|
-
stoobly_agent/app/cli/scaffold/templates/app/entrypoint/mock/bin/.configure,sha256=
|
130
|
+
stoobly_agent/app/cli/scaffold/templates/app/entrypoint/mock/bin/.configure,sha256=dZNsKDou-7IS4yj8hYPudjoUIa8YlUbuE8pBkSIVtyE,255
|
130
131
|
stoobly_agent/app/cli/scaffold/templates/app/entrypoint/mock/bin/.init,sha256=5xJbfpwGOmRj5lwK5e0JNlVpNd3WFUkZ0GaCUK40aDk,97
|
131
132
|
stoobly_agent/app/cli/scaffold/templates/app/entrypoint/mock/bin/configure,sha256=Nme7aSLA-IH1NXgmqRMPzOlKcUSRXqZd-kcuZa47IEk,11
|
132
133
|
stoobly_agent/app/cli/scaffold/templates/app/entrypoint/mock/bin/init,sha256=O7czui9GFHbcoEC5I9MwkRyZvDGY42IwlyQwIWcgylY,12
|
133
134
|
stoobly_agent/app/cli/scaffold/templates/app/entrypoint/mock/docker-compose.yml,sha256=Zh8h8yUqVXZMi_Y4aUPE48qw2DU-ONO4-rrSTh4E_Ts,591
|
134
135
|
stoobly_agent/app/cli/scaffold/templates/app/entrypoint/record/.docker-compose.record.yml,sha256=aIcgjelss4V86lxS3-xN8j_2eR-0YkzhtN_b-g3Y0nE,555
|
135
|
-
stoobly_agent/app/cli/scaffold/templates/app/entrypoint/record/bin/.configure,sha256=
|
136
|
+
stoobly_agent/app/cli/scaffold/templates/app/entrypoint/record/bin/.configure,sha256=HKul_kbkob_EzSudYKRyQMk_YHE2jEBTarGHl3pCc18,259
|
136
137
|
stoobly_agent/app/cli/scaffold/templates/app/entrypoint/record/bin/.init,sha256=5xJbfpwGOmRj5lwK5e0JNlVpNd3WFUkZ0GaCUK40aDk,97
|
137
138
|
stoobly_agent/app/cli/scaffold/templates/app/entrypoint/record/bin/configure,sha256=Nme7aSLA-IH1NXgmqRMPzOlKcUSRXqZd-kcuZa47IEk,11
|
138
139
|
stoobly_agent/app/cli/scaffold/templates/app/entrypoint/record/bin/init,sha256=O7czui9GFHbcoEC5I9MwkRyZvDGY42IwlyQwIWcgylY,12
|
139
140
|
stoobly_agent/app/cli/scaffold/templates/app/entrypoint/record/docker-compose.yml,sha256=5n4bZBHI9MtwBF55ugu1RTdwMy7T6SsYGQ_3sulFUj8,595
|
140
141
|
stoobly_agent/app/cli/scaffold/templates/app/entrypoint/test/.docker-compose.test.yml,sha256=9-qPnSisun4adnrDcZsJiyeMjhIlCHBJap_cmdzUPVg,552
|
141
|
-
stoobly_agent/app/cli/scaffold/templates/app/entrypoint/test/bin/.configure,sha256=
|
142
|
+
stoobly_agent/app/cli/scaffold/templates/app/entrypoint/test/bin/.configure,sha256=dZNsKDou-7IS4yj8hYPudjoUIa8YlUbuE8pBkSIVtyE,255
|
142
143
|
stoobly_agent/app/cli/scaffold/templates/app/entrypoint/test/bin/.init,sha256=5xJbfpwGOmRj5lwK5e0JNlVpNd3WFUkZ0GaCUK40aDk,97
|
143
144
|
stoobly_agent/app/cli/scaffold/templates/app/entrypoint/test/bin/configure,sha256=Nme7aSLA-IH1NXgmqRMPzOlKcUSRXqZd-kcuZa47IEk,11
|
144
145
|
stoobly_agent/app/cli/scaffold/templates/app/entrypoint/test/bin/init,sha256=O7czui9GFHbcoEC5I9MwkRyZvDGY42IwlyQwIWcgylY,12
|
@@ -153,15 +154,15 @@ stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/exec/.docker-compose.exe
|
|
153
154
|
stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/exec/bin/.create,sha256=EZe84bLAKB-mrB9PGMx-amyMjp6x-ESUZKC8wxrWdLE,245
|
154
155
|
stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/exec/bin/.delete,sha256=RspRDQ7WT5jpN2o-6qXOlH-A2VpN4981pD4ZJljk9Rw,260
|
155
156
|
stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/exec/bin/.disable,sha256=xVf4Pk1RLvJm7Ff0rbGoWhYHPv0ME5e93fxS2yFqLnE,45
|
156
|
-
stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/exec/bin/.down,sha256=
|
157
|
+
stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/exec/bin/.down,sha256=WtEjm2hJ01-1GGxRmmcUqZq7VjEe5JfZZKvm8TNhNEs,219
|
157
158
|
stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/exec/bin/.enable,sha256=sfUSPG4uHdXX95BLgivXQYLbsLBP2DjJIiSTXRtvXuY,188
|
158
159
|
stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/exec/bin/.list,sha256=BdX3ARC-Piuwk0vFzBrcxEwtHjdFncpORzqP-hP4IwE,84
|
159
|
-
stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/exec/bin/.logs,sha256=
|
160
|
+
stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/exec/bin/.logs,sha256=4CJVEVLn9VTQN9LAjOJpijwd_DZ5IuIXL1aFCYkelxk,178
|
160
161
|
stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/exec/bin/.mkcert,sha256=vyHaXmvy-7oL2RD8rIxwT-fdJS5kXmB0yHK5fRMo_cM,46
|
161
162
|
stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/exec/bin/.reset,sha256=_pvbLk-ektsCHEh_egDtd6c0sVqCPunwUWggarfoli0,238
|
162
163
|
stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/exec/bin/.services,sha256=sAbaKzBxNDXimyUNinB_a2Kt47vUCa0Kd3Z1QAp2GrU,161
|
163
164
|
stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/exec/bin/.snapshot,sha256=Kav1QNhKG7f0DBzc4-9dmxZMmmVTxmPqakT_W4kVYKk,241
|
164
|
-
stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/exec/bin/.up,sha256=
|
165
|
+
stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/exec/bin/.up,sha256=S88O31UgsabaMvSwkQJjLF9C7mrFkyEk9x6JDE6qSXI,228
|
165
166
|
stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/mock/.docker-compose.mock.yml,sha256=FnCn64DjxyAiB2P_1JUwFmXslMR961nVZHkYiEXytlg,232
|
166
167
|
stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/record/.docker-compose.record.yml,sha256=t34FNYZboJSfrKnIB2oJ3UuE_mJaW77-hcbSn3sfWec,235
|
167
168
|
stoobly_agent/app/cli/scaffold/templates/constants.py,sha256=EXBiBB_gnSINGrIqfXMaJ2w0HEaICw4FxVjwIHPBqYw,1457
|
@@ -175,7 +176,7 @@ stoobly_agent/app/cli/scaffold/templates/workflow/mock/lifecycle_hooks.py,sha256
|
|
175
176
|
stoobly_agent/app/cli/scaffold/templates/workflow/mock/public/.gitignore,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
176
177
|
stoobly_agent/app/cli/scaffold/templates/workflow/record/bin/.configure,sha256=z135hJDmBWYOhZbjuzC8-C6a0VtQ9NPx5mfCpVZliEA,210
|
177
178
|
stoobly_agent/app/cli/scaffold/templates/workflow/record/bin/.init,sha256=GekadmBjLyAxgTJbCA_NKgUXRwKFs8iX4qtV5YlvUXk,329
|
178
|
-
stoobly_agent/app/cli/scaffold/templates/workflow/record/bin/configure,sha256=
|
179
|
+
stoobly_agent/app/cli/scaffold/templates/workflow/record/bin/configure,sha256=bkMZexceMEfoh5AqybtzpGPBrCGxl7Azn6QbR-qAuWM,750
|
179
180
|
stoobly_agent/app/cli/scaffold/templates/workflow/record/bin/init,sha256=YxWVVQMEdGarcMtBcE1Sj2kdLgUgwY9kXp3MjPsVcmg,46
|
180
181
|
stoobly_agent/app/cli/scaffold/templates/workflow/record/lifecycle_hooks.py,sha256=4vaVc_gnDTCLEqtcZybIk5dcmXrKmGuesF6gc3-_kX8,473
|
181
182
|
stoobly_agent/app/cli/scaffold/templates/workflow/test/bin/.configure,sha256=z135hJDmBWYOhZbjuzC8-C6a0VtQ9NPx5mfCpVZliEA,210
|
@@ -195,7 +196,7 @@ stoobly_agent/app/cli/scaffold/workflow_env.py,sha256=x8V5pJmIiklD3f2q2-qq-CORf4
|
|
195
196
|
stoobly_agent/app/cli/scaffold/workflow_log_command.py,sha256=Bke4lMOMxuDUFuAx9nlXHbKgYMO4KAg9ASHvjz4aVWc,1372
|
196
197
|
stoobly_agent/app/cli/scaffold/workflow_run_command.py,sha256=GXteRAgco7NCb0Ov1B2_xs1DMyLg8vdDsCvH7whrlcE,9854
|
197
198
|
stoobly_agent/app/cli/scaffold/workflow_validate_command.py,sha256=fhHciJXg_u32Wmh8us8LhgQj8D1SxkBADtuBBF4K0FM,4377
|
198
|
-
stoobly_agent/app/cli/scaffold_cli.py,sha256=
|
199
|
+
stoobly_agent/app/cli/scaffold_cli.py,sha256=_qpeTzctvqeQ7TxSbiizKYUp7zKTLXzTPmhSjIN2jdc,28163
|
199
200
|
stoobly_agent/app/cli/scenario_cli.py,sha256=3J1EiJOvunkfWrEkOsanw-XrKkOk78ij_GjBlE9p7CE,8229
|
200
201
|
stoobly_agent/app/cli/snapshot_cli.py,sha256=cpCjxFYBuVwLuq_b2lIUu-5zWqupRlrp4xWgDytirSM,10047
|
201
202
|
stoobly_agent/app/cli/trace_cli.py,sha256=K7E-vx3JUcqEDSWOdIOi_AieKNQz7dBfmRrVvKDkzFI,4605
|
@@ -695,7 +696,7 @@ stoobly_agent/test/app/models/factories/resource/local_db/helpers/log_test.py,sh
|
|
695
696
|
stoobly_agent/test/app/models/factories/resource/local_db/helpers/tiebreak_scenario_request_test.py,sha256=a1SFLyEyRRLuADvAw6ckQQKORFXvyK1lyrbkaLWx8oU,3399
|
696
697
|
stoobly_agent/test/app/models/factories/resource/local_db/request_adapter_test.py,sha256=Pzq1cBPnP9oSWG-p0c-VoymoHxgp483QmNwmV1b78RA,8453
|
697
698
|
stoobly_agent/test/app/models/factories/resource/local_db/response_adapter_test.py,sha256=9P95EKH5rZGOrmRkRIDlQZqtiLJHk9735og18Ffwpfw,2204
|
698
|
-
stoobly_agent/test/app/models/schemas/.stoobly/db/VERSION,sha256=
|
699
|
+
stoobly_agent/test/app/models/schemas/.stoobly/db/VERSION,sha256=WtHxF9tp4oUNGG9uaT9BVwB0t1KF7YkB7wiElV_Nk9k,5
|
699
700
|
stoobly_agent/test/app/models/schemas/.stoobly/db/stoobly_agent.sqlite3,sha256=ch8gNx6zIelLKQx65gwFx_LRNqUD3EC5xcHZ0ukIQiU,188416
|
700
701
|
stoobly_agent/test/app/models/schemas/.stoobly/settings.yml,sha256=vLwMjweKOdod6tSLtIlyBefPQuNXq9wio4kBaODKtAU,726
|
701
702
|
stoobly_agent/test/app/models/schemas/.stoobly/tmp/options.json,sha256=OTRzarwus48CTrItedXCrgQttJHSEZonEYc7R_knvYg,2212
|
@@ -736,8 +737,8 @@ stoobly_agent/test/mock_data/scaffold/docker-compose-local-service.yml,sha256=_t
|
|
736
737
|
stoobly_agent/test/mock_data/scaffold/index.html,sha256=qJwuYajKZ4ihWZrJQ3BNObV5kf1VGnnm_vqlPJzdqLE,258
|
737
738
|
stoobly_agent/test/mock_data/uspto.yaml,sha256=6U5se7C3o-86J4m9xpOk9Npias399f5CbfWzR87WKwE,7835
|
738
739
|
stoobly_agent/test/test_helper.py,sha256=m_oAI7tmRYCNZdKfNqISWhMv3e44tjeYViQ3nTUfnos,1007
|
739
|
-
stoobly_agent-1.5.
|
740
|
-
stoobly_agent-1.5.
|
741
|
-
stoobly_agent-1.5.
|
742
|
-
stoobly_agent-1.5.
|
743
|
-
stoobly_agent-1.5.
|
740
|
+
stoobly_agent-1.5.6.dist-info/LICENSE,sha256=o93sj12cdoEOsTCjPaPFsw3Xq0SXs3pPcY-9reE2sEw,548
|
741
|
+
stoobly_agent-1.5.6.dist-info/METADATA,sha256=ai5e5H-gA0lrsFe4TNmSiBI_SaPqdNfvKo27G9v0C3s,3087
|
742
|
+
stoobly_agent-1.5.6.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
|
743
|
+
stoobly_agent-1.5.6.dist-info/entry_points.txt,sha256=aq5wix5oC8MDQtmyPGU0xaFrsjJg7WH28NmXh2sc3Z8,56
|
744
|
+
stoobly_agent-1.5.6.dist-info/RECORD,,
|
File without changes
|
File without changes
|