Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ppl-fasilkom-ui
PPL KI Ganjil 2021 2022
Clicks - Ecosystem Business
clicks-frontend
Commits
68e6e379
Commit
68e6e379
authored
Oct 04, 2021
by
Ahmad Izzudin Alifyandra
Browse files
Setup SonarQube w/ Gitlab CI
parent
9d299fab
Changes
4
Show whitespace changes
Inline
Side-by-side
.gitignore
View file @
68e6e379
...
@@ -8,7 +8,8 @@ npm-debug.*
...
@@ -8,7 +8,8 @@ npm-debug.*
*.mobileprovision
*.mobileprovision
*.orig.*
*.orig.*
web-build/
web-build/
/ios
ios/
.scannerwork/
.env
.env
jest/coverage
jest/coverage
...
...
.gitlab-ci.yml
0 → 100644
View file @
68e6e379
# Asumsi:
# 1. Source code telah mengandung berkas konfigurasi sonar-project.properties
# di root folder source code.
# 2. CI job untuk pemanggilan analisis SonarScanner dipanggil sebagai salah
# satu job di stage test.
# Credits: Contoh konfigurasi GitLab CI/CD proyek Kape bagian dari proyek
# kuliah PMPL
# Build:
# image:
# name: node:14
# entrypoint: [""]
# stage: build
# script:
# - yarn
# artifacts:
# paths:
# - node_modules/
# expire_in: 1 day
SonarScanner
:
image
:
name
:
sonarsource/sonar-scanner-cli:4.6
entrypoint
:
[
"
"
]
stage
:
test
script
:
-
npm i -g yarn
-
yarn
-
yarn upgrade typescript@3.7
-
yarn test-ci
-
sonar-scanner
-Dsonar.host.url=https://pmpl.cs.ui.ac.id/sonarqube
-Dsonar.login=$SONARQUBE_TOKEN
-Dsonar.branch.name=$CI_COMMIT_REF_NAME
\ No newline at end of file
package.json
View file @
68e6e379
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
"web"
:
"expo start --web"
,
"web"
:
"expo start --web"
,
"eject"
:
"expo eject"
,
"eject"
:
"expo eject"
,
"test"
:
"jest --watchAll"
,
"test"
:
"jest --watchAll"
,
"test-ci"
:
"jest"
,
"lint"
:
"eslint --ext .tsx --ext .ts src/"
,
"lint"
:
"eslint --ext .tsx --ext .ts src/"
,
"format"
:
"prettier --check ./src"
,
"format"
:
"prettier --check ./src"
,
"prepare"
:
"husky install"
"prepare"
:
"husky install"
...
...
sonar-project.properties
0 → 100644
View file @
68e6e379
# SonarScanner properties file
## Server
sonar.host.url
=
https://pmpl.cs.ui.ac.id/sonarqube
sonar.login
=
${env.SONARQUBE_TOKEN}
## Project configuration
sonar.projectKey
=
${env.SONARQUBE_PROJECT_KEY}
## Path to sources
sonar.sources
=
src
sonar.exclusions
=
.github/**, .vscode/**, android/**, assets/**, build/**, ios/**, node_modules/**, scripts/**, **/*test.tsx
#sonar.inclusions=
## Path to tests
sonar.tests
=
src
# sonar.test.exclusions=
sonar.test.inclusions
=
**/*.test.tsx, **/*.test.ts
## Source encoding
sonar.sourceEncoding
=
UTF-8
## Branch analysis
sonar.branch.name
=
${env.CI_COMMIT_REF_NAME}
sonar.javascript.lcov.reportPaths
=
jest/coverage/lcov.info
# sonar.testExecutionReportPaths=jest/coverage/clover.xml
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment