@pulumi/azuredevops
Version:
A Pulumi package for creating and managing Azure DevOps.
246 lines (245 loc) • 7.8 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Manage files within an Azure DevOps Git repository.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azuredevops from "@pulumi/azuredevops";
*
* const example = new azuredevops.Project("example", {
* name: "Example Project",
* visibility: "private",
* versionControl: "Git",
* workItemTemplate: "Agile",
* });
* const exampleGit = new azuredevops.Git("example", {
* projectId: example.id,
* name: "Example Git Repository",
* initialization: {
* initType: "Clean",
* },
* });
* const exampleGitRepositoryFile = new azuredevops.GitRepositoryFile("example", {
* repositoryId: exampleGit.id,
* file: ".gitignore",
* content: "**/*.tfstate",
* branch: "refs/heads/master",
* commitMessage: "First commit",
* overwriteOnCreate: false,
* });
* ```
*
* ### Author Email Pattern
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azuredevops from "@pulumi/azuredevops";
*
* const example = new azuredevops.Project("example", {
* name: "Example Project",
* visibility: "private",
* versionControl: "Git",
* workItemTemplate: "Agile",
* });
* const exampleGit = new azuredevops.Git("example", {
* projectId: example.id,
* name: "Example Git Repository",
* initialization: {
* initType: "Clean",
* },
* });
* const exampleRepositoryPolicyAuthorEmailPattern = new azuredevops.RepositoryPolicyAuthorEmailPattern("example", {
* projectId: example.id,
* enabled: true,
* blocking: true,
* authorEmailPatterns: ["auhtor@test.com"],
* repositoryIds: [exampleGit.id],
* });
* const exampleGitRepositoryFile = new azuredevops.GitRepositoryFile("example", {
* repositoryId: exampleGit.id,
* file: ".gitignore",
* content: "**/*.tfstate",
* branch: "refs/heads/master",
* commitMessage: "First commit",
* overwriteOnCreate: false,
* authorName: "authorname",
* authorEmail: "auhtor@test.com",
* }, {
* dependsOn: [exampleRepositoryPolicyAuthorEmailPattern],
* });
* ```
*
* ## Relevant Links
*
* - [Azure DevOps Service REST API 7.0 - Git API](https://docs.microsoft.com/en-us/rest/api/azure/devops/git/?view=azure-devops-rest-7.0)
*
* ## Import
*
* Repository files can be imported using a combination of the `repository ID` and `file`, e.g.
*
* ```sh
* $ pulumi import azuredevops:index/gitRepositoryFile:GitRepositoryFile example 00000000-0000-0000-0000-000000000000/.gitignore
* ```
*
* To import a file from a branch other than `master`, append `:` and the branch name, e.g.
*
* ```sh
* $ pulumi import azuredevops:index/gitRepositoryFile:GitRepositoryFile example 00000000-0000-0000-0000-000000000000/.gitignore:refs/heads/master
* ```
*/
export declare class GitRepositoryFile extends pulumi.CustomResource {
/**
* Get an existing GitRepositoryFile resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: GitRepositoryFileState, opts?: pulumi.CustomResourceOptions): GitRepositoryFile;
/**
* Returns true if the given object is an instance of GitRepositoryFile. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is GitRepositoryFile;
/**
* The email of the author.
*/
readonly authorEmail: pulumi.Output<string>;
/**
* The name of the author.
*/
readonly authorName: pulumi.Output<string>;
/**
* Git branch (defaults to `refs/heads/master`). The branch must already exist, it will not be created if it does not already exist.
*/
readonly branch: pulumi.Output<string | undefined>;
/**
* Commit message when adding or updating the managed file.
*/
readonly commitMessage: pulumi.Output<string>;
/**
* The email of the committer.
*/
readonly committerEmail: pulumi.Output<string>;
/**
* The name of the committer.
*/
readonly committerName: pulumi.Output<string>;
/**
* The file content.
*/
readonly content: pulumi.Output<string>;
/**
* The path of the file to manage.
*/
readonly file: pulumi.Output<string>;
/**
* Enable overwriting existing files (defaults to `false`).
*/
readonly overwriteOnCreate: pulumi.Output<boolean | undefined>;
/**
* The ID of the Git repository.
*/
readonly repositoryId: pulumi.Output<string>;
/**
* Create a GitRepositoryFile resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: GitRepositoryFileArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering GitRepositoryFile resources.
*/
export interface GitRepositoryFileState {
/**
* The email of the author.
*/
authorEmail?: pulumi.Input<string>;
/**
* The name of the author.
*/
authorName?: pulumi.Input<string>;
/**
* Git branch (defaults to `refs/heads/master`). The branch must already exist, it will not be created if it does not already exist.
*/
branch?: pulumi.Input<string>;
/**
* Commit message when adding or updating the managed file.
*/
commitMessage?: pulumi.Input<string>;
/**
* The email of the committer.
*/
committerEmail?: pulumi.Input<string>;
/**
* The name of the committer.
*/
committerName?: pulumi.Input<string>;
/**
* The file content.
*/
content?: pulumi.Input<string>;
/**
* The path of the file to manage.
*/
file?: pulumi.Input<string>;
/**
* Enable overwriting existing files (defaults to `false`).
*/
overwriteOnCreate?: pulumi.Input<boolean>;
/**
* The ID of the Git repository.
*/
repositoryId?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a GitRepositoryFile resource.
*/
export interface GitRepositoryFileArgs {
/**
* The email of the author.
*/
authorEmail?: pulumi.Input<string>;
/**
* The name of the author.
*/
authorName?: pulumi.Input<string>;
/**
* Git branch (defaults to `refs/heads/master`). The branch must already exist, it will not be created if it does not already exist.
*/
branch?: pulumi.Input<string>;
/**
* Commit message when adding or updating the managed file.
*/
commitMessage?: pulumi.Input<string>;
/**
* The email of the committer.
*/
committerEmail?: pulumi.Input<string>;
/**
* The name of the committer.
*/
committerName?: pulumi.Input<string>;
/**
* The file content.
*/
content: pulumi.Input<string>;
/**
* The path of the file to manage.
*/
file: pulumi.Input<string>;
/**
* Enable overwriting existing files (defaults to `false`).
*/
overwriteOnCreate?: pulumi.Input<boolean>;
/**
* The ID of the Git repository.
*/
repositoryId: pulumi.Input<string>;
}