OpenComponents

Snippets

Mocking development server plugins

1
2
3
4
5
6
7
8
9
{
"mocks": {
"plugins": {
"dynamic": {
"getSettings": "../settings-oc-plugin/mock.js"
}
}
}
}

Deploy using gitlab-ci

With this gitlab-ci configuration you will test your React.js project each time you push new code.
Then the code will be analysed by SonarQube and finally if it’s a new release tag from git it
will be compiled and uploaded to OpenComponents registry.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
stages:
- test
- analysis
- deploy
test:
stage: test
image: node
script:
- yarn
- yarn test
sonarqube:
stage: analysis
image: ciricihq/gitlab-sonar-scanner
variables:
SONAR_URL: "http://sonar:9000"
SONAR_PROJECT_KEY: "project-key"
SONAR_PROJECT_NAME: "$CI_PROJECT_NAME"
SONAR_PROJECT_VERSION: "$CI_BUILD_ID"
SONAR_ANALYSIS_MODE: "issues"
script:
- /usr/bin/sonar-scanner-run.sh
deploy:
stage: deploy
image: ciricihq/node:lts-oc
only:
- tags
- triggers
script:
- yarn
- yarn build
- oc registry add https://components.registry.com
- NODE_ENV=production oc publish --username=nobody --password=1234 .

Interesting plugins

⬆︎TOP