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

Commit 66dff7c

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 3072938 commit 66dff7c

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
@@ -78,6 +78,7 @@ jobs:
7878
keep_alive &
7979
deploy:
8080
- provider: firebase
81+
# the upload folder for firebase is configured in /firebase.json
8182
skip_cleanup: true
8283
token:
8384
secure: $FIREBASE_TOKEN
@@ -92,7 +93,7 @@ jobs:
9293
secret_access_key:
9394
secure: tHIFdSq55qkyZf9zT/3+VkhUrTvOTMuswxXU3KyWaBrSieZqG0UnUDyNm+n3lSfX95zEl/+rJAWbfvhVSxZi13ndOtvRF+MdI1cvow2JynP0aDSiPffEvVrZOmihD6mt2SlMfhskr5FTduQ69kZG6DfLcve1PPDaIwnbOv3phb8=
9495
bucket: code-angularjs-org-338b8.appspot.com
95-
local-dir: upload
96+
local-dir: uploadCode
9697
detect_encoding: true # detects gzip compression
9798
on:
9899
repo: angular/angular.js

Gruntfile.js

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

@@ -427,14 +449,19 @@ module.exports = function(grunt) {
427449
'collect-errors',
428450
'write',
429451
'docs',
430-
'copy',
452+
'copy:i18n',
431453
'compress:build'
432454
]);
433455
grunt.registerTask('ci-checks', [
434456
'ddescribe-iit',
435457
'merge-conflict',
436458
'eslint'
437459
]);
460+
grunt.registerTask('prepareFirebaseDeploy', [
461+
'package',
462+
'compress:deployFirebaseCode',
463+
'copy:deployFirebaseDocs'
464+
]);
438465
grunt.registerTask('default', ['package']);
439466
};
440467

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)