File tree Expand file tree Collapse file tree 5 files changed +44
-1
lines changed
Expand file tree Collapse file tree 5 files changed +44
-1
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ class Build(
3838 if (forPullRequests) dependentBuildType(PRCheck (" ${name} -pr-check" , " pr check" ))
3939
4040 parallel {
41+ dependentBuildType(SemgrepCheck (" ${name} -semgrep-check" , " semgrep check" ))
42+
4143 JavaPlatform .entries.forEach { java ->
4244 val packaging =
4345 Maven (
Original file line number Diff line number Diff line change @@ -33,6 +33,11 @@ val MAVEN_DEFAULT_ARGS = buildString {
3333}
3434const val DEFAULT_BRANCH = " main"
3535
36+ const val FULL_GITHUB_REPOSITORY = " $GITHUB_OWNER /$GITHUB_REPOSITORY "
37+ const val GITHUB_URL = " https://github.com/$FULL_GITHUB_REPOSITORY "
38+
39+ const val SEMGREP_DOCKER_IMAGE = " semgrep/semgrep:1.146.0"
40+
3641val DEFAULT_JAVA_VERSION = JavaVersion .V_11
3742const val DEFAULT_CONFLUENT_PLATFORM_VERSION = " 7.2.9"
3843
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ package builds
33import jetbrains.buildServer.configs.kotlin.BuildType
44import jetbrains.buildServer.configs.kotlin.toId
55
6- class Maven (
6+ open class Maven (
77 id : String ,
88 name : String ,
99 goals : String ,
Original file line number Diff line number Diff line change 1+ package builds
2+
3+ import jetbrains.buildServer.configs.kotlin.buildSteps.ScriptBuildStep
4+
5+ class SemgrepCheck (
6+ id : String ,
7+ name : String
8+ ): Maven(
9+ id,
10+ name,
11+ " dependency:tree" ,
12+ JavaVersion .V_17 ,
13+ Neo4jVersion .V_NONE ,
14+ " -DoutputFile=maven_dep_tree.txt"
15+ ) {
16+
17+ init {
18+
19+ params.password(" env.SEMGREP_APP_TOKEN" , " %semgrep-app-token%" )
20+ params.text(" env.SEMGREP_REPO_NAME" , FULL_GITHUB_REPOSITORY )
21+ params.text(" env.SEMGREP_REPO_URL" , GITHUB_URL )
22+ params.text(" env.SEMGREP_BRANCH" , " %teamcity.build.branch%" )
23+ params.text(" env.SEMGREP_JOB_URL" , " %env.BUILD_URL%" )
24+ params.text(" env.SEMGREP_COMMIT" , " %env.BUILD_VCS_NUMBER%" )
25+
26+ steps.step(ScriptBuildStep {
27+ scriptContent= " semgrep ci --no-git-ignore"
28+ dockerImagePlatform = ScriptBuildStep .ImagePlatform .Linux
29+ dockerImage = SEMGREP_DOCKER_IMAGE
30+ dockerRunParameters =
31+ " --volume /var/run/docker.sock:/var/run/docker.sock --volume %teamcity.build.checkoutDir%/signingkeysandbox:/root/.gnupg"
32+ })
33+ }
34+
35+ }
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ project {
1414 params {
1515 password(" github-commit-status-token" , " %github-token%" )
1616 password(" github-pull-request-token" , " %github-token%" )
17+ password(" semgrep-app-token" , " %semgrep-token%" )
1718 }
1819
1920 vcsRoot(Neo4jKafkaConnectorVcs )
You can’t perform that action at this time.
0 commit comments