Hi everyone.
I’m triying to upload mi project to a custom SFTP server. Currently, I’m using a Ubuntu Focal enviroment.
To build the URL, I encrypt the following with the travis-ci cli, using travis encript --pro command:
- The user - SFTP_USER
- The password - SFTP_PASSWORD
- My public IP adress: SFTP_DOMAIN
- The directory where I want to store the project: SFTP_DIRECTORY
The travis.yml file looks like:
env:
global:
- secure ....
- secure ...
- secure ...
- SFTP_KEY. I generate it in the server with the command "ssh-keygen", so I don't re-encrypt this key.
The problem comes when the build reach the after_success stage and run the following:
- echo "${SFTP_KEY}" | base64 --decode > /tmp/sftp_rsa
- cd $HOME/.m2/repository/acme
- zip -r acme.zip acme-tfg
- curl -T acme.zip --key /tmp/sftp_rsa sftp://${SFTP_USER}: {SFTP_PASSWORD}@{SFTP_DOMAIN}/{SFTP_DIRECTORY}/acme.zip
The last command exits with a “curl: (6) Could not resolve host: SFTP_DOMAIN
”.
I suppose the other variables are correctly desencripted, but it seems that travis doesn´t desencripted the SFTP_DOMAIN
variable and cURL doesn´t be able to connect. I’m right? Or maybe I cannot encrypt the IP adress? Maybe some configuration is missing?
I followed this doc page: https://docs.travis-ci.com/user/deployment/custom/
Thanks in advance.