7

.cssファイルが Sass からコンパイルされたときに、ファイルを自動的にアップロードしようとしています。これは私が持っているものですGruntfile.js

module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    watch: {
      coffee: {
        files: ['**/*.coffee'],
        tasks: ['coffee']
      },
      scripts: {
        files: ['**/*.scss'],
        tasks: ['compass']
      },
      sftp: {
        files: ['**/*.css'],
        tasks: ['sftp-deploy']
      }
    },
    coffee: {
      compile: {
        files: {
          'testing.js': 'testing.coffee'
        }
      }
    },
    compass: {
      dist: {
        options: {
          config: 'config.rb'
        }
      }
    },

    'sftp-deploy': {
      build: {
        auth: {
          host: 'example.com',
          port: 22,
          authKey: 'key2'
        },
        src: 'styles/',
        dest: 'styles/',
        exclusions: ['**/.DS_Store'],
        server_sep: '/'
      }
    }
  });

  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-contrib-coffee');
  grunt.loadNpmTasks('grunt-contrib-compass');
  grunt.loadNpmTasks('grunt-sftp-deploy');


  // Default task(s).
  grunt.registerTask('default', ['watch']);

};

をコンパイルします.cssが、アップロードしていないようです。何か案は?

4

2 に答える 2

2

次の grunt-ssh ( https://github.com/andrewrjones/grunt-ssh ) タスク構成がうまく機能したことを確認したいと思います。grunt は、デバッグに役立つ --verbose オプションを受け入れることに注意してください。v0.6.2 の時点で、grunt-ssh SFTP タスクは sshconfig 構文をサポートしていないようで、ヘルプ ページからはあまり明確ではありませんでした。

    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
            }
        }
    }
于 2013-08-30T04:37:11.847 に答える