Project
Example Usage
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.Project;
import com.pulumi.gitlab.ProjectArgs;
import com.pulumi.gitlab.inputs.ProjectPushRulesArgs;
import com.pulumi.gitlab.GitlabFunctions;
import com.pulumi.gitlab.inputs.GetUserArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Project("example", ProjectArgs.builder()
.description("My awesome codebase")
.visibilityLevel("public")
.build());
var example_two = new Project("example-two", ProjectArgs.builder()
.pushRules(ProjectPushRulesArgs.builder()
.authorEmailRegex("@example\\.com$")
.commitCommitterCheck(true)
.memberCheck(true)
.preventSecrets(true)
.build())
.build());
final var peterParker = GitlabFunctions.getUser(GetUserArgs.builder()
.username("peter_parker")
.build());
var petersRepo = new Project("petersRepo", ProjectArgs.builder()
.description("This is a description")
.namespaceId(peterParker.applyValue(getUserResult -> getUserResult.namespaceId()))
.build());
}
}
Import
$ pulumi import gitlab:index/project:Project You can import a project state using `<resource> <id>`. The
id
can be whatever the get_single_project takes for its :id
value, so for example
$ pulumi import gitlab:index/project:Project example richardc/example
Properties
Set to true if you want to treat skipped pipelines as if they finished with success.
Set the analytics access level. Valid values are disabled
, private
, enabled
.
Number of merge request approvals required for merging. Default is 0. This field does not work well in combination with the gitlab.ProjectApprovalRule
resource and is most likely gonna be deprecated in a future GitLab version (see this upstream epic). In the meantime we recommend against using this attribute and use gitlab.ProjectApprovalRule
instead.
Set to true
to archive the project instead of deleting on destroy. If set to true
it will entire omit the DELETE
operation.
Auto-cancel pending pipelines. This isn’t a boolean, but enabled/disabled.
Set whether auto-closing referenced issues on default branch.
Auto Deploy strategy. Valid values are continuous
, manual
, timed_incremental
.
Enable Auto DevOps for this project.
Test coverage parsing for the project. This is deprecated feature in GitLab 15.0.
The Git strategy. Defaults to fetch.
Set the builds access level. Valid values are disabled
, private
, enabled
.
The maximum amount of time, in seconds, that a job can run.
Custom Path to CI config file.
Default number of revisions for shallow cloning.
When a new deployment job starts, skip older deployment jobs that are still pending.
Set the image cleanup policy for this project. Note: this field is sometimes named container_expiration_policy_attributes
in the GitLab Upstream API.
Set visibility of container registry, for this project. Valid values are disabled
, private
, enabled
.
Enable container registry for the project.
The default branch for the project.
A description of the project.
Disable email notifications.
The classification label for the project.
Set the forking access level. Valid values are disabled
, private
, enabled
.
For group-level custom templates, specifies ID of group from which all the custom project templates are sourced. Leave empty for instance-level templates. Requires usecustomtemplate to be true (enterprise edition).
URL that can be provided to git clone
to clone the
Create main branch with first commit containing a README.md file.
Set the issues access level. Valid values are disabled
, private
, enabled
.
Enable issue tracking for the project.
Sets the template for new issues in the project.
Enable LFS for the project.
Template used to create merge commit message in merge requests. (Introduced in GitLab 14.5.)
Set the merge method. Valid values are merge
, rebase_merge
, ff
.
Enable or disable merge pipelines.
Set the merge requests access level. Valid values are disabled
, private
, enabled
.
Enable merge requests for the project.
Sets the template for new merge requests in the project.
Enable or disable merge trains. Requires merge_pipelines_enabled
to be set to true
to take effect.
Enable overwrite diverged branches for a mirrored project.
Enable trigger builds on pushes for a mirrored project.
The namespace (group or user) of the project. Defaults to your user.
Set to true if you want allow merges only if all discussions are resolved.
Set to true if you want allow merges only if a pipeline succeeds.
Enable only mirror protected branches for a mirrored project.
Set the operations access level. Valid values are disabled
, private
, enabled
.
Enable packages repository for the project.
Enable pages access control
The path of the repository with namespace.
Enable pipelines for the project. The pipelines_enabled
field is being sent as jobs_enabled
in the GitLab API calls.
Show link to create/view merge request when pushing from the command line
If true, jobs can be viewed by non-project members.
Push rules for the project.
Enable Delete source branch
option by default for all new merge requests.
Set the repository access level. Valid values are disabled
, private
, enabled
.
Which storage shard the repository is on. (administrator only)
Allow users to request member access.
Set the requirements access level. Valid values are disabled
, private
, enabled
.
Automatically resolve merge request diffs discussions on lines changed with a push.
Registration token to use during runner setup.
Set the security and compliance access level. Valid values are disabled
, private
, enabled
.
Enable shared runners for this project.
If true
, the default behavior to wait for the default branch protection to be created is skipped. This is necessary if the current user is not an admin and the default branch protection is disabled on an instance-level. There is currently no known way to determine if the default branch protection is disabled on an instance-level for non-admin users. This attribute is only used during resource creation, thus changes are suppressed and the attribute cannot be imported.
Set the snippets access level. Valid values are disabled
, private
, enabled
.
Enable snippets for the project.
Template used to create squash commit message in merge requests. (Introduced in GitLab 14.6.)
Squash commits when merge request. Valid values are never
, always
, default_on
, or default_off
. The default value is default_off
. GitLab >= 14.1
URL that can be provided to git clone
to clone the
The commit message used to apply merge request suggestions.
When used without usecustomtemplate, name of a built-in project template. When used with usecustomtemplate, name of a custom project template. This option is mutually exclusive with template_project_id
.
When used with usecustomtemplate, project ID of a custom project template. This is preferable to using templatename since templatename may be ambiguous (enterprise edition). This option is mutually exclusive with template_name
. See gitlab.GroupProjectFileTemplate
to set a project as a template project. If a project has not been set as a template, using it here will result in an error.
Use either custom instance or group (with groupwithprojecttemplatesid) project template (enterprise edition).
Set to public
to create a public project.
Set the wiki access level. Valid values are disabled
, private
, enabled
.
Enable wiki for the project.