-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
untested: refactored existing code and moved it to engine.ts
- Loading branch information
1 parent
df7d476
commit ebe0daa
Showing
9 changed files
with
95 additions
and
278 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,30 @@ | ||
import { BuilderContext } from '@angular-devkit/architect'; | ||
import { GHPages } from '../interfaces'; | ||
import { Schema as RealDeployOptions } from './schema'; | ||
import { json } from '@angular-devkit/core'; | ||
import { json, logging } from '@angular-devkit/core'; | ||
import { run } from '../engine/engine'; | ||
|
||
type DeployOptions = RealDeployOptions & json.JsonObject; | ||
|
||
export default async function deploy( | ||
ghPages: GHPages, | ||
context: BuilderContext, | ||
projectRoot: string, | ||
options: DeployOptions | ||
) { | ||
|
||
if (!context.target) { | ||
throw new Error('Cannot execute the build target'); | ||
} | ||
|
||
context.logger.info(`📦 Building "${context.target.project}"`); | ||
|
||
// TODO: check if it's possible to override production via --configuration=xxx | ||
const run = await context.scheduleTarget( | ||
{ | ||
const build = await context.scheduleTarget({ | ||
target: 'build', | ||
project: context.target.project, | ||
configuration: 'production' | ||
}, | ||
options | ||
); | ||
await run.result; | ||
|
||
try { | ||
await ghPages.publish(projectRoot, {}); | ||
await build.result; | ||
|
||
context.logger.info(`🚀 Your application is now deployed. Have a nice day!`); | ||
|
||
} catch (e) { | ||
context.logger.error(e); | ||
} | ||
await run(projectRoot, options, context.logger as unknown as logging.LoggerApi); | ||
} |
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
File renamed without changes.
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
Oops, something went wrong.