I was trying to set up Grunt to deploy to my development server.
According to the output in the terminal all went well. However no files were being uploaded.
$>grunt Running "dploy:stage" (dploy) task Connecting to ftp.my-dev-server.com... Checking revisions... Uploading files... [ + ] File uploaded: /Users/MyUser/Sites/my-site-folder/dev/.rev: Upload completed for ftp.my-dev-server.com All Completed :) Take note of where it says: Uploading files... [ + ] File uploaded: /Users/MyUser/Sites/my-site-folder/dev/.rev:
When setting up the info in my grunt.js file, I had used the full path as output by the “pwd” command like this:
dploy: { stage: { host: "ftp3.ftptoyoursite.com", user: "user-name", pass: "password here", scheme: "sftp", port: "22", path: { local: "/Users/MyUser/Sites/my-site-folder/dev/", <-- full path is WRONG remote: "/dev.okonlabs.com/web/content" } }
}
According to the feedback in the terminal (shown above) it "appears" to have worked just fine. However, this is WRONG.
Actually the grunt.js file needs to have the stage: path: local: value to be the path as seen from the project root. As in, the same place as where the grunt.js file resides.
dploy: { stage: { host: "ftp3.ftptoyoursite.com", user: "user-name", pass: "password here", scheme: "sftp", port: "22", path: { local: "/", <-- IMPORTANT! remote: "/dev.okonlabs.com/web/content" } }
}
I hope that will save you a few hours of scratching your head. : )