Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(docker and babel): no compile at runtime #54

Merged
merged 8 commits into from
Sep 10, 2019
Merged
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
.vscode
node_modules/
dist/
*.swp
*.log
*.old
*.bak

10 changes: 8 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,23 @@ RUN apt-get update \
&& apt-get install -y --no-install-recommends nodejs \
&& rm -rf /var/lib/apt/lists/*

COPY . /guppy
COPY . /guppy/
WORKDIR /guppy

RUN COMMIT=`git rev-parse HEAD` && echo "export const guppyCommit = \"${COMMIT}\";" >versions.js
RUN VERSION=`git describe --always --tags` && echo "export const guppyVersion =\"${VERSION}\";" >>versions.js
RUN /bin/rm -rf .git
RUN /bin/rm -rf node_modules

RUN useradd -d /guppy gen3 && chown -R gen3: /guppy
# see https://superuser.com/questions/710253/allow-non-root-process-to-bind-to-port-80-and-443
RUN setcap CAP_NET_BIND_SERVICE=+eip /usr/bin/node
USER gen3
RUN npm ci --unsafe-perm
RUN npm run-script prepare

EXPOSE 3000
EXPOSE 80

CMD npm start
CMD node dist/server/server.js

6 changes: 6 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!groovy

@Library('cdis-jenkins-lib@master') _

testPipeline {
}
19,168 changes: 13,750 additions & 5,418 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"graphql-tools": "^4.0.4",
"graphql-type-json": "^0.2.1",
"isomorphic-fetch": "^2.2.1",
"lodash": "^4.17.11",
"lodash": "^4.17.15",
"loglevel": "^1.6.1",
"node-fetch": "^2.3.0",
"prop-types": "^15.7.2",
Expand All @@ -53,12 +53,13 @@
"@babel/plugin-transform-runtime": "^7.4.3",
"@babel/preset-env": "^7.3.4",
"@babel/preset-react": "^7.0.0",
"@storybook/addon-actions": "^5.0.1",
"@storybook/addon-links": "^5.0.1",
"@storybook/addons": "^5.0.1",
"@storybook/react": "^5.0.1",
"@storybook/addon-actions": "^5.1.1",
"@storybook/addon-links": "^5.1.1",
"@storybook/addons": "^5.1.1",
"@storybook/react": "^5.1.1",
"babel-jest": "^24.7.1",
"babel-loader": "^8.0.5",
"babel-preset-env": "^1.7.0",
"eslint": "^5.16.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-import": "^2.17.1",
Expand All @@ -67,6 +68,7 @@
"jest": "^24.7.1",
"nock": "^10.0.6",
"nodemon": "^1.18.10",
"react-scripts": "^3.1.1",
"react-table": "^6.9.2"
}
}
File renamed without changes.
11 changes: 11 additions & 0 deletions src/server/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"presets": [
["env", {
"targets": {
"node": "current"
}
}]
],
"sourceMaps": "inline",
"retainLines": true
}
2 changes: 1 addition & 1 deletion src/server/auth/authHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class AuthHelper {
log.debug('[AuthHelper] accessible resources: ', this._accessibleResourceList);
log.debug('[AuthHelper] unaccessible resources: ', this._unaccessibleResourceList);
} catch (err) {
log.error('[AuthHelper] error when initializing');
log.error('[AuthHelper] error when initializing', err);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/server/es/aggs.js
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ export const textAggregation = async (
resultSize = 0;

result.aggregations[aggsName].buckets.forEach((item) => {
const resultObj = processResultsForNestedAgg (nestedAggFields, item, resultObj)
const resultObj = processResultsForNestedAgg (nestedAggFields, item, {})
finalResults.push({
key: item.key[field],
count: item.doc_count,
Expand Down
2 changes: 1 addition & 1 deletion stories/conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const tableConfig = [
];

export const guppyConfig = {
path: 'http://localhost:3000',
path: 'http://localhost:80',
type: 'subject',
fileType: 'file',
};
Expand Down