-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(@angular/cli): implement deploy command
- Loading branch information
Showing
7 changed files
with
105 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/** | ||
* @license | ||
* Copyright Google Inc. All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
import { ArchitectCommand, ArchitectCommandOptions } from '../models/architect-command'; | ||
import { Arguments } from '../models/interface'; | ||
import { Schema as DeployCommandSchema } from './deploy'; | ||
|
||
const BuilderMissing = ` | ||
Cannot find "deploy" target for the specified project. | ||
You should add a package that implements deployment capabilities for your | ||
favorite platform. | ||
For example: | ||
ng add @angular/fire | ||
ng add @azure/ng-deploy | ||
ng add @zeit/ng-deploy | ||
Find more packages on npm https://www.npmjs.com/search?q=ng%20deploy | ||
`; | ||
|
||
export class DeployCommand extends ArchitectCommand<DeployCommandSchema> { | ||
public readonly target = 'deploy'; | ||
public readonly missingTargetError = BuilderMissing; | ||
|
||
public async run(options: ArchitectCommandOptions & Arguments) { | ||
return this.runArchitectTarget(options); | ||
} | ||
|
||
public async initialize(options: DeployCommandSchema & Arguments): Promise<void> { | ||
if (!options.help) { | ||
return super.initialize(options); | ||
} | ||
} | ||
|
||
async reportAnalytics( | ||
paths: string[], | ||
options: DeployCommandSchema & Arguments, | ||
dimensions: (boolean | number | string)[] = [], | ||
metrics: (boolean | number | string)[] = [], | ||
): Promise<void> { | ||
return super.reportAnalytics(paths, options, dimensions, metrics); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
The `ng deploy` command is a shortcut for: | ||
|
||
``` | ||
ng run [PROJECT_NAME]:deploy | ||
``` | ||
|
||
It takes an optional project name, as specified in the `projects` section of the `angular.json` workspace configuration file. | ||
|
||
When a project name is not supplied, the CLI will execute the `deploy` builder for the default project. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"$schema": "http://json-schema.org/schema", | ||
"$id": "ng-cli://commands/deploy.json", | ||
"description": "Invokes the deploy builder for a specified project. If no project is specified, the CLI will invoke the deploy builder for the default project in the workspace.", | ||
"$longDescription": "./deploy-long.md", | ||
|
||
"$aliases": [ "d" ], | ||
"$scope": "in", | ||
"$type": "architect", | ||
"$impl": "./deploy-impl#DeployCommand", | ||
|
||
"allOf": [ | ||
{ | ||
"properties": { | ||
"project": { | ||
"type": "string", | ||
"description": "The name of the project to deploy.", | ||
"$default": { | ||
"$source": "argv", | ||
"index": 0 | ||
} | ||
} | ||
}, | ||
"required": [ | ||
] | ||
}, | ||
{ | ||
"$ref": "./definitions.json#/definitions/base" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters