My team uses SFTP-deploy Atlassian Team Pipe as part of our CI. Anyway, whenever we have new folder in our code it breaks the build, because that folder doesn't exists on remote, and it don't try to create it.
Error it throws:
Couldn't canonicalize: No such file or directory
Unable to canonicalize path "/var/www/<server_url>/<new_folder>".
Is there any way to instruct it to create new folders on remote server?
@Nenad_Mitrovic one thing you could do is to run an ssh command before to create the missing folders. You can use the ssh-run Pipe for that:
script: - pipe: atlassian/ssh-run:0.2.4 variables: SSH_USER: 'ec2-user' SERVER: '127.0.0.1' COMMAND: 'mkdir -p /var/www/<server_url>/<new_folder>'
@Alexander Zhukov thank you for your quick response.
Because we don't know ahead of time which folder has been generated by user action (which triggered pipeline), does this mean that we could loop through local ./public folder, and execute that command for each folder in it?
(The previous step has generated all the folders/files that need to be pushed to the remote server, and stored ./public folder as artifact.)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well, executing the pipe once for each of the directories will work, but I'd suggest to create all the directories in a batch. For example, you can use ls to get the list of directories and change the ssh command to
mkdir -p /var/www/folder1 /var/www/folder2
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks!
That's what I meant, to ls /public folder (from a previous step artifacts), and to make it as input to ssh command. Sorry if I wasn't clear enough.
Again, thank you for your help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Nenad_Mitrovic - I am running into the same situation and would love if you can share a snippet of how you created the new local directories in Bitbucket which do not exist on the remote server. Is there a check to see if the remote directory exists or not before creating one?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Nenad_Mitrovic I thumb @Travis Abdelhamed's comment up coz I am curious about your solution too. Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.