Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .cbuildci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
version: 1

defaults:
timeoutInMinutes: 2
image: 'aws/codebuild/nodejs:8.11.0'

builds:
lint:
build:
timeoutInMinutes: 5
image: 'aws/codebuild/nodejs:8.11.0'
useCache: true
13 changes: 13 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
extends: [
'eslint:recommended'
],
env: {
node: true,
jest: true
},
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module'
}
};
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/.idea

# Don't check auto-generated stuff into git
/coverage
/build
/node_modules
/stats.json

# Cruft
.DS_Store
npm-debug.log
15 changes: 15 additions & 0 deletions app/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict';

// This is a boring function
exports.getFoobar = getFoobar;
function getFoobar() {
return 'foobar';
}

exports.getBar = getBar;
function getBar() {
return 'bar';
}

// eslint-disable-next-line no-console
console.log(getFoobar());
19 changes: 19 additions & 0 deletions app/index.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use strict';

const index = require('./index.js');

describe('index', () => {
describe('getFoobar', () => {
it('should return "foobar"', () => {
expect(index.getFoobar())
.toEqual('foobar');
})
});

describe('getBar', () => {
it('should return "bar"', () => {
expect(index.getBar())
.toEqual('bar');
})
});
});
19 changes: 13 additions & 6 deletions buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@ version: 0.2
phases:
install:
commands:
- echo install
pre_build:
commands:
- echo pre_build
- npm install --cache-min=9999
- mkdir artifacts
- mkdir build
build:
commands:
- echo build
- npm run -s build
- tar -zcf build/app.tar.gz app/*.js
post_build:
commands:
- echo post_build
- mv build artifacts
cache:
paths:
- '/root/.npm/**/*'
- 'node_modules/**/*'
artifacts:
files: '**/*'
base-directory: artifacts
Loading