Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task runs without failing or uploading anything #116

Open
christiansmith opened this issue Jan 8, 2014 · 4 comments
Open

Task runs without failing or uploading anything #116

christiansmith opened this issue Jan 8, 2014 · 4 comments

Comments

@christiansmith
Copy link

What am I missing? I have a similar setup using 0.2.0-alpha.1 working on an older Mac with Snow Leopard. On my shiny new MBP with Mavericks nothing happens.

Versions:

  • node v0.10.23
  • npm 1.3.17
  • grunt-cli v0.1.11
  • grunt v0.4.2
  • grunt-s3 0.2.0-alpha.3

Config:

    s3: {
      options: {
        // key and secret are environment variables
        bucket: 'oauth2app'
      },
      dev: {
        upload: [
          { src: 'dist/index.html',         dest: 'index.html' },
          { src: 'dist/robots.txt',         dest: 'robots.txt' },
          { src: 'dist/favicon.ico',        dest: 'favicon.ico' },
          { src: 'dist/bower_components/*', dest: 'bower_components/' },
          { src: 'dist/css/*',              dest: 'css/' },
          { src: 'dist/images/*',           dest: 'images/' },
          { src: 'dist/scripts/*',          dest: 'scripts/' },
          { src: 'dist/styles/*',           dest: 'styles/' },
          { src: 'dist/views/*',            dest: 'views/' }
        ]
      }
    }

Output of running grunt s3 or grunt s3:dev:

$ grunt s3
Running "s3:dev" (s3) task

Done, without errors.

Any ideas? Thanks!

@christiansmith
Copy link
Author

Not sure what I changed, but its working now. Sorry!

@dagingaa
Copy link

FWIW, I'm having similar issues.

s3: {
    options: {
        key: config.s3.accessKeyId, // we load these as variables on top
        secret: config.s3.secretAccessKey,
        bucket: 'REDACTED',
        access: 'public-read',
        headers: {
            // One year cache policy in milliseconds
            "Cache-Control": "max-age=" + (1000 * 60 * 60 * 24 * 365) + ", public",
            "Expires": new Date(Date.now() + (1000 * 60 * 60 * 24 * 365)).toUTCString()
        }
    },
    sync: [
    {
        options: {
            verify: true, // Make sure the local files are newer than the ones in s3 and replace
            gzip: true,
            debug: true
        },
        src: [
            "<%= yeoman.tmp %>/{,*/}*"
        ],
        dest: [""],
        // make sure the wildcard paths are fully expanded in the dest
        rel: [
            "<%= yeoman.tmp %>/"
        ]
    }
    ]
},

Running with the -v option gives me:

Running "s3:sync" (s3) task
Verifying property s3.sync exists in config...OK
Warning: Object # has no method 'indexOf' Use --force to continue.

@dagingaa
Copy link

So, to anyone else having this problem: I was missing a level in the config. upload, sync etc. needs to be within an object in itself. (If you see "Running "s3:sync" (s3) task" you are doing something wrong).

@yazinsai
Copy link

yazinsai commented Dec 2, 2014

@dagingaa you're a life-saver! Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants