Skip to content
This repository has been archived by the owner on Mar 22, 2024. It is now read-only.

Commit

Permalink
Merge pull request #107 from Financial-Times/run-local
Browse files Browse the repository at this point in the history
added local flag to run task
  • Loading branch information
wheresrhys committed May 20, 2015
2 parents b808f6f + 3332843 commit 9e5ac8b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@


Commands:

deploy [app] runs haikro deployment scripts with sensible defaults for Next projects
deploy [
app] runs haikro deployment scripts with sensible defaults for Next projects
configure [options] [source] [target] downloads environment variables from next-config-vars and uploads them to the current app
scale [source] [target] downloads process information from next-service-registry and scales/sizes the application servers
provision [app] provisions a new instance of an application server
Expand All @@ -16,14 +16,13 @@
destroy [app] deletes the app from heroku
purge [options] [url] purges the given url from the Fastly cache. Requires a FASTLY_KEY environment variable set to your fastly api key
deploy-vcl [options] [folder] Deploys VCL in [folder] to the specified fastly service. Requires FASTLY_KEY env var
run Runs the local app through the router
run [options] Runs the local app through the router
deploy-static [options] <source> [otherSources...] Deploys static <source> to [destination] on S3 (where [destination] is a full S3 URL). Requires AWS_ACCESS and AWS_SECRET env vars
*
*

Options:

-h, --help output usage information
-V, --version output the version number

## Development
Warning the README.md is automatically generated. Run `make docs` to update.
7 changes: 4 additions & 3 deletions bin/next-build-tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ program
program
.command('deploy-vcl [folder]')
.description('Deploys VCL in [folder] to the specified fastly service. Requires FASTLY_KEY env var')
.option('-m, --main <main', 'Set the name of the main vcl file (the entry point). Defaults to "main.vcl"')
.option('-m, --main <main>', 'Set the name of the main vcl file (the entry point). Defaults to "main.vcl"')
.option('-v, --vars <vars>', 'A way of injecting environment vars into the VCL. So if you pass --vars AUTH_KEY,SERVICE the values {$AUTH_KEY} and ${SERVICE} in the vcl will be replaced with the values of the environmemnt variable')
.option('-s, --service <service>', 'REQUIRED. The ID of the fastly service to deploy to.')
.action(function(folder, options) {
Expand All @@ -147,8 +147,9 @@ program
program
.command('run')
.description('Runs the local app through the router')
.action(function() {
run().catch(exit);
.option('-l, --local', 'Run the app but don\'t start the router ')
.action(function(opts){
run(opts).catch(exit);
});

program
Expand Down
5 changes: 4 additions & 1 deletion tasks/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,11 @@ function ensureRouterInstall() {
.catch(function(err) { throw new Error('You need to install the next router first! See docs here: http://git.svc.ft.com/projects/NEXT/repos/router/browse'); });
}

module.exports = function(opts) {
module.exports = function (opts) {
var localPort = process.env.PORT || 3002;
if (opts.local) {
return runLocal({ port: localPort });
}
return Promise.all([ ensureRouterInstall() ])
.then(function() {
return Promise.all([
Expand Down

0 comments on commit 9e5ac8b

Please sign in to comment.