How can I deploy a directory to a FTP or SSH server, with a trigger and cloudbuild.yaml
?
So far I can already generate a listing of the files which I'd like to upload:
steps:
- name: 'ubuntu'
entrypoint: 'bash'
args:
- '-c'
- |-
find $_UPLOAD_DIRNAME -exec echo {} >> batch.txt \;
cat ./batch.txt
env:
...
I've came to the conclusion, that I don't want the FTP anti-pattern
and have therefore written an alternate SSH
cloudbuild.yaml
:scp
.ssh
.It logs in as user
root
, therefore remote/etc/ssh/sshd_config
needsPermitRootLogin yes
.My variable substitutions meanwhile look alike this:
And this would be the
cloudbuild.yaml
, which generally demonstrates how to set up SSH keys: