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

Commit 8f88ea5

Browse files
committed
chore(docs.angularjs.org): fix docs deploy for source file changes
Since the embedded examples in the docs app now include the local source files instead of CDN files, we need to include the source files into the folder that is deployed to Firebase hosting
1 parent 24b0b51 commit 8f88ea5

File tree

4 files changed

+36
-9
lines changed

4 files changed

+36
-9
lines changed

.travis.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ jobs:
7979
keep_alive &
8080
deploy:
8181
- provider: firebase
82+
# the upload folder for firebase is configured in /firebase.json
8283
skip_cleanup: true
8384
token:
8485
secure: $FIREBASE_TOKEN
@@ -93,7 +94,7 @@ jobs:
9394
secret_access_key:
9495
secure: tHIFdSq55qkyZf9zT/3+VkhUrTvOTMuswxXU3KyWaBrSieZqG0UnUDyNm+n3lSfX95zEl/+rJAWbfvhVSxZi13ndOtvRF+MdI1cvow2JynP0aDSiPffEvVrZOmihD6mt2SlMfhskr5FTduQ69kZG6DfLcve1PPDaIwnbOv3phb8=
9596
bucket: code-angularjs-org-338b8.appspot.com
96-
local-dir: upload
97+
local-dir: uploadCode
9798
detect_encoding: true # detects gzip compression
9899
on:
99100
repo: angular/angular.js

Gruntfile.js

+31-4
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,29 @@ module.exports = function(grunt) {
312312
copy: {
313313
i18n: {
314314
files: [
315-
{ src: 'src/ngLocale/**', dest: 'build/i18n/', expand: true, flatten: true }
315+
{
316+
src: 'src/ngLocale/**',
317+
dest: 'build/i18n/',
318+
expand: true,
319+
flatten: true
320+
}
321+
]
322+
},
323+
deployFirebaseDocs: {
324+
files: [
325+
// The source files are needed by the embedded examples in the docs app.
326+
{
327+
src: 'build/angular*.{js.map,min.js}',
328+
dest: 'uploadDocs/',
329+
expand: true,
330+
flatten: true
331+
},
332+
{
333+
cwd: 'build/docs',
334+
src: '**',
335+
dest: 'uploadDocs/',
336+
expand: true
337+
}
316338
]
317339
}
318340
},
@@ -327,14 +349,14 @@ module.exports = function(grunt) {
327349
dot: true,
328350
dest: dist + '/'
329351
},
330-
firebaseCodeDeploy: {
352+
deployFirebaseCode: {
331353
options: {
332354
mode: 'gzip'
333355
},
334356
src: ['**'],
335357
cwd: 'build',
336358
expand: true,
337-
dest: 'upload/' + deployVersion + '/'
359+
dest: 'uploadCode/' + deployVersion + '/'
338360
}
339361
},
340362

@@ -428,14 +450,19 @@ module.exports = function(grunt) {
428450
'collect-errors',
429451
'write',
430452
'docs',
431-
'copy',
453+
'copy:i18n',
432454
'compress:build'
433455
]);
434456
grunt.registerTask('ci-checks', [
435457
'ddescribe-iit',
436458
'merge-conflict',
437459
'eslint'
438460
]);
461+
grunt.registerTask('prepareFirebaseDeploy', [
462+
'package',
463+
'compress:deployFirebaseCode',
464+
'copy:deployFirebaseDocs'
465+
]);
439466
grunt.registerTask('default', ['package']);
440467
};
441468

firebase.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"hosting": {
3-
"public": "build/docs",
3+
"public": "uploadDocs",
44
"ignore": [
55
"/index.html",
66
"/index-debug.html",
@@ -16,7 +16,7 @@
1616
"destination": "/index-production.html"
1717
},
1818
{
19-
"source": "**/*!(.jpg|.jpeg|.gif|.png|.html|.js|.json|.css|.svg|.ttf|.woff|.woff2|.eot)",
19+
"source": "**/*!(.jpg|.jpeg|.gif|.png|.html|.js|.map|.json|.css|.svg|.ttf|.woff|.woff2|.eot)",
2020
"destination": "/index-production.html"
2121
}
2222
]

scripts/travis/build.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ case "$JOB" in
4848
"deploy")
4949
# we never deploy on Pull requests, so it's safe to skip the build here
5050
if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then
51-
grunt package
52-
grunt compress:firebaseCodeDeploy
51+
grunt prepareFirebaseDeploy
5352
else
5453
echo "Skipping build because Travis has been triggered by Pull Request"
5554
fi

0 commit comments

Comments
 (0)