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

Commit

Permalink
chore(docs.angularjs.org): actually fix deployment
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Narretz committed Jan 25, 2018
1 parent 0016265 commit 212e513
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ module.exports = function(grunt) {
'package',
'compress:deployFirebaseCode',
'copy:deployFirebaseCode',
'shell:symlink-firebase-docs',
'firebaseDocsJsonForTravis',
'copy:deployFirebaseDocs'
]);
grunt.registerTask('default', ['package']);
Expand Down
5 changes: 5 additions & 0 deletions lib/grunt/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,9 @@ module.exports = function(grunt) {
grunt.registerTask('collect-errors', 'Combine stripped error files', function() {
util.collectErrors();
});

grunt.registerTask('firebaseDocsJsonForTravis', function() {
util.firebaseDocsJsonForTravis();
});

};
11 changes: 11 additions & 0 deletions lib/grunt/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,5 +292,16 @@ module.exports = {
}
next();
};
},

// Our Firebase projects are in subfolders, but Travis expects them in the root,
// so we need to modify the upload folder path and copy the file into the root
firebaseDocsJsonForTravis: function() {
var fileName = 'scripts/docs.angularjs.org-firebase/firebase.json';
var json = grunt.file.readJSON(fileName);

json.hosting.public = 'uploadDocs';

grunt.file.write('firebase.json', JSON.stringify(json));
}
};

0 comments on commit 212e513

Please sign in to comment.