SebastianG
SebastianG

Reputation: 9594

ncftp deployment (via butbucket pipelines) getting "server said: www: no such file or directory" but path in filezilla is exactly right

I'm trying to automate deployment via ftp via bitbucket pipelines.

Path is:

/var/www/vhosts/maindomain.com/subdomain.maindomain.com

Tried it with and without the first forward slash in there. Also checked the default path when you connect and its maindomain.com/subdomain.maindomain.com -- tried that too but same error.

Code looks like this:

image: node:9.8.0
    pipelines:
      default:
        - step:
            name: Deployment
            script:
              - apt-get update
              - apt-get install ncftp
              - ncftpput -v -u "$FTP_USERNAME" -p "$FTP_PASSWORD" -R $FTP_HOST $FTP_SITE_ROOT dist/*
              - echo Finished uploading /dist files to $FTP_HOST$FTP_SITE_ROOT

But the problem is ncftp doesn't like the file path to upload no matter what. I've been using the one showing up in filezilla after navigating to that folder whilst connecting with the exact same credentials.

How could I trackdown the right path or troubleshoot this forward?

Upvotes: 0

Views: 548

Answers (2)

Jay Patel
Jay Patel

Reputation: 21

Don't need to add the full path of FTP site just put the path as below.

-R /maindomain.com/subdomain.maindomain.com dist/*

for check the physical path of site, site->manage ftp site-> advance setting. where you find the physical path that we don't need to include when we use cli.

Upvotes: 0

SebastianG
SebastianG

Reputation: 9594

I think the problem lies with my server only accepting SFTP connections and can't set port to 22 as NCFTP does not support SSH. I'm currently look at lftp as an alternative, will post here the syntax if I figure it out.

Edit: Does not scale well, will be pursuing different avenues for continuous deployment.

Upvotes: 0

Related Questions