且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Grunt - 当文件和SFTP发生变化时观看文件

更新时间:2023-12-03 10:33:52

我想确认以下grunt-ssh( https://github.com/andrewrjones/grunt-ssh )任务配置对我来说工作得很好。请注意,grunt接受可能有助于调试的--verbose选项。请注意,从v0.6.2开始,grunt-ssh SFTP任务似乎不支持sshconfig语法,这在帮助页面中不是很清楚。

I would like to confirm that the following grunt-ssh (https://github.com/andrewrjones/grunt-ssh) task config worked fine for me. Note that grunt accepts --verbose option which may help debug. Note that as of v0.6.2 grunt-ssh SFTP task did not seem to support sshconfig syntax, which was not very clear from the help page.

    sftpCredentials: grunt.file.readJSON('sftp-credentials.json'),
    sftp: {
        deploy: {
            files: {
                "./": "deploy/**"
            },
            options: {
                "path": "<%= sftpCredentials.path %>",
                "host": "<%= sftpCredentials.host %>",
                "username": "<%= sftpCredentials.username %>",
                "port": "<%= sftpCredentials.port %>",
                "password": "<%= sftpCredentials.password %>",
                "srcBasePath": "deploy/",
                "createDirectories": true
            }
        }
    }