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 #110 from Financial-Times/about-task
Browse files Browse the repository at this point in the history
made about.json generation into a task
  • Loading branch information
wheresrhys committed May 22, 2015
2 parents 2e2663f + d80a690 commit 0d109b2
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sudo: false
language: node_js
script: make test
script: make verify test
node_js:
- '0.12.2'
before_deploy:
Expand Down
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# next-build-tools [![Build Status](https://travis-ci.org/Financial-Times/next-build-tools.svg?branch=v2.4.2)](https://travis-ci.org/Financial-Times/next-build-tools)
# next-build-tools

```
Usage: next-build-tools [options] [command]


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 @@ -18,15 +17,14 @@
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 [options] Runs the local app through the router
about Creates an __about.json file for the app
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.
8 changes: 8 additions & 0 deletions bin/next-build-tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ var nightwatch = require('../tasks/nightwatch');
var deployHashedAssets = require('../tasks/deploy-hashed-assets');
var deployStatic = require('../tasks/deploy-static');
var run = require('../tasks/run');
var about = require('../tasks/about');

function list(val) {
return val.split(',');
Expand Down Expand Up @@ -152,6 +153,13 @@ program
run(opts).catch(exit);
});

program
.command('about')
.description('Creates an __about.json file for the app')
.action(function(){
about().catch(exit);
});

program
.command('deploy-static <source> [otherSources...]')
.description('Deploys static <source> to [destination] on S3 (where [destination] is a full S3 URL). Requires AWS_ACCESS and AWS_SECRET env vars')
Expand Down
10 changes: 10 additions & 0 deletions tasks/about.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
'use strict';

var about = require('../lib/about');
var packageJson = require(process.cwd() + '/package.json');
var normalizeName = require('../lib/normalize-name');
module.exports = function() {
return about({
name: 'ft-next-' + normalizeName(packageJson.name)
});
};
11 changes: 4 additions & 7 deletions test/deploy-vcl.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* global describe, it, before, after */
'use strict';
var sinon = require('sinon');
var expect = require('chai').expect;
Expand All @@ -8,10 +9,6 @@ var fastlyMock = require('./mocks/fastly.mock');
mockery.registerMock('fastly', fastlyMock);
var path = require('path');





describe.only('Deploy VCL', function(){

var deployVcl;
Expand All @@ -29,7 +26,7 @@ describe.only('Deploy VCL', function(){
deployVcl(path.resolve(__dirname, './fixtures/vcl')+'/', {service:fastlyMock.fakeServiceId}).then(function(){
sinon.assert.called(fastlyMock().updateVcl);
done();
})
});
});

it('Should replace placeholders with environment vars', function(done){
Expand All @@ -44,7 +41,7 @@ describe.only('Deploy VCL', function(){
expect(vcl).to.contain(value);
expect(vcl).not.to.contain('${AUTH_KEY}');
done();
})
})
});
});

});
1 change: 1 addition & 0 deletions test/purge.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* global describe, it */
'use strict';
var expect = require('chai').expect;

Expand Down

0 comments on commit 0d109b2

Please sign in to comment.