Skip to content
Snippets Groups Projects
Verified Commit 28114658 authored by Jan-Niclas Strüwer's avatar Jan-Niclas Strüwer
Browse files

Updated OCCMD tool to support private repositories

parent b96b2c4b
No related branches found
No related tags found
No related merge requests found
Pipeline #23457 passed
......@@ -18,7 +18,13 @@ data class KPITreeResponseDto(
}
}
val amountOfMissingDataTree: Double = children.sumOf {
it.kpi.amountOfMissingDataChildren
val amountOfMissingDataTree: Double = getAmountOfMissingDataForTree()
private fun getAmountOfMissingDataForTree(): Double {
if (this.children.isEmpty()) {
return 0.0
}
return amountOfMissingDataChildren + children.sumOf { it.kpi.getAmountOfMissingDataForTree() }
}
}
......@@ -66,7 +66,9 @@ class OccmdService(
arrayOf(
outDir.toString(),
"$projectId",
gitlabApiProperties.accessToken
gitlabApiProperties.userName ?: "",
gitlabApiProperties.accessToken,
gitlabApiProperties.host
)
)
// delete cloned repo
......
......@@ -4,7 +4,7 @@ spring.config.import=optional:classpath:.env[.properties]
opencode.host=https://gitlab.dev.o4oe.de/
opencode.access-token=${OC_GL_APIKEY:}
opencode.analyze-private-repos=true
opencode.user-name=${OC_USER:}
opencode.user-name=${OC_GL_USER:}
# Tool APIs
opencode.api.base-path=https://sl.dev.o4oe.de/api/v1/project/
opencode.api.ort=/cve-result
......
......@@ -2,9 +2,11 @@
INSTALL_DIR=/occmd
PROJ_PATH=${1}
PROJ_ID=${2}
API_KEY=${3}
USER_NAME=${3}
API_KEY=${4}
URL=${5}
export OC_GL_APIKEY="${API_KEY}" && export OC_GL_USER="${USER_NAME}" && export OC_GL_URL="${URL}" && cd "${INSTALL_DIR}" && ./occmd check -d "${PROJ_PATH}" -i "${PROJ_ID}"
export OC_GL_APIKEY="${API_KEY}" && cd "${INSTALL_DIR}" && ./occmd check -d "${PROJ_PATH}" -i "${PROJ_ID}"
#(docker run --rm -e OC_GL_APIKEY="${API_KEY}" --mount "type=volume,src=res_occmd,dst=/opt/occmd/resources" --mount "type=bind,src=${PROJ_PATH},dst=/opt/target" occmd -i "${PROJ_ID}")
exit 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.