From 9196c80c3394d0afcfc4f3ab0ec881d501190fe3 Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Mon, 12 Feb 2018 10:47:42 +0100 Subject: [PATCH] chore(deploy): rename deploy folders --- .gitignore | 1 + .travis.yml | 2 +- Gruntfile.js | 17 +++++++++++------ lib/grunt/utils.js | 6 ++++-- .../docs.angularjs.org-firebase/firebase.json | 2 +- scripts/travis/build.sh | 2 +- 6 files changed, 19 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 2da934151..588beda3f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /build/ +/deploy/ /benchpress-build/ .DS_Store gen_docs.disable diff --git a/.travis.yml b/.travis.yml index 4c226f02f..3199f7718 100644 --- a/.travis.yml +++ b/.travis.yml @@ -94,7 +94,7 @@ jobs: secret_access_key: secure: tHIFdSq55qkyZf9zT/3+VkhUrTvOTMuswxXU3KyWaBrSieZqG0UnUDyNm+n3lSfX95zEl/+rJAWbfvhVSxZi13ndOtvRF+MdI1cvow2JynP0aDSiPffEvVrZOmihD6mt2SlMfhskr5FTduQ69kZG6DfLcve1PPDaIwnbOv3phb8= bucket: code-angularjs-org-338b8.appspot.com - local-dir: uploadCode + local-dir: deploy/code detect_encoding: true # detects gzip compression on: repo: angular/angular.js diff --git a/Gruntfile.js b/Gruntfile.js index 5cc2dd778..c42113fc2 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -163,7 +163,10 @@ module.exports = function(grunt) { clean: { build: ['build'], tmp: ['tmp'], - deploy: ['uploadDocs', 'uploadCode'] + deploy: [ + 'deploy/docs', + 'deploy/code' + ] }, eslint: { @@ -319,7 +322,7 @@ module.exports = function(grunt) { { cwd: 'build', src: '**/*.{zip,jpg,jpeg,png}', - dest: 'uploadCode/' + deployVersion + '/', + dest: 'deploy/code/' + deployVersion + '/', expand: true } ] @@ -329,14 +332,16 @@ module.exports = function(grunt) { // The source files are needed by the embedded examples in the docs app. { src: ['build/angular*.{js,js.map,min.js}', 'build/sitemap.xml'], - dest: 'uploadDocs/', + dest: 'deploy/docs/', expand: true, flatten: true }, { cwd: 'build/docs', src: '**', - dest: 'uploadDocs/', + dest: 'deploy/docs/', + expand: true + } expand: true } ] @@ -361,7 +366,7 @@ module.exports = function(grunt) { src: ['**', '!**/*.{zip,png,jpeg,jpg}'], cwd: 'build', expand: true, - dest: 'uploadCode/' + deployVersion + '/' + dest: 'deploy/code/' + deployVersion + '/' } }, @@ -461,7 +466,7 @@ module.exports = function(grunt) { 'merge-conflict', 'eslint' ]); - grunt.registerTask('prepareFirebaseDeploy', [ + grunt.registerTask('prepareDeploy', [ 'package', 'compress:deployFirebaseCode', 'copy:deployFirebaseCode', diff --git a/lib/grunt/utils.js b/lib/grunt/utils.js index 80e529186..c5b16946b 100644 --- a/lib/grunt/utils.js +++ b/lib/grunt/utils.js @@ -297,10 +297,12 @@ module.exports = { // 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 docsScriptFolder = 'scripts/docs.angularjs.org-firebase/'; + + var fileName = docsScriptFolder + 'firebase.json'; var json = grunt.file.readJSON(fileName); - json.hosting.public = 'uploadDocs'; + json.hosting.public = 'deploy/docs'; grunt.file.write('firebase.json', JSON.stringify(json)); } diff --git a/scripts/docs.angularjs.org-firebase/firebase.json b/scripts/docs.angularjs.org-firebase/firebase.json index 91f9a778b..abb70329f 100644 --- a/scripts/docs.angularjs.org-firebase/firebase.json +++ b/scripts/docs.angularjs.org-firebase/firebase.json @@ -1,6 +1,6 @@ { "hosting": { - "public": "../../uploadDocs", + "public": "../../deploy/docs", "ignore": [ "/index.html", "/index-debug.html", diff --git a/scripts/travis/build.sh b/scripts/travis/build.sh index fdf94d8f1..980855388 100755 --- a/scripts/travis/build.sh +++ b/scripts/travis/build.sh @@ -79,7 +79,7 @@ case "$JOB" in fi if [[ "$DEPLOY_DOCS" == true || "$DEPLOY_CODE" == true ]]; then - grunt prepareFirebaseDeploy + grunt prepareDeploy else echo "Skipping deployment build because conditions have not been met." fi