Skip to content

Commit d29c857

Browse files
authored
Merge pull request #26 from EBISPOT/develop
Develop
2 parents f44a34b + abf6529 commit d29c857

File tree

115 files changed

+13600
-3340
lines changed

Some content is hidden

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

115 files changed

+13600
-3340
lines changed
File renamed without changes.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ npm-debug.log
4040
yarn-error.log
4141
testem.log
4242
/typings
43+
/tailwind.config.js
4344

4445
# System Files
4546
.DS_Store

.gitlab-ci.yml

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
image: docker:latest
2+
services:
3+
- docker:dind
4+
5+
stages:
6+
- sandbox-build
7+
- prod-build
8+
- docker-build
9+
- docker-build-release
10+
- deploy-sandbox
11+
- deploy-production
12+
- deploy-fallback
13+
14+
variables:
15+
DOCKER_DRIVER: overlay2
16+
DOCKER_TLS_CERTDIR: ""
17+
CI_REGISTRY_IMAGE: ebispot/gwas-curation-ui
18+
CURATION_UI_SERVICE_NAME: gwas-curation-ui
19+
20+
sandbox-build:
21+
image: node:14.15.5
22+
stage: sandbox-build
23+
script:
24+
- npm -v
25+
- node -v
26+
- rm -rf node_modules
27+
- npm install
28+
- CI=false npm run build -- --base-href=/gwas/curation/ --configuration sandbox
29+
artifacts:
30+
paths:
31+
- dist/gwas-curation-ui/*
32+
only:
33+
- develop
34+
35+
prod-build:
36+
image: node:14.15.5
37+
stage: prod-build
38+
script:
39+
- npm -v
40+
- node -v
41+
- rm -rf node_modules
42+
- npm install
43+
- CI=false npm run build -- --base-href=/gwas/curation/
44+
artifacts:
45+
paths:
46+
- dist/gwas-curation-ui/*
47+
except:
48+
- tags
49+
- develop
50+
51+
docker-build:
52+
stage: docker-build
53+
script:
54+
- echo "$DOCKER_HUB_PASSWORD" > dhpw.txt
55+
- docker login -u "${DOCKER_HUB_USER}" --password-stdin < dhpw.txt
56+
- docker build --force-rm=true -t $CURATION_UI_SERVICE_NAME:latest .
57+
- docker tag $CURATION_UI_SERVICE_NAME:latest $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
58+
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
59+
except:
60+
- tags
61+
62+
docker-build-release:
63+
variables:
64+
GIT_STRATEGY: none
65+
stage: docker-build-release
66+
script:
67+
- echo "$DOCKER_HUB_PASSWORD" > dhpw.txt
68+
- docker login -u "${DOCKER_HUB_USER}" --password-stdin < dhpw.txt
69+
- docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
70+
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:latest
71+
- docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
72+
- docker push $CI_REGISTRY_IMAGE:latest
73+
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
74+
only:
75+
- tags
76+
77+
deploy-sandbox:
78+
image: dtzar/helm-kubectl:2.13.1
79+
stage: deploy-sandbox
80+
script:
81+
- echo "Deploy to sandbox server"
82+
- mkdir -p /root/.kube
83+
- echo ${SANBOX_KUBECONF} | base64 -d > /root/.kube/config
84+
- helm init --stable-repo-url https://charts.helm.sh/stable
85+
- helm delete --purge gwas-curation-ui || true
86+
- helm install --name gwas-curation-ui --set k8Namespace=gwas,image.repository=$CI_REGISTRY_IMAGE,image.tag=$CI_COMMIT_SHA ./k8chart/ --wait
87+
environment:
88+
name: sandbox
89+
only:
90+
- develop
91+
92+
deploy-fallback:
93+
image: dtzar/helm-kubectl:2.13.1
94+
stage: deploy-fallback
95+
script:
96+
- echo "Deploy to Production fallback server"
97+
- mkdir -p /root/.kube
98+
- echo ${PFALLBACK_KUBECONFIG} | base64 -d > /root/.kube/config
99+
- helm init --stable-repo-url https://charts.helm.sh/stable
100+
- helm delete --purge gwas-curation-ui || true
101+
- helm install --name gwas-curation-ui --set k8Namespace=gwas,replicaCount=3,image.repository=$CI_REGISTRY_IMAGE,image.tag=$CI_COMMIT_TAG ./k8chart/ --wait
102+
environment:
103+
name: production
104+
only:
105+
- tags
106+
107+
deploy-production:
108+
image: dtzar/helm-kubectl:2.13.1
109+
stage: deploy-production
110+
script:
111+
- echo "Deploy to Production server"
112+
- mkdir -p /root/.kube
113+
- echo ${PLIVE_KUBECONFIG} | base64 -d > /root/.kube/config
114+
- helm init --stable-repo-url https://charts.helm.sh/stable
115+
- helm delete --purge gwas-curation-ui || true
116+
- helm install --name gwas-curation-ui --set k8Namespace=gwas,replicaCount=3,image.repository=$CI_REGISTRY_IMAGE,image.tag=$CI_COMMIT_TAG ./k8chart/ --wait
117+
environment:
118+
name: production
119+
only:
120+
- tags
121+

Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM nginx:latest
2+
3+
RUN mkdir /usr/share/nginx/html/gwas
4+
RUN mkdir /usr/share/nginx/html/gwas/curation
5+
6+
ADD dist/gwas-curation-ui /usr/share/nginx/html/gwas/curation
7+
8+
RUN rm /etc/nginx/conf.d/default.conf
9+
COPY nginx/nginx.conf /etc/nginx/conf.d
10+
11+
EXPOSE 80
12+
ENTRYPOINT ["nginx","-g","daemon off;"]

README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,18 @@ This project was generated with [Angular CLI](https://github.com/angular/angular
44

55
## Development server
66

7-
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
7+
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change
8+
any of the source files.
89

910
## Code scaffolding
1011

11-
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
12+
Run `ng generate component component-name` to generate a new component. You can also
13+
use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
1214

1315
## Build
1416

15-
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
17+
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag
18+
for a production build.
1619

1720
## Running unit tests
1821

@@ -24,4 +27,15 @@ Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protrac
2427

2528
## Further help
2629

27-
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
30+
To get more help on the Angular CLI use `ng help` or go check out
31+
the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
32+
33+
# Notes
34+
To run the app locally with the fake API, run `npm run start-fake`.
35+
36+
To run the app locally with the Sandbox API, run `ng serve -c local-sandbox`.
37+
38+
You may want to disable tailwind CSS purge as it sometimes messes up intelliSense, do so by setting `purge.enabled` to false in `tailwind.config.js`.
39+
40+
json-server uses the field `id` as a default, so it won't consider `submissionId` for example querying `/submissions/:submissionId`, instead it will look for a field called `id`.
41+
A workaround is to add a field `id` to each submission.

angular.json

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@
1818
"main": "src/main.ts",
1919
"polyfills": "src/polyfills.ts",
2020
"tsConfig": "tsconfig.app.json",
21-
"aot": false,
21+
"aot": true,
2222
"assets": [
2323
"src/favicon.ico",
2424
"src/assets"
2525
],
2626
"styles": [
27+
"src/custom-theme.scss",
2728
"src/styles.css"
2829
],
2930
"scripts": []
@@ -39,9 +40,7 @@
3940
"optimization": true,
4041
"outputHashing": "all",
4142
"sourceMap": false,
42-
"extractCss": true,
4343
"namedChunks": false,
44-
"aot": true,
4544
"extractLicenses": true,
4645
"vendorChunk": false,
4746
"buildOptimizer": true,
@@ -57,6 +56,41 @@
5756
"maximumError": "10kb"
5857
}
5958
]
59+
},
60+
"sandbox": {
61+
"fileReplacements": [
62+
{
63+
"replace": "src/environments/environment.ts",
64+
"with": "src/environments/environment.sandbox.ts"
65+
}
66+
],
67+
"optimization": true,
68+
"outputHashing": "all",
69+
"sourceMap": false,
70+
"namedChunks": false,
71+
"extractLicenses": true,
72+
"vendorChunk": false,
73+
"buildOptimizer": true,
74+
"budgets": [
75+
{
76+
"type": "initial",
77+
"maximumWarning": "2mb",
78+
"maximumError": "5mb"
79+
},
80+
{
81+
"type": "anyComponentStyle",
82+
"maximumWarning": "6kb",
83+
"maximumError": "10kb"
84+
}
85+
]
86+
},
87+
"local-sandbox": {
88+
"fileReplacements": [
89+
{
90+
"replace": "src/environments/environment.ts",
91+
"with": "src/environments/environment.sandbox.ts"
92+
}
93+
]
6094
}
6195
}
6296
},
@@ -68,6 +102,9 @@
68102
"configurations": {
69103
"production": {
70104
"browserTarget": "gwas-curation-ui:build:production"
105+
},
106+
"local-sandbox": {
107+
"browserTarget": "gwas-curation-ui:build:local-sandbox"
71108
}
72109
}
73110
},
@@ -120,6 +157,7 @@
120157
}
121158
}
122159
}
123-
}},
160+
}
161+
},
124162
"defaultProject": "gwas-curation-ui"
125-
}
163+
}

e2e/protractor.conf.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Protractor configuration file, see link for more information
33
// https://github.com/angular/protractor/blob/master/lib/config.ts
44

5-
const { SpecReporter } = require('jasmine-spec-reporter');
5+
const {SpecReporter} = require('jasmine-spec-reporter');
66

77
/**
88
* @type { import("protractor").Config }
@@ -21,12 +21,13 @@ exports.config = {
2121
jasmineNodeOpts: {
2222
showColors: true,
2323
defaultTimeoutInterval: 30000,
24-
print: function() {}
24+
print: function () {
25+
}
2526
},
2627
onPrepare() {
2728
require('ts-node').register({
2829
project: require('path').join(__dirname, './tsconfig.json')
2930
});
30-
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
31+
jasmine.getEnv().addReporter(new SpecReporter({spec: {displayStacktrace: true}}));
3132
}
32-
};
33+
};

e2e/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"compilerOptions": {
44
"outDir": "../out-tsc/e2e",
55
"module": "commonjs",
6-
"target": "es5",
6+
"target": "es2018",
77
"types": [
88
"jasmine",
99
"jasminewd2",

0 commit comments

Comments
 (0)