Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRAFT - Adding passing of deploy user #20

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions wellies/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ def concatenate_yaml_files(yaml_files):
with open(yaml_path, "r") as file:
local_options = yaml.load(file, Loader=yaml.SafeLoader)

# Skip empty files
if local_options is None:
continue

# check for duplicates
duplicated_keys = []
for key in local_options.keys():
Expand Down
9 changes: 7 additions & 2 deletions wellies/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def deploy_suite(
name: str,
hostname: str,
deploy_dir: str,
deploy_user: str = None,
gareth-j marked this conversation as resolved.
Show resolved Hide resolved
backup_deploy: str = None,
build_dir: str = None,
no_prompt: bool = False,
Expand All @@ -113,6 +114,8 @@ def deploy_suite(
The hostname of the remote repository.
deploy_dir (str):
The target to deploy the suite to.
deploy_user (str, optional):
The username to use for remote deployment. Defaults to None.
backup_deploy (str, optional):
The backup repository to use. Defaults to None.
build_dir (str, optional):
Expand Down Expand Up @@ -141,10 +144,12 @@ def deploy_suite(

_generate_suite(suite, staging_dir, name)

deploy_user = user if deploy_user is None else deploy_user

try:
deployer = ts.GitDeployment(
host=hostname,
user=user,
user=deploy_user,
staging_dir=staging_dir,
local_repo=local_repo,
target_repo=target_repo,
Expand All @@ -163,7 +168,7 @@ def deploy_suite(
)
deployer = ts.GitDeployment(
host=hostname,
user=user,
user=deploy_user,
staging_dir=staging_dir,
local_repo=local_repo,
target_repo=target_repo,
Expand Down
2 changes: 2 additions & 0 deletions wellies/templates/suite.py_t
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class Config:

self.deploy_dir = options['deploy_dir']
self.deploy_hostname = options.get("deploy_hostname", "localhost")
self.deploy_user = options.get("deploy_user")
self.backup_deploy = options.get('backup_deploy', None)

self.output_root = options['output_root']
Expand Down Expand Up @@ -82,6 +83,7 @@ if __name__ == '__main__':
name=config.name,
hostname=config.deploy_hostname,
deploy_dir=config.deploy_dir,
deploy_user=config.deploy_user,
backup_deploy=config.backup_deploy,
build_dir=args.build_dir,
no_prompt=args.y,
Expand Down
Loading