Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 212e513

Browse files
committed
chore(docs.angularjs.org): actually fix deployment
When a file is symlinked, relative paths obviously aren't correct anymore. This error was masked because Travis didn't fail the job when Firebase couldn't find the public folder. To fix, we copy the file and adjust the folder path
1 parent 0016265 commit 212e513

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

Gruntfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ module.exports = function(grunt) {
479479
'package',
480480
'compress:deployFirebaseCode',
481481
'copy:deployFirebaseCode',
482-
'shell:symlink-firebase-docs',
482+
'firebaseDocsJsonForTravis',
483483
'copy:deployFirebaseDocs'
484484
]);
485485
grunt.registerTask('default', ['package']);

lib/grunt/plugins.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,9 @@ module.exports = function(grunt) {
6262
grunt.registerTask('collect-errors', 'Combine stripped error files', function() {
6363
util.collectErrors();
6464
});
65+
66+
grunt.registerTask('firebaseDocsJsonForTravis', function() {
67+
util.firebaseDocsJsonForTravis();
68+
});
69+
6570
};

lib/grunt/utils.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,5 +292,16 @@ module.exports = {
292292
}
293293
next();
294294
};
295+
},
296+
297+
// Our Firebase projects are in subfolders, but Travis expects them in the root,
298+
// so we need to modify the upload folder path and copy the file into the root
299+
firebaseDocsJsonForTravis: function() {
300+
var fileName = 'scripts/docs.angularjs.org-firebase/firebase.json';
301+
var json = grunt.file.readJSON(fileName);
302+
303+
json.hosting.public = 'uploadDocs';
304+
305+
grunt.file.write('firebase.json', JSON.stringify(json));
295306
}
296307
};

0 commit comments

Comments
 (0)