DocsResource KindsGitlabProject

GitlabProject

Creates or mutates a GitLab project.

Schema

GitlabProjectResource

propertytypedescription
versionstring, requiredVersion of Frigg to use. Should be 1.
kindGitlabProject, requiredKind of resource you want to specify
metadataobject, requiredData used by Frigg internally
metadata.namestring, requiredName used to reference this resource from other resources
metadata.configDefaultsstring, requiredName of the GitlabDefaults resource to use to resolve default configuration.
metadata.idnumber, optionalNumeric ID of the Gitlab project. Specify this when you want to start managing an already existing project using Frigg.
specobject, requiredState you want the resource to have
spec.namestring, requiredName of the project in GitLab
spec.groupstring, requiredName of the parent group
spec.configGitlabProjectConfig, optionalLeave undefined if you want to fully use configDefaults.projectConfig instead.
spec.approvalsConfigGitlabApprovalsConfig, optionalLeave undefined if you want to fully use configDefaults.approvalsConfig instead.
spec.approvalRulesGitlabApprovalRule array, optionalLeave undefined if you want to fully use configDefaults.approvalRules instead.
spec.protectedBranchesGitlabProtectedBranch array, optionalLeave undefined if you want to fully use configDefaults.protectedBranches instead.
spec.membersGitlabMember array, optionalArray containing the group’s members.

GitlabProjectConfig

All properties are optional. Any undefined properties will default to the specified configDefaults.projectConfig of the referenced GitlabDefaults.

For detailed info about the properties, please reference GitLab’s documentation.

propertytype
allowMergeOnSkippedPipelineboolean, optional
allowPipelineTriggerApproveDeploymentboolean, optional
analyticsAccessLeveldisabled | private | enabled, optional
autoCancelPendingPipelinesenabled | disabled, optional
autoDevopsDeployStrategycontinuous | manual | timed_incremental, optional
autoDevopsEnabledboolean, optional
autocloseReferencedIssuesboolean, optional
buildGitStrategystring, optional
buildTimeoutnumber, optional
buildsAccessLeveldisabled | private | enabled, optional
ciAllowForkPipelinesToRunInParentProjectboolean, optional
ciConfigPathstring, optional
ciDefaultGitDepthnumber, optional
ciForwardDeploymentEnabledboolean, optional
ciSeparatedCachesboolean, optional
containerExpirationPolicyAttributesobject, optional
containerExpirationPolicyAttributes.cadencestring, optional
containerExpirationPolicyAttributes.enabledboolean, optional
containerExpirationPolicyAttributes.keepNnumber, optional
containerExpirationPolicyAttributes.nameRegexstring, optional
containerExpirationPolicyAttributes.nameRegexKeepstring, optional
containerExpirationPolicyAttributes.nameRegexKeepolderThan, optional
containerRegistryAccessLeveldisabled | private | enabled, optional
defaultBranchstring, optional
descriptionstring, optional
emailsDisabledboolean, optional
enforceAuthChecksOnUploadsboolean, optional
externalAuthorizationClassificationLabelstring, optional
featureFlagsAccessLeveldisabled | private | enabled, optional
forkingAccessLeveldisabled | private | enabled, optional
groupRunnersEnabledboolean, optional
infrastructureAccessLeveldisabled | private | enabled, optional
issueBranchTemplatestring, optional
issuesAccessLeveldisabled | private | enabled, optional
issuesTemplatestring, optional
keepLatestArtifactboolean, optional
lfsEnabledboolean, optional
mergeCommitTemplatestring, optional
mergeMethodmerge | rebase_merge | ff, optional
mergePipelinesEnabledboolean, optional
mergeRequestsAccessLeveldisabled | private | enabled, optional
mergeRequestsTemplatestring, optional
mergeTrainsEnabledboolean, optional
mirrorboolean, optional
monitorAccessLeveldisabled | private | enabled, optional
onlyAllowMergeIfAllDiscussionsAreResolvedboolean, optional
onlyAllowMergeIfPipelineSucceedsboolean, optional
packagesEnabledboolean, optional
pagesAccessLeveldisabled | private | enabled | public, optional
printingMergeRequestLinkEnabledboolean, optional
releasesAccessLeveldisabled | private | enabled, optional
removeSourceBranchAfterMergeboolean, optional
repositoryAccessLeveldisabled | private | enabled, optional
requestAccessEnabledboolean, optional
requirementsAccessLeveldisabled | private | enabled, optional
resolveOutdatedDiffDiscussionsboolean, optional
restrictUserDefinedVariablesboolean, optional
securityAndComplianceAccessLeveldisabled | private | enabled, optional
serviceDeskEnabledboolean, optional
sharedRunnersEnabledboolean, optional
snippetsAccessLeveldisabled | private | enabled, optional
squashCommitTemplatestring, optional
squashOptionnever | always | default_on | default_off, optional
suggestionCommitMessagestring, optional
topicsstring array, optional
visibilitypublic | internal | private, optional
wikiAccessLeveldisabled | private | enabled, optional

GitlabApprovalsConfig

All properties are optional. Any undefined properties will default to the specified configDefaults.approvalsConfig of the referenced GitlabDefaults.

For detailed info about the properties, please reference GitLab’s documentation.

propertytype
resetApprovalsOnPushboolean, optional
disableOverridingApproversPerMergeRequestboolean, optional
mergeRequestsAuthorApprovalboolean, optional
mergeRequestsDisableCommittersApprovalboolean, optional
requirePasswordToApproveboolean, optional

GitlabApprovalRule

Only if the project’s spec.approvalRules entire array is left undefined will the configDefaults.approvalsConfig of the referenced GitlabDefaults be used.

For detailed info about the properties, please reference GitLab’s documentation.

propertytype
namestring, required
approvalsRequirednumber, required
ruleTypeany_approval | regular | report_approver, required
appliesToAllProtectedBranchesboolean, required
usernamesstring array, optional
groupIdsstring array, optional
protectedBranchIdsnumber array, required when appliesToAllProtectedBranches=false
reportTypereport_approver | code_coverage, optional

GitlabProtectedBranch

Only if the project’s spec.protectedBranches entire array is left undefined will the configDefaults.protectedBranches of the referenced GitlabDefaults be used.

For detailed info about the properties, please reference GitLab’s documentation.

propertytype
namestring, required
allowForcePushboolean, required
codeOwnerApprovalRequiredboolean, required
mergeAccessLevelsno_one | developer | maintainer, nullable
pushAccessLevelsno_one | developer | maintainer, nullable
unprotectedAccessLevelsno_one | developer | maintainer, nullable

GitlabMember

propertytypedescription
namestring, requiredName of the user in the Users resource.
accessLevelno_access | minimal_access | guest | reporter | developer | maintainer | owner, requiredThe access level of the user.

Example

The following example includes all possible properties for GitlabGroupConfig and GitlabApprovalsConfig. Furthermore, an example GitlabApprovalRule array is included.

version: '1'
kind: GitlabProject
metadata:
    name: example_project
    configDefaults: GitlabDefaults
spec:
    name: Example Project
    group: example_group
    config:
        allowMergeOnSkippedPipeline: false
        allowPipelineTriggerApproveDeployment: false
        analyticsAccessLevel: enabled
        autoCancelPendingPipelines: enabled
        autoDevopsDeployStrategy: continuous
        autoDevopsEnabled: false
        autocloseReferencedIssues: true
        buildGitStrategy: fetch
        buildTimeout: 3600
        buildsAccessLevel: enabled
        ciAllowForkPipelinesToRunInParentProject: true
        ciConfigPath: ''
        ciDefaultGitDepth: 20
        ciForwardDeploymentEnabled: true
        ciSeparatedCaches: true
        containerExpirationPolicyAttributes:
            cadence: 1d
            enabled: false
            keepN: 10
            nameRegex: .*
            nameRegexKeep: ''
            olderThan: 90d
        containerRegistryAccessLevel: enabled
        defaultBranch: main
        description: ''
        emailsDisabled: false
        enforceAuthChecksOnUploads: true
        externalAuthorizationClassificationLabel: ''
        featureFlagsAccessLevel: enabled
        forkingAccessLevel: enabled
        groupRunnersEnabled: true
        infrastructureAccessLevel: enabled
        issueBranchTemplate: ''
        issuesAccessLevel: enabled
        issuesTemplate: ''
        keepLatestArtifact: true
        lfsEnabled: true
        mergeCommitTemplate: ''
        mergeMethod: ff
        mergePipelinesEnabled: true
        mergeRequestsAccessLevel: private
        mergeRequestsTemplate: ''
        mergeTrainsEnabled: false
        mirror: false
        monitorAccessLevel: enabled
        onlyAllowMergeIfAllDiscussionsAreResolved: true
        onlyAllowMergeIfPipelineSucceeds: true
        packagesEnabled: true
        pagesAccessLevel: private
        printingMergeRequestLinkEnabled: true
        releasesAccessLevel: enabled
        removeSourceBranchAfterMerge: true
        repositoryAccessLevel: enabled
        requestAccessEnabled: false
        requirementsAccessLevel: enabled
        resolveOutdatedDiffDiscussions: false
        restrictUserDefinedVariables: false
        securityAndComplianceAccessLevel: private
        serviceDeskEnabled: true
        sharedRunnersEnabled: true
        snippetsAccessLevel: disabled
        squashCommitTemplate: ''
        squashOption: default_off
        suggestionCommitMessage: ''
        topics: []
        visibility: private
        wikiAccessLevel: disabled
    approvalsConfig:
        disableOverridingApproversPerMergeRequest: false
        mergeRequestsAuthorApproval: false
        mergeRequestsDisableCommittersApproval: false
        requirePasswordToApprove: false
        resetApprovalsOnPush: true
    approvalRules:
        - name: Approval rule
          appliesToAllProtectedBranches: false
          approvalsRequired: 1
          groupIds: []
          protectedBranchIds: []
          ruleType: any_approver
          usernames: []
    protectedBranches:
        - name: main
          allowForcePush: false
          codeOwnerApprovalRequired: false
          mergeAccessLevels:
              - maintainer
          pushAccessLevels:
              - maintainer
          unprotectedAccessLevels: []
    members:
        - name: alice.johnson
          accessLevel: maintainer
        - name: erik.klein
          accessLevel: developer