Skip to content

Target SSH Config Instead of Being Platform Specific? #26

@yanigisawa

Description

@yanigisawa

If you make this plugin target any arbitrary SSH connection, then the VPS plugin could target any environment that has an SSH server with a public HTTP port. Since I have DigitalOcean as an account, I "jumped before I looked" trying to deploy the sample project and ran into the below error. (tl;dr - I didn't install the Digital Ocean CLI tools)

The downside of targeting an SSH connection that's already configured means that your Simple Deploy now has to assume that someone has already configured the platform and configured the local SSH connection so that it can be targeted by this plugin.

This would be my personal preference: rely on the user to edit their own personal SSH config file and keys rather than manipulating this for them. It feels a step too far to have an arbitrary Python Library update one's own SSH configuration. (i.e., "why is my blog updating my SSH keys?")

File "/Users/jalexander/src/dsd/blog_project/./manage.py", line 22, in <module>                                                                               16:39:48 [3/296]
    main()                                                                                                                                                                      
  File "/Users/jalexander/src/dsd/blog_project/./manage.py", line 18, in main
    execute_from_command_line(sys.argv)                                                 
  File "/Users/jalexander/src/dsd/blog_project/.venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()                       
  File "/Users/jalexander/src/dsd/blog_project/.venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/jalexander/src/dsd/blog_project/.venv/lib/python3.12/site-packages/django/core/management/base.py", line 413, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/Users/jalexander/src/dsd/blog_project/.venv/lib/python3.12/site-packages/django/core/management/base.py", line 459, in execute
    output = self.handle(*args, **options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jalexander/src/dsd/blog_project/.venv/lib/python3.12/site-packages/django_simple_deploy/management/commands/deploy.py", line 173, in handle
    pm.hook.dsd_deploy()
  File "/Users/jalexander/src/dsd/blog_project/.venv/lib/python3.12/site-packages/pluggy/_hooks.py", line 512, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jalexander/src/dsd/blog_project/.venv/lib/python3.12/site-packages/pluggy/_manager.py", line 120, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jalexander/src/dsd/blog_project/.venv/lib/python3.12/site-packages/pluggy/_callers.py", line 167, in _multicall
    raise exception                         
  File "/Users/jalexander/src/dsd/blog_project/.venv/lib/python3.12/site-packages/pluggy/_callers.py", line 121, in _multicall
    res = hook_impl.function(*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jalexander/src/dsd/dsd-vps/dsd_vps/deploy.py", line 36, in dsd_deploy
    platform_deployer.deploy()
  File "/Users/jalexander/src/dsd/dsd-vps/dsd_vps/platform_deployer.py", line 45, in deploy
    self._prep_automate_all()
  File "/Users/jalexander/src/dsd/dsd-vps/dsd_vps/platform_deployer.py", line 89, in _prep_automate_all
    do_utils.get_ssh_key_ids_digitalocean()
  File "/Users/jalexander/src/dsd/dsd-vps/dsd_vps/utils.py", line 21, in get_ssh_key_ids_digitalocean
    output = plugin_utils.run_quick_command(cmd, skip_logging=True).stdout.decode()
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jalexander/src/dsd/blog_project/.venv/lib/python3.12/site-packages/django_simple_deploy/management/commands/utils/plugin_utils.py", line 189, in run_quick_comman
d                                           
    output = subprocess.run(cmd_parts, capture_output=True, check=check)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jalexander/.pyenv/versions/3.12.11/lib/python3.12/subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jalexander/.pyenv/versions/3.12.11/lib/python3.12/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/Users/jalexander/.pyenv/versions/3.12.11/lib/python3.12/subprocess.py", line 1955, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'doctl'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions