jpillora / grunt-aws

A Grunt interface into the Amazon Node.JS SDK
171 stars 44 forks source link

Uploads to multiple buckets from one grunt script #15

Closed JamesHagerman closed 9 years ago

JamesHagerman commented 9 years ago

I've got an app that I need to put into two separate S3 buckets with slightly different files going to each. Grunt says "No files matched" using a config that looks like this:

https://gist.github.com/JamesHagerman/7aff419e11fb4b519afa

Any ideas on getting this to work?

jpillora commented 9 years ago

"No files matched" means there are no local files to upload, cwd is the current working directory (the base directory of src), so there are no files matching build1/** and build2/**. Note you can shorten your config by moving your common options up.

s3: {
  options: {
      accessKeyId: "<%= aws.accessKeyId %>",
      secretAccessKey: "<%= aws.secretAccessKey %>"
  },
  brand1: {
    options: {
      bucket: "brand1-bucket"
    },
    build: {
      cwd: "build2/",
      src: "**",
    }
  },
  brand2: {
    options: {
      bucket: "brand2-bucket"
    },
    build: {
      cwd: "build1/",
      src: "**",
    }
  }
}
chillyistkult commented 9 years ago

Got the same error and its working without the env configuration. Probably a problem with your package.

jpillora commented 9 years ago

Just looked at this again, I think it should be:

  brand1: {
    options: {
      bucket: "brand1-bucket"
    },
    cwd: "build2/",
    src: "**"
  },

The build: {...} was causing it have no src set

JamesHagerman commented 9 years ago

I finally got it working with this help. Sorry about the delay!

Thank you!