Skip to content
This repository was archived by the owner on Dec 1, 2020. It is now read-only.

Commit a62b978

Browse files
author
George Adams
committed
initial commit
0 parents  commit a62b978

File tree

94 files changed

+9959
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+9959
-0
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
node_modules_linux/

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CI/

.eslintrc.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
env:
2+
node: true
3+
mocha: true
4+
5+
parserOptions:
6+
ecmaVersion: 2017
7+
8+
rules:
9+
quotes: [2, double]
10+
no-trailing-spaces: 2
11+
comma-spacing: [2, { before: false, after: true }]
12+
eqeqeq: [2, always]
13+
linebreak-style: [2, unix]
14+
semi: [2, always]
15+
max-len: [2, 80]
16+
no-multi-spaces: 2
17+
no-useless-escape: 2
18+
array-bracket-spacing: [2, never]
19+
brace-style: 2
20+
capitalized-comments: [2, always, { ignoreConsecutiveComments: true }]
21+
eol-last: [2, always]
22+
func-call-spacing: [2, never]
23+
semi-spacing: 2
24+
strict: 2
25+
no-var: 2
26+
no-console: "off"
27+
28+
extends: eslint:recommended

.github/pull_request_template.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Checklist
2+
3+
- [ ] Test cases pass
4+
- [ ] UI change has been manually checked
5+
- [ ] Relevant documentation has been updated
6+
- [ ] Change has been considered for a tweet/blog

.gitignore

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
.DS_Store
2+
err.txt
3+
4+
# Logs
5+
logs
6+
*.log
7+
npm-debug.log*
8+
nvm_logs.js
9+
yarn-debug.log*
10+
yarn-error.log*
11+
12+
# Runtime data
13+
pids
14+
*.pid
15+
*.seed
16+
*.pid.lock
17+
18+
# Directory for instrumented libs generated by jscoverage/JSCover
19+
lib-cov
20+
21+
# Coverage directory used by tools like istanbul
22+
coverage
23+
24+
# nyc test coverage
25+
.nyc_output
26+
27+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
28+
.grunt
29+
30+
# Bower dependency directory (https://bower.io/)
31+
bower_components
32+
33+
# node-waf configuration
34+
.lock-wscript
35+
36+
# Compiled binary addons (http://nodejs.org/api/addons.html)
37+
build/Release
38+
39+
# Dependency directories
40+
node_modules/
41+
jspm_packages/
42+
43+
# Typescript v1 declaration files
44+
typings/
45+
46+
# Optional npm cache directory
47+
.npm
48+
49+
# Optional eslint cache
50+
.eslintcache
51+
52+
# Optional REPL history
53+
.node_repl_history
54+
55+
# Output of 'npm pack'
56+
*.tgz
57+
58+
# Yarn Integrity file
59+
.yarn-integrity
60+
61+
# dotenv environment variables file
62+
.env

.travis.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
language: node_js
2+
node_js: "8"
3+
sudo: false
4+
install:
5+
- npm install
6+
script:
7+
- npm run lint
8+
- docker run -d postgres
9+
- npm test
10+
services:
11+
- docker
12+
deploy:
13+
- provider: bluemixcloudfoundry
14+
edge: true
15+
username: apikey
16+
password: $PLATFORM_API_KEY
17+
organization: Module-Curation
18+
space: MC-UK
19+
manifest: manifest-staging.yml
20+
region: eu-gb
21+
on:
22+
branch: master
23+
- provider: bluemixcloudfoundry
24+
edge: true
25+
username: apikey
26+
password: $PLATFORM_API_KEY
27+
organization: Module-Curation
28+
space: MC-UK
29+
manifest: manifest.yml
30+
region: eu-gb
31+
on:
32+
branch: release

AUTHORS.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Authors
2+
3+
- IBM Corp.
4+
- Bethany Griggs (https://github.com/BethGriggs)
5+
- George Adams (https://github.com/gdams)
6+
- Gibson Fahnestock (https://github.com/gibfahn)
7+
- Musa Hamwala (https://github.com/mhamwala)
8+
- Oleksandr Kushchak (https://github.com/al-k21)
9+
- Paul Ivinson (https://github.com/Paul-Ivinson)
10+
- Thomas Leah (https://github.com/Tomleah)

CONTRIBUTING.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Contributing to Module Insights
2+
We welcome contributions, but request that you follow these guidelines.
3+
4+
- [Raising bug reports and feature requests](#raising-bug-reports-and-feature-requests)
5+
- [Testing Changes](#testing-changes)
6+
- [Pull requests](#pull-requests)
7+
- [Coding standards](#coding-standards)
8+
- [IBM Contributor License Agreement](#ibm-contributor-license-agreement)
9+
10+
## Raising bug reports and feature requests
11+
12+
Please raise any bug reports and feature requests on the project's GitHub [issue tracker](https://github.com/CloudNativeJS/module-insights/issues).
13+
Be sure to search the list of open and closed issues to see if your problem or request has already been raised.
14+
15+
A good bug report is one that makes it easy for us to understand what you were trying to do and what went wrong. Provide as much context as possible so we can try to recreate the issue.
16+
17+
## Testing Changes
18+
1. Set the postgres database URL:
19+
20+
```bash
21+
export DB_URL=postgres://<url>
22+
```
23+
24+
2. Build the Docker run image for your application:
25+
```bash
26+
docker build -t module-insights:<version> -f Dockerfile-run .
27+
```
28+
29+
3. You have now built a Docker image for your application called module-insights. Use the following to run the application inside the Docker container:
30+
```bash
31+
docker run -i -p 3000:3000 -t module-insights:<version>
32+
```
33+
34+
## Pull requests
35+
To create a pull request do the following:
36+
1. Fork [Module Insights](https://github.com/CloudNativeJS/module-insights).
37+
2. Raise a pull request.
38+
3. Have a minimum of 1 other contributor review your changes.
39+
40+
In order for us to accept pull requests from a new contributor, the contributor must indicate that they accept and agree to be bound by the terms of the IBM Contributor License Agreement below. Please do this by adding your name to the [AUTHORS file](https://github.com/CloudNativeJS/module-insights/blob/master/AUTHORS.md)
41+
in your first pull request.
42+
43+
If you want to raise a pull-request for a bug fix or a new feature, we recommend that you raise a [GitHub issue](https://github.com/CloudNativeJS/module-insights/issues) to discuss it first.
44+
45+
### Coding standards
46+
47+
Please ensure you follow the coding standards used through-out the existing code base. All source code files should include the Apache v2.0 license header.
48+
49+
### IBM Contributor License Agreement
50+
Version 1.0.1 - January 25th, 2017
51+
52+
In order for You (as defined below) to make intellectual property Contributions (as defined below) now or in the future to IBM GitHub repositories, You must agree to this Contributor License Agreement ("CLA"). Please read this CLA carefully before accepting its terms. By accepting the CLA, You are agreeing to be bound by its terms. If You submit a Pull Request against an IBM repository on GitHub You must include in the Pull Request a statement of Your acceptance of this CLA.
53+
As used in this CLA: (i) "You" (or "Your") shall mean the entity that is making this Agreement with IBM; (ii)"Contribution" shall mean any original work of authorship, including any modifications or additions to an existing work, that is submitted by You to IBM for inclusion in, or documentation of, any of the IBM GitHub repositories; (iii) "Submit" (or "Submitted") means any form of communication sent to IBM (e.g. the content You post in a GitHub Issue or submit as part of a GitHub Pull Request).
54+
55+
This agreement applies to all Contributions You Submit.
56+
57+
- You will only Submit Contributions where You have authored 100% of the content.
58+
59+
- You will only Submit Contributions to which You have the necessary rights. This means that if You are employed You have received the necessary permissions from Your employer to make the Contributions.
60+
61+
- Whatever content You Contribute will be provided under the Apache v2.0 license. You can read a copy of the Apache v2.0 License at http://www.apache.org/licenses/LICENSE-2.0. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
62+
63+
- You understand and agree that the Project and Your contributions are public, and that a record of the contribution (including all personal information You submit with it, including Your sign-off) is maintained indefinitely and may be redistributed consistent with the license(s) involved.
64+
65+
- You understand that the decision to include Your Contribution is entirely that of the Project and this agreement does not guarantee that the Contribution will be included in the Project.
66+
67+
- You are not expected to provide support for Your Contribution. However you may provide support for free, for a fee or not at all. You provide Your Contribution on an "AS IS" BASIS as stated in the License.
68+
69+
You will promptly notify the Project if You become aware of any facts or circumstances that would make these commitments inaccurate in any way. To do so, please an issue on the project's GitHub [issue tracker](https://github.com/CloudNativeJS/module-insights/issues).
70+
If You think the Project could make use of content which You did not author, please talk to a committer on the Project. If they like Your idea, they will know the process to get it included.

Dockerfile-run

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Install the app dependencies in a full Node docker image
2+
FROM node:8
3+
4+
WORKDIR "/app"
5+
6+
# Install OS updates
7+
RUN apt-get update \
8+
&& apt-get dist-upgrade -y \
9+
&& apt-get clean \
10+
&& echo 'Finished installing dependencies'
11+
12+
# Copy package.json and package-lock.json
13+
COPY package*.json ./
14+
15+
# Install app dependencies
16+
RUN npm install --production
17+
18+
# Copy the dependencies into a Slim Node docker image
19+
FROM node:8-slim
20+
21+
WORKDIR "/app"
22+
23+
# Install OS updates
24+
RUN apt-get update \
25+
&& apt-get dist-upgrade -y \
26+
&& apt-get clean \
27+
&& echo 'Finished installing dependencies'
28+
29+
# Install app dependencies
30+
COPY --from=0 /app/node_modules /app/node_modules
31+
COPY . /app
32+
33+
ENV NODE_ENV production
34+
ENV PORT 3000
35+
ENV DB_URL $DB_URL
36+
USER node
37+
38+
EXPOSE 3000
39+
CMD ["npm", "start"]

0 commit comments

Comments
 (0)