How to pass ssh key to dagu step? #591
-
Hi there, I am trying to run an rsync step in dagu in order to back some files up. Thanks for your help |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi, thanks for providing the details. I suggest using environment variables to pass the SSH key. Here’s how you could set it up: env:
- SSH_KEY=<ssh key>
steps:
- name: setup ssh-key
command: sh
script: |
# setup SSH credentials using $SSH_KEY
- name: rsync
command: [rsync, <options>]
depends_on: setup ssh-key Does this solve your issue? If it doesn't, please feel free to share more details so I can assist you further. Note: the |
Beta Was this translation helpful? Give feedback.
-
For clarity, you can pass the ssh keys either by mounting them onto the dagu server container, or by using environment variables as @yohamta shows in their answer. Either will work, and the keys will be available to the DAG steps. |
Beta Was this translation helpful? Give feedback.
For clarity, you can pass the ssh keys either by mounting them onto the dagu server container, or by using environment variables as @yohamta shows in their answer. Either will work, and the keys will be available to the DAG steps.