Skip to content

Commit

Permalink
Adding passing of deploy user
Browse files Browse the repository at this point in the history
  • Loading branch information
gareth-j committed Oct 15, 2024
1 parent e0f9af8 commit b366f9d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
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,
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

0 comments on commit b366f9d

Please sign in to comment.