-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #442 from codacy/add_argo_cd_provider
Add Argo CD provider integration TS-140
- Loading branch information
Showing
2 changed files
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/main/scala/com/codacy/rules/commituuid/providers/ArgoCDProvider.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.codacy.rules.commituuid.providers | ||
|
||
import com.codacy.model.configuration.CommitUUID | ||
import com.codacy.rules.commituuid.CommitUUIDProvider | ||
|
||
/* Argo CD Provider */ | ||
object ArgoCDProvider extends CommitUUIDProvider { | ||
val name: String = "Argo CD" | ||
|
||
override def validateEnvironment(environment: Map[String, String]): Boolean = { | ||
environment.contains("ARGOCD_APP_SOURCE_REPO_URL") | ||
} | ||
|
||
override def getValidCommitUUID(environment: Map[String, String]): Either[String, CommitUUID] = | ||
parseEnvironmentVariable(environment.get("ARGOCD_APP_REVISION")) | ||
} |