File tree Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -22,10 +22,10 @@ export default async function deploy(
2222 const configuration = options . configuration ? options . configuration : 'production'
2323 const overrides = {
2424 // this is an example how to override the workspace set of options
25- ...( options . baseHref && { baseHref : options . baseHref } )
25+ ...( options . baseHref && { baseHref : options . baseHref } )
2626 } ;
2727
28- context . logger . info ( `📦 Building "${ context . target . project } ". Configuration: "${ configuration } ".${ options . baseHref ? ' Your base-href: "' + options . baseHref + '"' : '' } ` ) ;
28+ context . logger . info ( `📦 Building "${ context . target . project } ". Configuration: "${ configuration } ".${ options . baseHref ? ' Your base-href: "' + options . baseHref + '"' : '' } ` ) ;
2929
3030 const build = await context . scheduleTarget ( {
3131 target : 'build' ,
Original file line number Diff line number Diff line change @@ -2,21 +2,26 @@ import { logging } from '@angular-devkit/core';
22import * as fse from 'fs-extra' ;
33
44import { Schema } from '../deploy/schema' ;
5+ const Heroku = require ( 'heroku-client' ) ;
56
67// TODO: add your deployment code here!
78export async function run ( dir : string , options : Schema , logger : logging . LoggerApi ) {
89
910 try {
1011
11- options . targetDir = options . targetDir || '/example-folder' ;
12+ const heroku = new Heroku ( { token : '' } ) ;
1213
13- if ( ! await fse . pathExists ( options . targetDir ) ) {
14- throw new Error ( `Target directory ${ options . targetDir } does not exist!` ) ;
15- }
14+ const result = await heroku . get ( '/apps' ) ;
15+ const site = result . find ( ( app => app . name === 'ngx-deploy-demo' ) )
1616
17- await fse . copy ( dir , options . targetDir )
18-
19- logger . info ( '🚀 Successfully published via @angular-schule/ngx-deploy-starter! Have a nice day!' ) ;
17+ const slugResult = await heroku . post ( `/apps/${ site . name } /slugs` , {
18+ body : {
19+ process_types : { "web" : "node-v0.10.20-linux-x64/bin/node index.js" }
20+ }
21+ }
22+ ) ;
23+ // console.log(site);
24+ console . log ( slugResult . blob . url ) ;
2025 }
2126 catch ( error ) {
2227 logger . error ( '❌ An error occurred!' ) ;
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ export const ngAdd = (options: NgAddOptions) => (
7575 }
7676
7777 project . architect [ 'deploy' ] = {
78- builder : '@angular-schule/ ngx-deploy-starter :deploy' ,
78+ builder : 'ngx-heroku-deploy :deploy' ,
7979 options : { }
8080 } ;
8181
You can’t perform that action at this time.
0 commit comments