1
0
mirror of https://github.com/Bellerage-IT/bellerage-ssl.git synced 2024-11-24 08:42:32 +02:00

feat: setup CI

This commit is contained in:
Dmitry Abramov 2023-01-13 16:23:03 +03:00
parent 7b3498167f
commit 171b3d5a7b
3 changed files with 581 additions and 0 deletions

120
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,120 @@
stages:
- edt
- convert_edt_validate
- sonar
variables:
PATH_SRC: "src/cf/"
SONAR_SCANNER_OPTS: "-Xmx5g -Dfile.encoding=UTF-8 -Duser.language=ru"
RING_OPTS: "-Xmx8g -Dfile.encoding=UTF-8 -Duser.language=ru"
EDT_VERSION: "2022.1.3"
EDT_VALIDATION_RESULT: ".build/edt-validate-result.tsv"
EDT_VALIDATION_JSON: ".build/edt-validate-result.json"
GENERIC_ISSUE_SETTINGS_JSON: "generic-issue-settings.json"
edt:convertation-validation:
image:
name: "registry.bellerage.com/edt-editing-plugin:$EDT_VERSION"
artifacts:
name: "$CI_JOB_NAME"
expire_in: 3 days
paths:
- .build/conf-format/
- $EDT_VALIDATION_RESULT
script:
- ring edt@$EDT_VERSION workspace export --project $PWD/$PATH_SRC --workspace-location $PWD/.build/EDT_WS/ --configuration-files $PWD/.build/conf-format/
- rm -f $EDT_VALIDATION_RESULT
- ring edt workspace validate --file $PWD/$EDT_VALIDATION_RESULT --workspace-location $PWD/.build/EDT_WS/ --project-list $PWD/$PATH_SRC
stage: edt
tags:
- docker
only:
- master
- develop
- merge_requests
oscript:convert-edt-validate-result:
image:
name: "registry.bellerage.com/oscript-jdk"
variables:
SRC: "src/cf/src"
GENERIC_ISSUE_JSON: $EDT_VALIDATION_JSON
artifacts:
name: "$CI_JOB_NAME"
paths:
- $EDT_VALIDATION_JSON
dependencies:
- edt:convertation-validation
script:
- stebi c --UseRelativePaths --ObjectErrors
- stebi t
stage: convert_edt_validate
tags:
- docker
only:
- master
- develop
- merge_requests
sonar:check-branch:
image:
name: registry.bellerage.com/devops/sonar-scanner-cli
entrypoint: [""]
stage: sonar
variables:
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
GIT_DEPTH: 0 # Tells git to fetch all the branches of the project, required by the analysis task
GIT_STRATEGY: clone # clone entire repo instead of reusing workspace
cache:
key: "${CI_JOB_NAME}"
paths:
- .sonar/cache
allow_failure: true
dependencies:
- oscript:convert-edt-validate-result
script:
- export PROJECT_VERSION="$(grep -Po1 "<version>\K.*(?=<\/version>)" ${PATH_SRC}src/Configuration/Configuration.mdo)"
- echo $PROJECT_VERSION
- sonar-scanner
-D"sonar.host.url=$SONAR_SERVER"
-D"sonar.projectVersion=$PROJECT_VERSION"
-D"sonar.login=$SONAR_LOGIN"
-D"sonar.branch.name=$CI_COMMIT_BRANCH"
-D"sonar.externalIssuesReportPaths=$EDT_VALIDATION_JSON"
only:
- master
- develop
tags:
- docker
sonar:check-MR:
image:
name: registry.bellerage.com/devops/sonar-scanner-cli
entrypoint: [""]
stage: sonar
variables:
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
GIT_DEPTH: 0 # Tells git to fetch all the branches of the project, required by the analysis task
GIT_STRATEGY: clone # clone entire repo instead of reusing workspace
cache:
key: "${CI_JOB_NAME}"
paths:
- .sonar/cache
allow_failure: true
dependencies:
- oscript:convert-edt-validate-result
script:
- export PROJECT_VERSION="$(grep -Po1 "<version>\K.*(?=<\/version>)" ${PATH_SRC}src/Configuration/Configuration.mdo)"
- echo $PROJECT_VERSION
- sonar-scanner
-D"sonar.host.url=$SONAR_SERVER"
-D"sonar.projectVersion=$PROJECT_VERSION"
-D"sonar.login=$SONAR_LOGIN"
-D"sonar.pullrequest.key=$CI_MERGE_REQUEST_IID"
-D"sonar.pullrequest.branch=$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME"
-D"sonar.pullrequest.base=$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"
-D"sonar.externalIssuesReportPaths=$EDT_VALIDATION_JSON"
only:
- merge_requests
tags:
- docker

442
generic-issue-settings.json Normal file
View File

@ -0,0 +1,442 @@
[
{
"ruleId": "Deprecated method",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 2
},
{
"ruleId": "Deprecated property",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 2
},
{
"ruleId": "Function should return value",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "No intersection between expected types (%1) and expression types (%1)",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "Not allowed assign to form attribute value of type %1",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "Objects of this type cannot be created by NEW operator",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "Possible expression isn%1t collection",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "Possible wrong string literal content",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "Property (method) of object is not defined",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "Record manager should not be used for subordinate recorder",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "Return value type %1 that has different environment than calling context",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl. В секции параметров документирующего комментария пропущено определение параметра",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl. Документирующий комментарий содежрит секцию возвращаемого значения для процедуры",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl. Многострочное описание документирующего комментария содержит определение параметра",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl. Многострочное описание документирующего комментария содержит определение поля",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl. Поле документирующего комментария имеет описание типа",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl. Поле документирующего комментария использует объявление сложного типа вместо ссылки на тип",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl. Поле документирующего комментария не имеет определения типа",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl. Поле документирующего комментария является корректным именем",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl. Проверка ОбменДанными.Загрузка в обработчике события",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl. Секция возвращаемого значения документирующего комментария для экспортной функции",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl. Секция возвращаемого значения документирующего комментария содержит корректные типы",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl. Секция возвращаемого значения функции-конструктора данных",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl. Ссылка документирующего комментария на существующий объект",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl. Тип коллекций в документирующем комментарии содержит тип элемента коллекции",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl.Всегда использовать директивы компиляции в модуле формы",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl.Вызов Заблокировать() находится вне попытки",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl.Вызываемый тип пересекается с типом параметра",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl.Запрос в цикле",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl.Использован не рекомендованный метод РольДоступна",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl.Использование булевого параметра обработчика события",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl.Использование конструкции Новый Цвет",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl.Использование не рекомендуемых методов",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl.Конструкция Попытка...Исключение...КонецПопытки не содержит кода в исключении",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl.Метод в объекте не найден",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl.Метод содержит слишком много параметров",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl.Неиспользуемый метод",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl.НСтр формат строкового литерала",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl.Область пустая",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl.Ограничения на использование экспортных процедур и функций в модуле команд и форм",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl.Описание оповещения на серверную процедуру",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl.Определение типа документирующего комментария",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl.Параметр метода имеет тип",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl.Переменная имеет тип значения",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl.Переменная не используется или не проинициализирована",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl.Программный вызов обработчика события формы",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl.Пустой метод",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl.Свойство объекта имеет тип возвращаемого значения",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl.Типизация значений в конструкторе структуры",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "style.bsl.Утверждение меняет тип",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "This statement might never be executed because %1 statement was found earlier",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "Too many actual parameters for type(s)",
"message": "",
"filePath": "",
"severity": "CRITICAL",
"type": "BUG",
"effortMinutes": 5
},
{
"ruleId": "Transfering object of type %1 between client and server is not allowed",
"message": "",
"filePath": "",
"severity": "MINOR",
"type": "CODE_SMELL",
"effortMinutes": 5
},
{
"ruleId": "Unsupported operator",
"message": "",
"filePath": "",
"severity": "CRITICAL",
"type": "BUG",
"effortMinutes": 5
},
{
"ruleId": "Variable %1 is not defined",
"message": "",
"filePath": "",
"severity": "CRITICAL",
"type": "BUG",
"effortMinutes": 5
}
]

19
sonar-project.properties Normal file
View File

@ -0,0 +1,19 @@
sonar.projectKey=bellerageteam_1c_standart-library_AYWrSA6-yumz4BxXGN6T
sonar.qualitygate.wait=true
# относительный или абсолютный путь к каталогу с исходными кодом
sonar.sources=./src/cf
# кодировка
sonar.sourceEncoding=UTF-8
# маска поиска файлов на проверку
sonar.inclusions=**/*.bsl
# игнорирование gitignore
sonar.scm.exclusions.disabled=true
# для Git
sonar.projectBaseDir=./
sonar.scm.enabled=true
sonar.scm.provider=git