Skip to content

Commit 699f974

Browse files
add drone ci configuration
1 parent 46c2e00 commit 699f974

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.codacy.rules.commituuid.providers
2+
3+
import com.codacy.model.configuration.CommitUUID
4+
import com.codacy.rules.commituuid.CommitUUIDProvider
5+
6+
/* Argo CD Provider */
7+
object DroneCIProvider extends CommitUUIDProvider {
8+
val name: String = "Drone CI"
9+
10+
override def validateEnvironment(environment: Map[String, String]): Boolean = {
11+
environment.get("CI").contains("true") && environment.get("DRONE").contains("true")
12+
}
13+
14+
override def getValidCommitUUID(environment: Map[String, String]): Either[String, CommitUUID] =
15+
parseEnvironmentVariable(environment.get("DRONE_COMMIT") orElse environment.get("DRONE_COMMIT_SHA"))
16+
}

0 commit comments

Comments
 (0)