stoobly-agent 0.34.13__py3-none-any.whl → 1.0.1__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/__init__.py +1 -0
- stoobly_agent/app/cli/helpers/openapi_endpoint_adapter.py +9 -7
- stoobly_agent/app/cli/helpers/shell.py +28 -0
- stoobly_agent/app/cli/main_group.py +1 -1
- stoobly_agent/app/cli/scaffold/__init__.py +0 -0
- stoobly_agent/app/cli/scaffold/app.py +106 -0
- stoobly_agent/app/cli/scaffold/app_command.py +82 -0
- stoobly_agent/app/cli/scaffold/app_config.py +32 -0
- stoobly_agent/app/cli/scaffold/app_create_command.py +24 -0
- stoobly_agent/app/cli/scaffold/command.py +15 -0
- stoobly_agent/app/cli/scaffold/config.py +35 -0
- stoobly_agent/app/cli/scaffold/constants.py +35 -0
- stoobly_agent/app/cli/scaffold/docker/__init__.py +0 -0
- stoobly_agent/app/cli/scaffold/docker/app_builder.py +26 -0
- stoobly_agent/app/cli/scaffold/docker/builder.py +117 -0
- stoobly_agent/app/cli/scaffold/docker/constants.py +7 -0
- stoobly_agent/app/cli/scaffold/docker/service/__init__.py +0 -0
- stoobly_agent/app/cli/scaffold/docker/service/build_decorator.py +37 -0
- stoobly_agent/app/cli/scaffold/docker/service/builder.py +117 -0
- stoobly_agent/app/cli/scaffold/docker/service/set_gateway_ports.py +47 -0
- stoobly_agent/app/cli/scaffold/docker/service/types.py +4 -0
- stoobly_agent/app/cli/scaffold/docker/workflow/__init__.py +0 -0
- stoobly_agent/app/cli/scaffold/docker/workflow/build_decorator.py +28 -0
- stoobly_agent/app/cli/scaffold/docker/workflow/builder.py +259 -0
- stoobly_agent/app/cli/scaffold/docker/workflow/decorators_factory.py +17 -0
- stoobly_agent/app/cli/scaffold/docker/workflow/mock_decorator.py +40 -0
- stoobly_agent/app/cli/scaffold/docker/workflow/reverse_proxy_decorator.py +51 -0
- stoobly_agent/app/cli/scaffold/env.py +49 -0
- stoobly_agent/app/cli/scaffold/service.py +25 -0
- stoobly_agent/app/cli/scaffold/service_command.py +50 -0
- stoobly_agent/app/cli/scaffold/service_config.py +207 -0
- stoobly_agent/app/cli/scaffold/service_create_command.py +77 -0
- stoobly_agent/app/cli/scaffold/service_workflow.py +18 -0
- stoobly_agent/app/cli/scaffold/templates/__init__.py +0 -0
- stoobly_agent/app/cli/scaffold/templates/app/.Dockerfile.context +8 -0
- stoobly_agent/app/cli/scaffold/templates/app/.Dockerfile.proxy +35 -0
- stoobly_agent/app/cli/scaffold/templates/app/.Makefile +118 -0
- stoobly_agent/app/cli/scaffold/templates/app/.docker-compose.base.yml +15 -0
- stoobly_agent/app/cli/scaffold/templates/app/Makefile +3 -0
- stoobly_agent/app/cli/scaffold/templates/app/build/.config.yml +1 -0
- stoobly_agent/app/cli/scaffold/templates/app/build/.docker-compose.base.yml +11 -0
- stoobly_agent/app/cli/scaffold/templates/app/build/mock/.docker-compose.mock.yml +22 -0
- stoobly_agent/app/cli/scaffold/templates/app/build/mock/bin/.configure +5 -0
- stoobly_agent/app/cli/scaffold/templates/app/build/mock/bin/.init +5 -0
- stoobly_agent/app/cli/scaffold/templates/app/build/mock/bin/configure +1 -0
- stoobly_agent/app/cli/scaffold/templates/app/build/mock/bin/init +1 -0
- stoobly_agent/app/cli/scaffold/templates/app/build/record/.docker-compose.record.yml +22 -0
- stoobly_agent/app/cli/scaffold/templates/app/build/record/bin/.configure +5 -0
- stoobly_agent/app/cli/scaffold/templates/app/build/record/bin/.init +5 -0
- stoobly_agent/app/cli/scaffold/templates/app/build/record/bin/configure +1 -0
- stoobly_agent/app/cli/scaffold/templates/app/build/record/bin/init +1 -0
- stoobly_agent/app/cli/scaffold/templates/app/build/test/.docker-compose.test.yml +22 -0
- stoobly_agent/app/cli/scaffold/templates/app/build/test/bin/.configure +5 -0
- stoobly_agent/app/cli/scaffold/templates/app/build/test/bin/.init +5 -0
- stoobly_agent/app/cli/scaffold/templates/app/build/test/bin/configure +1 -0
- stoobly_agent/app/cli/scaffold/templates/app/build/test/bin/init +1 -0
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/.config.yml +1 -0
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/.docker-compose.base.yml +17 -0
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/mock/.docker-compose.mock.yml +31 -0
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/mock/bin/.configure +10 -0
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/mock/bin/.init +5 -0
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/mock/bin/configure +1 -0
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/mock/bin/init +4 -0
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/mock/docker-compose.yml +1 -0
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/record/.docker-compose.record.yml +31 -0
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/record/bin/.configure +10 -0
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/record/bin/.init +5 -0
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/record/bin/configure +1 -0
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/record/bin/init +4 -0
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/record/docker-compose.yml +1 -0
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/test/.docker-compose.test.yml +31 -0
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/test/bin/.configure +10 -0
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/test/bin/.init +3 -0
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/test/bin/configure +1 -0
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/test/bin/init +4 -0
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/test/docker-compose.yml +1 -0
- stoobly_agent/app/cli/scaffold/templates/app/gateway/.config.yml +1 -0
- stoobly_agent/app/cli/scaffold/templates/app/gateway/.docker-compose.base.yml +11 -0
- stoobly_agent/app/cli/scaffold/templates/app/gateway/mock/.docker-compose.mock.yml +13 -0
- stoobly_agent/app/cli/scaffold/templates/app/gateway/record/.docker-compose.record.yml +13 -0
- stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/.config.yml +1 -0
- stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/.docker-compose.base.yml +5 -0
- stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/exec/.docker-compose.exec.yml +12 -0
- stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/exec/bin/.create +11 -0
- stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/exec/bin/.delete +12 -0
- stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/exec/bin/.disable +3 -0
- stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/exec/bin/.enable +10 -0
- stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/exec/bin/.reset +12 -0
- stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/exec/bin/.run +11 -0
- stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/exec/bin/.snapshot +12 -0
- stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/exec/bin/.stop +11 -0
- stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/mock/.docker-compose.mock.yml +12 -0
- stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/record/.docker-compose.record.yml +13 -0
- stoobly_agent/app/cli/scaffold/templates/constants.py +63 -0
- stoobly_agent/app/cli/scaffold/templates/factory.py +46 -0
- stoobly_agent/app/cli/scaffold/templates/workflow/mock/bin/.configure +3 -0
- stoobly_agent/app/cli/scaffold/templates/workflow/mock/bin/.init +3 -0
- stoobly_agent/app/cli/scaffold/templates/workflow/mock/bin/configure +18 -0
- stoobly_agent/app/cli/scaffold/templates/workflow/mock/bin/init +4 -0
- stoobly_agent/app/cli/scaffold/templates/workflow/mock/fixtures/.keep +0 -0
- stoobly_agent/app/cli/scaffold/templates/workflow/mock/fixtures.yml +5 -0
- stoobly_agent/app/cli/scaffold/templates/workflow/mock/lifecycle_hooks.py +12 -0
- stoobly_agent/app/cli/scaffold/templates/workflow/record/bin/.configure +3 -0
- stoobly_agent/app/cli/scaffold/templates/workflow/record/bin/.init +3 -0
- stoobly_agent/app/cli/scaffold/templates/workflow/record/bin/configure +29 -0
- stoobly_agent/app/cli/scaffold/templates/workflow/record/bin/init +4 -0
- stoobly_agent/app/cli/scaffold/templates/workflow/record/lifecycle_hooks.py +12 -0
- stoobly_agent/app/cli/scaffold/templates/workflow/test/bin/.configure +3 -0
- stoobly_agent/app/cli/scaffold/templates/workflow/test/bin/.init +3 -0
- stoobly_agent/app/cli/scaffold/templates/workflow/test/bin/configure +18 -0
- stoobly_agent/app/cli/scaffold/templates/workflow/test/bin/init +4 -0
- stoobly_agent/app/cli/scaffold/templates/workflow/test/fixtures/.keep +0 -0
- stoobly_agent/app/cli/scaffold/templates/workflow/test/fixtures.yml +5 -0
- stoobly_agent/app/cli/scaffold/templates/workflow/test/lifecycle_hooks.py +12 -0
- stoobly_agent/app/cli/scaffold/workflow.py +49 -0
- stoobly_agent/app/cli/scaffold/workflow_command.py +137 -0
- stoobly_agent/app/cli/scaffold/workflow_copy_command.py +45 -0
- stoobly_agent/app/cli/scaffold/workflow_create_command.py +94 -0
- stoobly_agent/app/cli/scaffold/workflow_log_command.py +21 -0
- stoobly_agent/app/cli/scaffold/workflow_run_command.py +134 -0
- stoobly_agent/app/cli/scaffold_cli.py +392 -0
- stoobly_agent/cli.py +3 -2
- stoobly_agent/config/data_dir.py +40 -14
- stoobly_agent/lib/logger.py +3 -2
- stoobly_agent/test/app/models/schemas/.stoobly/db/VERSION +1 -1
- stoobly_agent/test/config/data_dir_test.py +4 -4
- {stoobly_agent-0.34.13.dist-info → stoobly_agent-1.0.1.dist-info}/METADATA +8 -7
- {stoobly_agent-0.34.13.dist-info → stoobly_agent-1.0.1.dist-info}/RECORD +132 -14
- {stoobly_agent-0.34.13.dist-info → stoobly_agent-1.0.1.dist-info}/WHEEL +1 -1
- {stoobly_agent-0.34.13.dist-info → stoobly_agent-1.0.1.dist-info}/LICENSE +0 -0
- {stoobly_agent-0.34.13.dist-info → stoobly_agent-1.0.1.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,31 @@
|
|
1
|
+
networks:
|
2
|
+
entrypoint:
|
3
|
+
name: entrypoint
|
4
|
+
services:
|
5
|
+
entrypoint.configure:
|
6
|
+
build:
|
7
|
+
context: ./
|
8
|
+
dockerfile: ../../.Dockerfile.context
|
9
|
+
depends_on:
|
10
|
+
entrypoint.init:
|
11
|
+
condition: service_completed_successfully
|
12
|
+
environment: {}
|
13
|
+
extends:
|
14
|
+
file: ../.docker-compose.base.yml
|
15
|
+
service: entrypoint.configure_base
|
16
|
+
profiles:
|
17
|
+
- mock
|
18
|
+
volumes: []
|
19
|
+
entrypoint.init:
|
20
|
+
build:
|
21
|
+
context: ./
|
22
|
+
dockerfile: ../../.Dockerfile.context
|
23
|
+
environment: {}
|
24
|
+
extends:
|
25
|
+
file: ../.docker-compose.base.yml
|
26
|
+
service: entrypoint.init_base
|
27
|
+
profiles:
|
28
|
+
- mock
|
29
|
+
volumes:
|
30
|
+
- ./dist:/home/stoobly/dist
|
31
|
+
volumes: {}
|
@@ -0,0 +1 @@
|
|
1
|
+
#!/bin/bash
|
@@ -0,0 +1 @@
|
|
1
|
+
# Define services here
|
@@ -0,0 +1,31 @@
|
|
1
|
+
networks:
|
2
|
+
entrypoint:
|
3
|
+
name: entrypoint
|
4
|
+
services:
|
5
|
+
entrypoint.configure:
|
6
|
+
build:
|
7
|
+
context: ./
|
8
|
+
dockerfile: ../../.Dockerfile.context
|
9
|
+
depends_on:
|
10
|
+
entrypoint.init:
|
11
|
+
condition: service_completed_successfully
|
12
|
+
environment: {}
|
13
|
+
extends:
|
14
|
+
file: ../.docker-compose.base.yml
|
15
|
+
service: entrypoint.configure_base
|
16
|
+
profiles:
|
17
|
+
- record
|
18
|
+
volumes: []
|
19
|
+
entrypoint.init:
|
20
|
+
build:
|
21
|
+
context: ./
|
22
|
+
dockerfile: ../../.Dockerfile.context
|
23
|
+
environment: {}
|
24
|
+
extends:
|
25
|
+
file: ../.docker-compose.base.yml
|
26
|
+
service: entrypoint.init_base
|
27
|
+
profiles:
|
28
|
+
- record
|
29
|
+
volumes:
|
30
|
+
- ./dist:/home/stoobly/dist
|
31
|
+
volumes: {}
|
@@ -0,0 +1 @@
|
|
1
|
+
#!/bin/bash
|
@@ -0,0 +1 @@
|
|
1
|
+
# Define services here
|
@@ -0,0 +1,31 @@
|
|
1
|
+
networks:
|
2
|
+
entrypoint:
|
3
|
+
name: entrypoint
|
4
|
+
services:
|
5
|
+
entrypoint.configure:
|
6
|
+
build:
|
7
|
+
context: ./
|
8
|
+
dockerfile: ../../.Dockerfile.context
|
9
|
+
depends_on:
|
10
|
+
entrypoint.init:
|
11
|
+
condition: service_completed_successfully
|
12
|
+
environment: {}
|
13
|
+
extends:
|
14
|
+
file: ../.docker-compose.base.yml
|
15
|
+
service: entrypoint.configure_base
|
16
|
+
profiles:
|
17
|
+
- test
|
18
|
+
volumes: []
|
19
|
+
entrypoint.init:
|
20
|
+
build:
|
21
|
+
context: ./
|
22
|
+
dockerfile: ../../.Dockerfile.context
|
23
|
+
environment: {}
|
24
|
+
extends:
|
25
|
+
file: ../.docker-compose.base.yml
|
26
|
+
service: entrypoint.init_base
|
27
|
+
profiles:
|
28
|
+
- test
|
29
|
+
volumes:
|
30
|
+
- ./dist:/home/stoobly/dist
|
31
|
+
volumes: {}
|
@@ -0,0 +1 @@
|
|
1
|
+
#!/bin/bash
|
@@ -0,0 +1 @@
|
|
1
|
+
# Define services here
|
@@ -0,0 +1 @@
|
|
1
|
+
SERVICE_PRIORITY: 1
|
@@ -0,0 +1 @@
|
|
1
|
+
SERVICE_PRIORITY: 1
|
@@ -0,0 +1,12 @@
|
|
1
|
+
services:
|
2
|
+
stoobly_ui.command:
|
3
|
+
build:
|
4
|
+
dockerfile: ../../.Dockerfile.context
|
5
|
+
command: ['${EXEC_COMMAND}', '${EXEC_ARGS}']
|
6
|
+
environment:
|
7
|
+
EXEC_OPTIONS: ${EXEC_OPTIONS}
|
8
|
+
extends:
|
9
|
+
file: ../.docker-compose.base.yml
|
10
|
+
service: stoobly_ui.base
|
11
|
+
profiles:
|
12
|
+
- exec
|
@@ -0,0 +1,12 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
scenario_key=$1
|
4
|
+
|
5
|
+
if [ ! "$scenario_key" ]; then
|
6
|
+
echo "Missing argument 'scenario_key'"
|
7
|
+
stoobly-agent scenario list
|
8
|
+
exit
|
9
|
+
fi
|
10
|
+
|
11
|
+
stoobly-agent scenario delete "$scenario_key"
|
12
|
+
stoobly-agent scenario snapshot --action DELETE "$scenario_key"
|
@@ -0,0 +1,63 @@
|
|
1
|
+
import os
|
2
|
+
|
3
|
+
CORE_BUILD_SERVICE_NAME = 'build'
|
4
|
+
CORE_MOCK_UI_SERVICE_NAME = 'stoobly-ui'
|
5
|
+
CORE_GATEWAY_SERVICE_NAME = 'gateway'
|
6
|
+
CORE_ENTRYPOINT_SERVICE_NAME = 'entrypoint'
|
7
|
+
CORE_SERVICES = [
|
8
|
+
CORE_BUILD_SERVICE_NAME, CORE_ENTRYPOINT_SERVICE_NAME, CORE_MOCK_UI_SERVICE_NAME, CORE_GATEWAY_SERVICE_NAME
|
9
|
+
]
|
10
|
+
|
11
|
+
CORE_MOCK_WORKFLOW = 'mock'
|
12
|
+
CORE_RECORD_WORKFLOW = 'record'
|
13
|
+
|
14
|
+
CUSTOM_BUILD = os.path.join('bin', 'build')
|
15
|
+
CUSTOM_CONFIGURE = os.path.join('bin', 'configure')
|
16
|
+
CUSTOM_INIT = os.path.join('bin', 'init')
|
17
|
+
CUSTOM_FIXTURES = 'fixtures.yml'
|
18
|
+
CUSTOM_LIFECYCLE_HOOKS = os.path.join('lifecycle_hooks.py')
|
19
|
+
MAINTAINED_CONFIGURE = os.path.join('bin', '.configure')
|
20
|
+
MAINTAINED_INIT = os.path.join('bin', '.init')
|
21
|
+
MAINTAINED_FIXTURES = os.path.join('fixtures', '.keep')
|
22
|
+
|
23
|
+
MOCK_WORKFLOW_MAINTAINED_FILES = [
|
24
|
+
MAINTAINED_CONFIGURE,
|
25
|
+
MAINTAINED_INIT,
|
26
|
+
MAINTAINED_FIXTURES
|
27
|
+
]
|
28
|
+
|
29
|
+
MOCK_WORKFLOW_CUSTOM_FILES = [
|
30
|
+
CUSTOM_BUILD,
|
31
|
+
CUSTOM_CONFIGURE,
|
32
|
+
CUSTOM_FIXTURES,
|
33
|
+
CUSTOM_INIT,
|
34
|
+
CUSTOM_LIFECYCLE_HOOKS,
|
35
|
+
]
|
36
|
+
|
37
|
+
RECORD_WORKFLOW_MAINTAINED_FILES = [
|
38
|
+
MAINTAINED_CONFIGURE,
|
39
|
+
MAINTAINED_INIT
|
40
|
+
]
|
41
|
+
|
42
|
+
RECORD_WORKFLOW_CUSTOM_FILES = [
|
43
|
+
CUSTOM_BUILD,
|
44
|
+
CUSTOM_CONFIGURE,
|
45
|
+
CUSTOM_INIT,
|
46
|
+
CUSTOM_LIFECYCLE_HOOKS
|
47
|
+
]
|
48
|
+
|
49
|
+
TEST_WORKFLOW_MAINTAINED_FILES = [
|
50
|
+
MAINTAINED_CONFIGURE,
|
51
|
+
MAINTAINED_INIT,
|
52
|
+
MAINTAINED_FIXTURES
|
53
|
+
]
|
54
|
+
|
55
|
+
TEST_WORKFLOW_CUSTOM_FILES = [
|
56
|
+
CUSTOM_BUILD,
|
57
|
+
CUSTOM_CONFIGURE,
|
58
|
+
CUSTOM_FIXTURES,
|
59
|
+
CUSTOM_INIT,
|
60
|
+
CUSTOM_LIFECYCLE_HOOKS
|
61
|
+
]
|
62
|
+
|
63
|
+
SERVICE_HOSTNAME_BUILD_ARG = 'SERVICE_HOSTNAME'
|
@@ -0,0 +1,46 @@
|
|
1
|
+
from ..constants import WORKFLOW_MOCK_TYPE, WORKFLOW_RECORD_TYPE, WORKFLOW_TEST_TYPE
|
2
|
+
from ..docker.workflow.builder import WorkflowBuilder
|
3
|
+
from .constants import (
|
4
|
+
CUSTOM_CONFIGURE, CUSTOM_INIT, MAINTAINED_CONFIGURE, MAINTAINED_FIXTURES, MOCK_WORKFLOW_CUSTOM_FILES, MOCK_WORKFLOW_MAINTAINED_FILES, RECORD_WORKFLOW_CUSTOM_FILES, RECORD_WORKFLOW_MAINTAINED_FILES, TEST_WORKFLOW_CUSTOM_FILES, TEST_WORKFLOW_MAINTAINED_FILES
|
5
|
+
)
|
6
|
+
|
7
|
+
def custom_files(workflow: str, workflow_builder: WorkflowBuilder):
|
8
|
+
files = []
|
9
|
+
if workflow == WORKFLOW_MOCK_TYPE:
|
10
|
+
files = MOCK_WORKFLOW_CUSTOM_FILES
|
11
|
+
elif workflow == WORKFLOW_RECORD_TYPE:
|
12
|
+
files = RECORD_WORKFLOW_CUSTOM_FILES
|
13
|
+
elif workflow == WORKFLOW_TEST_TYPE:
|
14
|
+
files = TEST_WORKFLOW_CUSTOM_FILES
|
15
|
+
else:
|
16
|
+
if workflow_builder.configure in workflow_builder.services:
|
17
|
+
files.append(CUSTOM_CONFIGURE)
|
18
|
+
|
19
|
+
if workflow_builder.init in workflow_builder.services:
|
20
|
+
files.append(CUSTOM_INIT)
|
21
|
+
|
22
|
+
# Fixtures are only relevant if the workflow is mock/test and if the service has a hostname
|
23
|
+
if not workflow_builder.config.hostname:
|
24
|
+
if MAINTAINED_FIXTURES in files:
|
25
|
+
files.remove(MAINTAINED_FIXTURES)
|
26
|
+
|
27
|
+
return files
|
28
|
+
|
29
|
+
def maintained_files(workflow: str, workflow_builder: WorkflowBuilder):
|
30
|
+
files = []
|
31
|
+
|
32
|
+
if workflow == WORKFLOW_MOCK_TYPE:
|
33
|
+
files = MOCK_WORKFLOW_MAINTAINED_FILES
|
34
|
+
elif workflow == WORKFLOW_RECORD_TYPE:
|
35
|
+
files = RECORD_WORKFLOW_MAINTAINED_FILES
|
36
|
+
elif workflow == WORKFLOW_TEST_TYPE:
|
37
|
+
files = TEST_WORKFLOW_MAINTAINED_FILES
|
38
|
+
else:
|
39
|
+
if workflow_builder.configure in workflow_builder.services:
|
40
|
+
files.append(MAINTAINED_CONFIGURE)
|
41
|
+
|
42
|
+
if not workflow_builder.config.hostname:
|
43
|
+
if MAINTAINED_FIXTURES in files:
|
44
|
+
files.remove(MAINTAINED_FIXTURES)
|
45
|
+
|
46
|
+
return files
|
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
scheme=$SERVICE_SCHEME
|
4
|
+
hostname=$SERVICE_HOSTNAME
|
5
|
+
port=$SERVICE_PORT
|
6
|
+
|
7
|
+
url="$scheme://$hostname"
|
8
|
+
|
9
|
+
if [ "$scheme" = 'http' -a "$port" != '80' ] || [ "$scheme" = 'https' -a "$port" != '443' ]; then
|
10
|
+
url="$url:$port"
|
11
|
+
fi
|
12
|
+
|
13
|
+
# Match
|
14
|
+
echo "Configuring match rules"
|
15
|
+
stoobly-agent config match set \
|
16
|
+
--method GET --method POST --method OPTIONS --method PUT --method DELETE \
|
17
|
+
--mode mock \
|
18
|
+
--pattern ".*?"
|
File without changes
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# This file defines lifecyle hooks for when Stoobly intercepts a request
|
2
|
+
from stoobly_agent.app.proxy.mock.context import MockContext
|
3
|
+
|
4
|
+
def handle_before_request(context: MockContext):
|
5
|
+
intercept_settings = context.intercept_settings
|
6
|
+
flow = context.flow
|
7
|
+
request = flow.request
|
8
|
+
|
9
|
+
# For example, uncomment the following
|
10
|
+
#print(f"Agent running in {intercept_settings.mode} mode with {intercept_settings.policy} policy")
|
11
|
+
#print(dir(request))
|
12
|
+
|
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
scheme=$SERVICE_SCHEME
|
4
|
+
hostname=$SERVICE_HOSTNAME
|
5
|
+
port=$SERVICE_PORT
|
6
|
+
|
7
|
+
url="$scheme://$hostname"
|
8
|
+
|
9
|
+
if [ "$scheme" = 'http' -a "$port" != '80' ] || [ "$scheme" = 'https' -a "$port" != '443' ]; then
|
10
|
+
url="$url:$port"
|
11
|
+
fi
|
12
|
+
|
13
|
+
# Firewall
|
14
|
+
echo "Configuring firewall rules"
|
15
|
+
stoobly-agent config firewall set \
|
16
|
+
--action include \
|
17
|
+
--method GET --method POST --method OPTIONS --method PUT --method DELETE \
|
18
|
+
--mode record \
|
19
|
+
--pattern "$url/.*?"
|
20
|
+
|
21
|
+
# Rewrite
|
22
|
+
echo "Configuring rewrite rules"
|
23
|
+
stoobly-agent config rewrite set \
|
24
|
+
--method GET --method POST --method OPTIONS --method PUT --method DELETE \
|
25
|
+
--mode record \
|
26
|
+
--name cookie \
|
27
|
+
--pattern "$host/?.*?" \
|
28
|
+
--type Header \
|
29
|
+
--value '' \
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# This file defines lifecyle hooks for when Stoobly intercepts a request
|
2
|
+
from stoobly_agent.app.proxy.record.context import RecordContext
|
3
|
+
|
4
|
+
def handle_before_request(context: RecordContext):
|
5
|
+
intercept_settings = context.intercept_settings
|
6
|
+
flow = context.flow
|
7
|
+
request = flow.request
|
8
|
+
|
9
|
+
# For example, uncomment the following
|
10
|
+
#print(f"Agent running in {intercept_settings.mode} mode with {intercept_settings.policy} policy")
|
11
|
+
#print(dir(request))
|
12
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
scheme=$SERVICE_SCHEME
|
4
|
+
hostname=$SERVICE_HOSTNAME
|
5
|
+
port=$SERVICE_PORT
|
6
|
+
|
7
|
+
url="$scheme://$hostname"
|
8
|
+
|
9
|
+
if [ "$scheme" = 'http' -a "$port" != '80' ] || [ "$scheme" = 'https' -a "$port" != '443' ]; then
|
10
|
+
url="$url:$port"
|
11
|
+
fi
|
12
|
+
|
13
|
+
# Match
|
14
|
+
echo "Configuring match rules"
|
15
|
+
stoobly-agent config match set \
|
16
|
+
--method GET --method POST --method OPTIONS --method PUT --method DELETE \
|
17
|
+
--mode mock \
|
18
|
+
--pattern ".*?"
|
File without changes
|