Skip to content

Commit 44b451f

Browse files
fblundunalexanderdean
authored andcommitted
Switched Cloudfront invalidation from grunt-invalidate-cloudfront to grunt-cloudfront-clear (closes snowplow#230)
1 parent fda5859 commit 44b451f

3 files changed

Lines changed: 24 additions & 34 deletions

File tree

CHANGELOG

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ Added PerformanceTiming context using HTML5 Web Performance API (#248)
77
Added ability to execute a custom callback once sp.js is loaded (#246)
88
Added internal site search event (#241)
99
Improved document height detection (#236) (TODO)
10-
Fixed SauceLabs red status (#235) (TODO)
11-
Fixed CloudFront cache invalidation (#230) (TODO)
10+
Fixed CloudFront cache invalidation (#230)
1211
Renamed /dist to /deploy (#216)
1312
Moved context querystring to end of JS-generated beacons (#204)
1413
Added guard to wait until outbound queue is empty before unloading (#202)

Gruntfile.js

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ module.exports = function(grunt) {
171171
grunt.loadNpmTasks('grunt-contrib-concat');
172172
grunt.loadNpmTasks('grunt-yui-compressor');
173173
grunt.loadNpmTasks('grunt-s3');
174-
grunt.loadNpmTasks('grunt-invalidate-cloudfront');
174+
grunt.loadNpmTasks('grunt-cloudfront-clear');
175175
grunt.loadNpmTasks('grunt-browserify');
176176
grunt.loadNpmTasks('intern');
177177
grunt.loadNpmTasks('grunt-lodash');
@@ -217,34 +217,25 @@ module.exports = function(grunt) {
217217
},
218218
});
219219

220-
grunt.config('invalidate_cloudfront', {
221-
options: {
222-
key: '<%= aws.key %>',
223-
secret: '<%= aws.secret %>',
224-
distribution: '<%= aws.distribution %>'
220+
grunt.config('cloudfront_clear', {
221+
pinned: {
222+
resourcePaths: ['<%= pkg.pinnedVersion %>/sp.js'],
223+
secret_key: '<%= aws.secret %>',
224+
access_key: '<%= aws.key %>',
225+
dist: '<%= aws.distribution %>'
225226
},
226227
not_pinned: {
227-
files: [
228-
{
229-
src: ['<%= pkg.version %>/sp.js'],
230-
dest: ''
231-
}
232-
]
233-
},
234-
pinned: {
235-
files: [
236-
{
237-
src: ['<%= pkg.pinnedVersion %>/sp.js'],
238-
dest: ''
239-
}
240-
]
228+
resourcePaths: ['<%= pkg.version %>/sp.js'],
229+
secret_key: '<%= aws.secret %>',
230+
access_key: '<%= aws.key %>',
231+
dist: '<%= aws.distribution %>'
241232
}
242233
});
243234
});
244235

245236
grunt.registerTask('default', 'Build lodash, Browserify, add banner, and minify', ['lodash', 'browserify:main', 'concat:deploy', 'min:deploy']);
246-
grunt.registerTask('publish', 'Upload to S3 and invalidate Cloudfront (full semantic version only)', ['upload_setup', 'lodash', 'browserify:main', 'concat:deploy', 'min:deploy', 's3:not_pinned', 'invalidate_cloudfront:not_pinned']);
247-
grunt.registerTask('publish-pinned', 'Upload to S3 and invalidate Cloudfront (full semantic version and semantic major version)', ['upload_setup', 'lodash', 'browserify:main', 'concat:deploy', 'min:deploy', 's3', 'invalidate_cloudfront']);
237+
grunt.registerTask('publish', 'Upload to S3 and invalidate Cloudfront (full semantic version only)', ['upload_setup', 'lodash', 'browserify:main', 'concat:deploy', 'min:deploy', 's3:not_pinned', 'cloudfront_clear:not_pinned']);
238+
grunt.registerTask('publish-pinned', 'Upload to S3 and invalidate Cloudfront (full semantic version and semantic major version)', ['upload_setup', 'lodash', 'browserify:main', 'concat:deploy', 'min:deploy', 's3', 'cloudfront_clear']);
248239
grunt.registerTask('test', 'Intern tests', ['browserify:test', 'intern']);
249240
grunt.registerTask('travis', 'Intern tests for Travis CI', ['lodash','browserify:test','intern']);
250241
grunt.registerTask('tags', 'Minifiy the Snowplow invocation tag', ['min:tag', 'concat:tag']);

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22
"name": "snowplow-tracker",
33
"version": "2.1.0",
44
"devDependencies": {
5+
"JSON": "~1.0.0",
6+
"browser-cookie-lite": "~0.3.1",
7+
"browserify": "~3.28.1",
58
"grunt": "~0.4.2",
6-
"intern": "~1.5.0",
7-
"semver": "~2.2.1",
9+
"grunt-browserify": "~1.3.0",
10+
"grunt-cloudfront-clear": "0.0.1",
811
"grunt-contrib-concat": "~0.3.0",
9-
"grunt-yui-compressor": "git://github.com/fblundun/grunt-yui-compressor.git#feature/issue-8",
10-
"grunt-invalidate-cloudfront": "~0.1.4",
12+
"grunt-lodash": "~0.3.0",
1113
"grunt-s3": "~0.2.0-alpha.3",
12-
"murmurhash": "0.0.2",
13-
"browserify": "~3.28.1",
14-
"grunt-browserify": "~1.3.0",
14+
"grunt-yui-compressor": "git://github.com/fblundun/grunt-yui-compressor.git#feature/issue-8",
15+
"intern": "~1.5.0",
1516
"jstimezonedetect": "~1.0.5",
16-
"JSON": "~1.0.0",
17+
"murmurhash": "0.0.2",
18+
"semver": "~2.2.1",
1719
"sha1": "git://github.com/pvorb/node-sha1.git#v1.0.0",
18-
"grunt-lodash": "~0.3.0",
19-
"browser-cookie-lite": "~0.3.1",
2020
"snowplow-tracker-core": "0.3.0"
2121
},
2222
"contributors": [

0 commit comments

Comments
 (0)