-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from humanmade/prepare-beta-v1
Prepare beta v1
- Loading branch information
Showing
9 changed files
with
5,252 additions
and
111 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
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,50 @@ | ||
const bytes = require( 'bytes' ); | ||
const chalk = require( 'chalk' ); | ||
const fs = require( 'fs' ); | ||
const ora = require( 'ora' ); | ||
const process = require( 'process' ); | ||
const cmd = require( 'node-cmd' ); | ||
|
||
const Vantage = require( '../../vantage' ); | ||
const { getStack, streamLog } = require( './util' ); | ||
|
||
const handler = argv => { | ||
getStack( argv ).then( stack => { | ||
const v = new Vantage(argv.config); | ||
|
||
const status = new ora(`Loading repository for ${ stack }…`); | ||
status.start(); | ||
|
||
v.fetch(`stack/applications/${ stack }`) | ||
.then( resp => resp.json() ) | ||
.then( repo => { | ||
status.succeed(); | ||
|
||
const url = repo['git-deployment']['url']; | ||
const branch = repo['git-deployment']['ref']; | ||
const dir = `./${stack}`; | ||
|
||
if ( !fs.existsSync( dir ) ){ | ||
console.log( chalk.yellow( `Creating directory: ${ chalk.underline( dir ) }` ) ); | ||
fs.mkdirSync(dir); | ||
} | ||
|
||
process.chdir(dir); | ||
|
||
console.log( chalk.yellow( `Cloning: ${ chalk.underline( url ) }` ) ); | ||
cmd.runSync(`git clone --branch ${branch} ${url} ./`); | ||
|
||
console.log( chalk.yellow( `Installing dependencies…` ) ); | ||
cmd.runSync('composer install'); | ||
|
||
console.log( chalk.yellow( `${ chalk.underline( stack ) } is now available at ${ chalk.underline( dir ) }` ) ); | ||
console.log( chalk.yellow( `Run \`composer server start\` to get started` ) ); | ||
} ); | ||
}) | ||
}; | ||
|
||
module.exports = { | ||
command: 'local-setup [stack]', | ||
description: 'Setup an existing Altis stack locally.', | ||
handler, | ||
}; |
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 was deleted.
Oops, something went wrong.
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.