Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
/angular.jsPublic archive

Commit667ff87

Browse files
committed
chore(ci): deploy todocs.angularjs.org from within the corresponding directory
Previously, in order to deploy to Firebase from`scripts/docs.angularjs.org-firebase/`, we had to copy the`firebase.json` file to the repository root and adjust the containedpaths accordingly.By running the `firebase` CLI directly (instead of via `yarn`), we areable to deploy from `docs.angularjs.org-firebase/` directly. Thissimplifies the deployment (and local testing) process and paves the wayfor also deploying from `code.angularjs.org-firebase/` in a subsequentcommit.
1 parentb481a16 commit667ff87

File tree

5 files changed

+21
-27
lines changed

5 files changed

+21
-27
lines changed

‎.circleci/config.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -385,10 +385,20 @@ jobs:
385385
-custom_attach_workspace
386386
-init_environment
387387
-skip_unless_stable_branch
388-
# Install dependencies for Firebase functions to prevent parsing errors during deployment
389-
# See https://github.com/angular/angular.js/pull/16453
390-
-run:yarn --cwd scripts/docs.angularjs.org-firebase/functions --ignore-engines
391-
-run:yarn firebase deploy --message "Commit:\ $CI_COMMIT" --non-interactive --only hosting --project "docs-angularjs-org-9p2" --token "$FIREBASE_TOKEN"
388+
# Install dependencies for Firebase functions to prevent parsing errors during deployment.
389+
# See https://github.com/angular/angular.js/pull/16453.
390+
-run:
391+
name:Install dependencies in `scripts/docs.angularjs.org-firebase/functions/`.
392+
working_directory:scripts/docs.angularjs.org-firebase/functions
393+
command:yarn install --frozen-lockfile --ignore-engines --non-interactive
394+
-run:
395+
name:Deploy to Firebase from `scripts/docs.angularjs.org-firebase/`.
396+
working_directory:scripts/docs.angularjs.org-firebase
397+
command:|
398+
# Do not use `yarn firebase` as that causes the Firebase CLI to look for `firebase.json`
399+
# in the root directory, even if run from inside `scripts/docs.angularjs.org-firebase/`.
400+
firebase=$(yarn bin)/firebase
401+
$firebase deploy --message "Commit:\ $CI_COMMIT" --non-interactive --only hosting --project "docs-angularjs-org-9p2" --token "$FIREBASE_TOKEN"
392402
393403
workflows:
394404
version:2

‎.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,3 @@ npm-debug.log
2525
scripts/code.angularjs.org-firebase/deploy
2626
scripts/docs.angularjs.org-firebase/deploy
2727
scripts/docs.angularjs.org-firebase/functions/content
28-
/firebase.json

‎Gruntfile.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,6 @@ module.exports = function(grunt) {
518518
]);
519519
grunt.registerTask('prepareDeploy',[
520520
'copy:deployFirebaseCode',
521-
'firebaseDocsJsonForCI',
522521
'copy:deployFirebaseDocs'
523522
]);
524523
grunt.registerTask('default',['package']);

‎lib/grunt/utils.js

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,11 @@ var spawn = require('npm-run').spawn;
77

88
varCSP_CSS_HEADER='/* Include this file in your html if you are using the CSP mode. */\n\n';
99

10-
constcodeScriptFolder='scripts/code.angularjs.org-firebase';
11-
constdocsScriptFolder='scripts/docs.angularjs.org-firebase';
12-
1310
module.exports={
1411

15-
codeScriptFolder,
12+
codeScriptFolder:'scripts/code.angularjs.org-firebase',
1613

17-
docsScriptFolder,
14+
docsScriptFolder:'scripts/docs.angularjs.org-firebase',
1815

1916
startKarma:function(config,singleRun,done){
2017
varbrowsers=grunt.option('browsers');
@@ -306,18 +303,6 @@ module.exports = {
306303
}
307304
next();
308305
};
309-
},
310-
311-
// Our Firebase projects are in subfolders, but the firebase tool expects them in the root,
312-
// so we need to modify the upload folder path and copy the file into the root
313-
firebaseDocsJsonForCI:function(){
314-
varfileName=docsScriptFolder+'/firebase.json';
315-
varjson=grunt.file.readJSON(fileName);
316-
317-
(json.hosting||(json.hosting={})).public=docsScriptFolder+'/deploy';
318-
(json.functions||(json.functions={})).source=docsScriptFolder+'/functions';
319-
320-
grunt.file.write('firebase.json',JSON.stringify(json));
321306
}
322307

323308
};

‎scripts/docs.angularjs.org-firebase/readme.firebase.docs.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,20 @@ See `/scripts/code.angularjs.org-firebase/readme.firebase.code.md` for the Fireb
77

88
#Continuous integration
99

10-
The docs are deployed to Google Firebase hosting via a CI deployment config, which expects`firebase.json` to be in the repository root, which is done by a Grunt task (`firebaseDocsJsonForCI` which is included in`prepareDeploy`).
11-
The`firebaseDocsJsonForCI` task modifies the paths in the`firebase.json` and copies it to the repository root.
10+
The docs are deployed to Google Firebase hosting and functions automatically via CI.
1211

1312
See`.circleci/config.yml` for the complete deployment config and build steps.
1413

1514
#Serving locally:
1615

16+
- Run`cd scripts/docs.angularjs.org-firebase`.
17+
This changes the current working directory.
18+
1719
- Run`yarn grunt package`.
1820
This builds the files that will be deployed.
1921

2022
- Run`yarn grunt prepareDeploy`.
2123
This copies docs content files into`./deploy` and the partials for Search Engine AJAX Crawling into`./functions/content`.
22-
It also moves the`firebase.json` file to the root folder, where the firebase-cli expects it.
2324

24-
- Run`firebaseserve --only functions,hosting`
25+
- Run`$(yarn bin)/firebaseemulators:start` (or`..\..\node_modules\.bin\firebase emulators:start` on Windows).
2526
Creates a server athttp://localhost:5000 that serves from`./deploy` and uses the local function.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp