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

It is worthy to mention deployment script modifications for VERSION.txt in the documentation #40

Open
Romanior opened this issue May 9, 2018 · 4 comments

Comments

@Romanior
Copy link

Romanior commented May 9, 2018

As many would use ember-cli-deploy, VERSION.txt should go in separate step, e.g.

// ./config/deploy.js
  let ENV = {
    pipeline: {
      alias: {
        s3: { as: ['s3-version', 's3'] },
      },
    's3-version': {
      bucket: '***',
      region: '**',
      filePattern: 'VERSION.txt',
      cacheControl: 'max-age=0, no-cache',
      expires: 1525781737
    },
...
    },

It is good idea to have the same bucket as index file.

@bgentry
Copy link
Contributor

bgentry commented Jun 11, 2018

I made these changes in my config/deploy.js to make it work well with the version file:

    cloudfront: {
      accessKeyId: process.env.AWS_KEY,
      secretAccessKey: process.env.AWS_SECRET,
      distribution: process.env.AWS_CLOUDFRONT_DISTRIBUTION,
      objectPaths: ["/index.html", "/VERSION.txt*"],
    },
    gzip: {
      ignorePattern: "VERSION.txt",
    },
    manifest: {
      fileIgnorePattern: "VERSION.txt",
    },

I think a section in the readme specific to ember-cli-deploy would be pretty useful since that's the most common deployment setup. Can probably include a short paragraph to explain what needs to be done in general for other solutions too.

@jrjohnson
Copy link
Contributor

jrjohnson commented Jul 11, 2018

Given https://github.com/sethwebster/ember-cli-new-version/blob/master/addon/components/new-version-notifier/component.js#L62 I don't think you need to worry about specific cache policies. They are going to be ignored anyway.

I'm not sure about the reason to not gzip either. Maybe something in your specific setup?

Mainly just curious as I just added this and I want to make sure I didn't miss anything in my deployment.

@averydev
Copy link

averydev commented Oct 8, 2019

I stumbled on this as well.

To get this to work, i needed to include:

manifest: {
      fileIgnorePattern: "VERSION.txt",
    }

Without that, the VERSION.txt file is ignored when it comes time to upload to s3.

In addition, my CloudFront distro was caching the VERSION.txt even with the cache busting query param which is appended to the request.

In CloudFront I created a Behavior for that file to override the TTL.

None of that was hard, but it took some time to figure out. +1 for including some discussion in the docs.

@knownasilya
Copy link
Collaborator

@averydev I'm open to a section in the readme about deployment. Could you submit a PR for cloudfront/s3?

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

No branches or pull requests

5 participants