Open hvoigt opened 5 years ago
Hmm, FTP deployment did not changed recently. Can you please provide more specific examples of the issue, with YAML configurations and maybe links to the "good" and "bad" builds? If you are not comfortable to publish it here, feel free to send to support@appveyor.com.
Ok I investigated more into it. You are right it did not change. It is only the Linux deploy that is behaving differently. I was wondering that today the windows build went to a completely different location. So the following seems to be true:
On Windows for absolute paths in the sftp target configuration. The leading '/' is stripped and thus the path is made relative.
On Linux a leading '/' is always prefixed and thus the target path for sftp is always absolute. Additionally the path of the artifact inside the repository, which is what I referenced from the documentation, is also stripped.
Does that make sense or should I provide more specifics?
Can you reproduce this? FWIW here is my workaround appveyor.yml snippet to get Windows and Linux deploy in the same folder:
deploy:
- provider: FTP
host: host.example.com
protocol: sftp
username: user
password:
secure: XXXXXXX
folder: release
on:
branch: release
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- provider: FTP
host: host.example.com
protocol: sftp
username: user
password:
secure: XXXXXXX
folder: /home/user/release/installer
on:
branch: release
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
When using the Windows version with Linux it would try to deploy in /release
. When using the Linux version with Windows it would try to deploy in /home/user/home/user/release/installer
.
And that seems deliberate. I could not get Windows to use an absolute path and for Linux it is the opposite you can not get it to use a relative path. Interestingly when the path is already in the form the system seems to expect the beginning '/' is neither added nor stripped for both.
@hvoigt sorry for delay with answer and thank you for the catch. Another temporary workaround is to use Environment deployment, which behaves the same way as on Windows builds. Difference between Environment and Inline deployments is here.
Right now we are working on migration to the same (.NET Core based) code base for both Windows and Linux build agents. This issue will be fixed as part of this job.
I used to use relative paths when copying artefacts from the builder to a public folder via scp. This seems now impossible since a '/' is always prepended on whats specified with deploy/folder.
Another thing, that made me write this issue, is this paragraph in the docs: https://github.com/appveyor/website/blob/master/src/docs/deployment/ftp.md#copy-artifacts-to-remote-ftp-location
This also does not seem to be true anymore. My artefacts now get copied directly underneath the specified remote folder instead of preserving the artifact folder structure as described here.
Were these changes deliberate? Maybe the documentation needs to be adjusted?