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
This commit is contained in:
Martin Staffa
2017-08-22 12:16:04 +02:00
committed by Martin Staffa
parent 3072938186
commit 66dff7cf5f
4 changed files with 36 additions and 9 deletions
+2 -1
View File
@@ -78,6 +78,7 @@ jobs:
keep_alive &
deploy:
- provider: firebase
# the upload folder for firebase is configured in /firebase.json
skip_cleanup: true
token:
secure: $FIREBASE_TOKEN
@@ -92,7 +93,7 @@ jobs:
secret_access_key:
secure: tHIFdSq55qkyZf9zT/3+VkhUrTvOTMuswxXU3KyWaBrSieZqG0UnUDyNm+n3lSfX95zEl/+rJAWbfvhVSxZi13ndOtvRF+MdI1cvow2JynP0aDSiPffEvVrZOmihD6mt2SlMfhskr5FTduQ69kZG6DfLcve1PPDaIwnbOv3phb8=
bucket: code-angularjs-org-338b8.appspot.com
local-dir: upload
local-dir: uploadCode
detect_encoding: true # detects gzip compression
on:
repo: angular/angular.js
+31 -4
View File
@@ -311,7 +311,29 @@ module.exports = function(grunt) {
copy: {
i18n: {
files: [
{ src: 'src/ngLocale/**', dest: 'build/i18n/', expand: true, flatten: true }
{
src: 'src/ngLocale/**',
dest: 'build/i18n/',
expand: true,
flatten: true
}
]
},
deployFirebaseDocs: {
files: [
// The source files are needed by the embedded examples in the docs app.
{
src: 'build/angular*.{js.map,min.js}',
dest: 'uploadDocs/',
expand: true,
flatten: true
},
{
cwd: 'build/docs',
src: '**',
dest: 'uploadDocs/',
expand: true
}
]
}
},
@@ -326,14 +348,14 @@ module.exports = function(grunt) {
dot: true,
dest: dist + '/'
},
firebaseCodeDeploy: {
deployFirebaseCode: {
options: {
mode: 'gzip'
},
src: ['**'],
cwd: 'build',
expand: true,
dest: 'upload/' + deployVersion + '/'
dest: 'uploadCode/' + deployVersion + '/'
}
},
@@ -427,7 +449,7 @@ module.exports = function(grunt) {
'collect-errors',
'write',
'docs',
'copy',
'copy:i18n',
'compress:build'
]);
grunt.registerTask('ci-checks', [
@@ -435,6 +457,11 @@ module.exports = function(grunt) {
'merge-conflict',
'eslint'
]);
grunt.registerTask('prepareFirebaseDeploy', [
'package',
'compress:deployFirebaseCode',
'copy:deployFirebaseDocs'
]);
grunt.registerTask('default', ['package']);
};
+2 -2
View File
@@ -1,6 +1,6 @@
{
"hosting": {
"public": "build/docs",
"public": "uploadDocs",
"ignore": [
"/index.html",
"/index-debug.html",
@@ -16,7 +16,7 @@
"destination": "/index-production.html"
},
{
"source": "**/*!(.jpg|.jpeg|.gif|.png|.html|.js|.json|.css|.svg|.ttf|.woff|.woff2|.eot)",
"source": "**/*!(.jpg|.jpeg|.gif|.png|.html|.js|.map|.json|.css|.svg|.ttf|.woff|.woff2|.eot)",
"destination": "/index-production.html"
}
]
+1 -2
View File
@@ -48,8 +48,7 @@ case "$JOB" in
"deploy")
# we never deploy on Pull requests, so it's safe to skip the build here
if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then
grunt package
grunt compress:firebaseCodeDeploy
grunt prepareFirebaseDeploy
else
echo "Skipping build because Travis has been triggered by Pull Request"
fi