diff --git a/entities/alice/alice/shouldi/contribute/cicd.py b/entities/alice/alice/shouldi/contribute/cicd.py new file mode 100644 index 0000000000..3237a1990f --- /dev/null +++ b/entities/alice/alice/shouldi/contribute/cicd.py @@ -0,0 +1,43 @@ +from typing import NewType + +import dffml +import dffml_operations_innersource.operations + + +IsCICDJenkinsLibrary = NewType("IsCICDJenkinsLibrary", bool) +IsCICDGitHubActionsLibrary = NewType("IsCICDGitHubActionsLibrary", bool) +CICDLibrary = NewType("CICDLibrary", dict) + + +@dffml.op( + stage=dffml.Stage.OUTPUT, +) +def cicd_library( + self, + cicd_jenkins_library: IsCICDJenkinsLibrary, + cicd_action_library: IsCICDGitHubActionsLibrary, +) -> CICDLibrary: + return { + "cicd-jenkins-library": cicd_jenkins_library, + "cicd-action-library": cicd_action_library, + } + + +@dffml.op( + stage=dffml.Stage.OUTPUT, +) +def cicd_jenkins_library( + self, + groovy_file_paths: dffml_operations_innersource.operations.GroovyFileWorkflowUnixStylePath, +) -> IsCICDJenkinsLibrary: + return bool(groovy_file_paths) + + +@dffml.op( + stage=dffml.Stage.OUTPUT, +) +def cicd_action_library( + self, + action_file_paths: dffml_operations_innersource.operations.ActionYAMLFileWorkflowUnixStylePath, +) -> IsCICDGitHubActionsLibrary: + return bool(action_file_paths) diff --git a/entities/alice/entry_points.txt b/entities/alice/entry_points.txt index 3cd5981b9e..1419792457 100644 --- a/entities/alice/entry_points.txt +++ b/entities/alice/entry_points.txt @@ -23,3 +23,6 @@ OverlayGitHub = alice.please.contribute.recomme [dffml.overlays.alice.please.contribute.recommended_community_standards.code_of_conduct] OverlayGit = alice.please.contribute.recommended_community_standards.recommended_community_standards:OverlayGit OverlayGitHub = alice.please.contribute.recommended_community_standards.recommended_community_standards:OverlayGitHub + +[dffml.overlays.alice.shouldi.contribute] +OverlayCICDLibrary = alice.shouldi.contribute.cicd