-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1c2c61b
commit c5d3be6
Showing
6 changed files
with
69 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
source /etc/profile | ||
|
||
exec /usr/share/indy-sidedcar-init/venv/bin/run-sidecar-init "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from sidecarinit.commands import (run) | ||
|
||
__all__ = ['run'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import click | ||
import os | ||
import sys | ||
from time import sleep | ||
from traceback import format_exc | ||
import sidecarinit.config as config | ||
|
||
@click.command() | ||
@click.argument('env_yml', required=False) #help='Target environment, Same as sidecar application.yml' | ||
@click.option('-B', '--artifact-dir', help='Dir for saving artifacts', default='artifacts') | ||
def run(env_yml, artifact_dir): | ||
|
||
#suite = config.read_config(env_yml) | ||
print("hello world") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from ruamel.yaml import YAML | ||
import os | ||
|
||
ENV_INDY_URL = 'indy-url' | ||
ENV_PROXY_PORT = 'proxy-port' | ||
|
||
DEFAULT_PROXY_PORT = 8081 | ||
|
||
|
||
class Environment: | ||
def __init__(self, env_spec): | ||
self.indy_url = env_spec.get(ENV_INDY_URL) | ||
self.proxy_port = env_spec.get(ENV_PROXY_PORT) or DEFAULT_PROXY_PORT | ||
|
||
def read_config(env_yml): | ||
""" Read the suite configuration that this worker should run, from a config.yml file | ||
(specified on the command line and passed in as a parameter here). | ||
Once we have a suite YAML file (from the suite_yml config), that file will be parsed | ||
and passed back with the rest of the config values, in a Config object. | ||
If any required configs are missing and don't have default values, error messages will | ||
be generated. If the list of errors is non-empty at the end of this method, an error | ||
message containing all of the problems will be logged to the console and an | ||
exception will be raised. | ||
""" | ||
errors = [] | ||
|
||
env_spec = {} | ||
if env_yml is None: | ||
errors.append(f"Missing test environment config file") | ||
elif os.path.exists(env_yml): | ||
with open(env_yml) as f: | ||
yaml = YAML(typ='safe') | ||
env_spec = yaml.load(f) | ||
else: | ||
errors.append( f"Missing test environment config file") | ||
|
||
env = Environment(env_spec) | ||
|
||
return env |