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

Add build step to clear CloudFront cache on official build #682

Merged
merged 9 commits into from Nov 24, 2017

Conversation

olamothe
Copy link
Member

@olamothe olamothe commented Nov 22, 2017

This will be used for hotfix.

I changed the naming of the files/chunk that we produce to append the hash generated by webpack, so that chunks do not get overwritten.

The entry point name does not change (CoveoJsSearch.js, CoveoJsSearch.Lazy.js).

I did that because if we simply override the file name, there is a possible downtime in search page between the couple of seconds that it takes to finish all the "deploy" steps in travis, and then to start the "after_deploy" step.

By not overriding old files, this means the "old" entry point still works properly as we are uploading new files, then, when the deploy is finished, we can invalidate old files (so the "new" entry point will begin serving new chunks).

In theory this should mean no downtime, and minimal waiting time between an hotfix being built, and it being available (couple of seconds at worst).

Deploy

@coveralls
Copy link

Coverage Status

Coverage remained the same at 83.659% when pulling 001dde6 on JSUI-1923 into 9800610 on master.

console.log(colors.red(error.message));
console.log(colors.red('*************'));
exec('travis_terminate 1');
throw error;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary to throw this error even though you are terminating the process on line 39? Are we catching or relying on node.js to catch? If the latter, wouldn't that crash the server?

Edit: I guess this will only crash the travis instance which isn't a big deal. But still, why do it if we terminate on the line before?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, the throw is not 100% needed.

It's going to print the error in the console though, which can be useful to debug.

The travis terminate will cause the travis build to fail. The server will not "crash".

@olamothe olamothe merged commit 0f5b8a6 into master Nov 24, 2017
@olamothe olamothe deleted the JSUI-1923 branch November 24, 2017 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants