RepositoryFileArgs

data class RepositoryFileArgs(val authorEmail: Output<String>? = null, val authorName: Output<String>? = null, val branch: Output<String>? = null, val commitMessage: Output<String>? = null, val content: Output<String>? = null, val createCommitMessage: Output<String>? = null, val deleteCommitMessage: Output<String>? = null, val encoding: Output<String>? = null, val executeFilemode: Output<Boolean>? = null, val filePath: Output<String>? = null, val overwriteOnCreate: Output<Boolean>? = null, val project: Output<String>? = null, val startBranch: Output<String>? = null, val updateCommitMessage: Output<String>? = null) : ConvertibleToJava<RepositoryFileArgs>

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
import * as std from "@pulumi/std";
const _this = new gitlab.Group("this", {
name: "example",
path: "example",
description: "An example group",
});
const thisProject = new gitlab.Project("this", {
name: "example",
namespaceId: _this.id,
initializeWithReadme: true,
});
const thisRepositoryFile = new gitlab.RepositoryFile("this", {
project: thisProject.id,
filePath: "meow.txt",
branch: "main",
content: std.base64encode({
input: "Meow goes the cat",
}).then(invoke => invoke.result),
authorEmail: "terraform@example.com",
authorName: "Terraform",
commitMessage: "feature: add meow file",
});
const readme = new gitlab.RepositoryFile("readme", {
project: thisProject.id,
filePath: "readme.txt",
branch: "main",
content: "Meow goes the cat",
authorEmail: "terraform@example.com",
authorName: "Terraform",
commitMessage: "feature: add readme file",
});
const readmeForDogs = new gitlab.RepositoryFile("readme_for_dogs", {
project: thisProject.id,
filePath: "readme.txt",
branch: "main",
content: "Bark goes the dog",
authorEmail: "terraform@example.com",
authorName: "Terraform",
commitMessage: "feature: update readme file",
overwriteOnCreate: true,
});
import pulumi
import pulumi_gitlab as gitlab
import pulumi_std as std
this = gitlab.Group("this",
name="example",
path="example",
description="An example group")
this_project = gitlab.Project("this",
name="example",
namespace_id=this.id,
initialize_with_readme=True)
this_repository_file = gitlab.RepositoryFile("this",
project=this_project.id,
file_path="meow.txt",
branch="main",
content=std.base64encode(input="Meow goes the cat").result,
author_email="terraform@example.com",
author_name="Terraform",
commit_message="feature: add meow file")
readme = gitlab.RepositoryFile("readme",
project=this_project.id,
file_path="readme.txt",
branch="main",
content="Meow goes the cat",
author_email="terraform@example.com",
author_name="Terraform",
commit_message="feature: add readme file")
readme_for_dogs = gitlab.RepositoryFile("readme_for_dogs",
project=this_project.id,
file_path="readme.txt",
branch="main",
content="Bark goes the dog",
author_email="terraform@example.com",
author_name="Terraform",
commit_message="feature: update readme file",
overwrite_on_create=True)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;
using Std = Pulumi.Std;
return await Deployment.RunAsync(() =>
{
var @this = new GitLab.Group("this", new()
{
Name = "example",
Path = "example",
Description = "An example group",
});
var thisProject = new GitLab.Project("this", new()
{
Name = "example",
NamespaceId = @this.Id,
InitializeWithReadme = true,
});
var thisRepositoryFile = new GitLab.RepositoryFile("this", new()
{
Project = thisProject.Id,
FilePath = "meow.txt",
Branch = "main",
Content = Std.Base64encode.Invoke(new()
{
Input = "Meow goes the cat",
}).Apply(invoke => invoke.Result),
AuthorEmail = "terraform@example.com",
AuthorName = "Terraform",
CommitMessage = "feature: add meow file",
});
var readme = new GitLab.RepositoryFile("readme", new()
{
Project = thisProject.Id,
FilePath = "readme.txt",
Branch = "main",
Content = "Meow goes the cat",
AuthorEmail = "terraform@example.com",
AuthorName = "Terraform",
CommitMessage = "feature: add readme file",
});
var readmeForDogs = new GitLab.RepositoryFile("readme_for_dogs", new()
{
Project = thisProject.Id,
FilePath = "readme.txt",
Branch = "main",
Content = "Bark goes the dog",
AuthorEmail = "terraform@example.com",
AuthorName = "Terraform",
CommitMessage = "feature: update readme file",
OverwriteOnCreate = true,
});
});
package main
import (
"github.com/pulumi/pulumi-gitlab/sdk/v7/go/gitlab"
"github.com/pulumi/pulumi-std/sdk/go/std"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
this, err := gitlab.NewGroup(ctx, "this", &gitlab.GroupArgs{
Name: pulumi.String("example"),
Path: pulumi.String("example"),
Description: pulumi.String("An example group"),
})
if err != nil {
return err
}
thisProject, err := gitlab.NewProject(ctx, "this", &gitlab.ProjectArgs{
Name: pulumi.String("example"),
NamespaceId: this.ID(),
InitializeWithReadme: pulumi.Bool(true),
})
if err != nil {
return err
}
invokeBase64encode, err := std.Base64encode(ctx, &std.Base64encodeArgs{
Input: "Meow goes the cat",
}, nil)
if err != nil {
return err
}
_, err = gitlab.NewRepositoryFile(ctx, "this", &gitlab.RepositoryFileArgs{
Project: thisProject.ID(),
FilePath: pulumi.String("meow.txt"),
Branch: pulumi.String("main"),
Content: invokeBase64encode.Result,
AuthorEmail: pulumi.String("terraform@example.com"),
AuthorName: pulumi.String("Terraform"),
CommitMessage: pulumi.String("feature: add meow file"),
})
if err != nil {
return err
}
_, err = gitlab.NewRepositoryFile(ctx, "readme", &gitlab.RepositoryFileArgs{
Project: thisProject.ID(),
FilePath: pulumi.String("readme.txt"),
Branch: pulumi.String("main"),
Content: pulumi.String("Meow goes the cat"),
AuthorEmail: pulumi.String("terraform@example.com"),
AuthorName: pulumi.String("Terraform"),
CommitMessage: pulumi.String("feature: add readme file"),
})
if err != nil {
return err
}
_, err = gitlab.NewRepositoryFile(ctx, "readme_for_dogs", &gitlab.RepositoryFileArgs{
Project: thisProject.ID(),
FilePath: pulumi.String("readme.txt"),
Branch: pulumi.String("main"),
Content: pulumi.String("Bark goes the dog"),
AuthorEmail: pulumi.String("terraform@example.com"),
AuthorName: pulumi.String("Terraform"),
CommitMessage: pulumi.String("feature: update readme file"),
OverwriteOnCreate: pulumi.Bool(true),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.Group;
import com.pulumi.gitlab.GroupArgs;
import com.pulumi.gitlab.Project;
import com.pulumi.gitlab.ProjectArgs;
import com.pulumi.gitlab.RepositoryFile;
import com.pulumi.gitlab.RepositoryFileArgs;
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 this_ = new Group("this", GroupArgs.builder()
.name("example")
.path("example")
.description("An example group")
.build());
var thisProject = new Project("thisProject", ProjectArgs.builder()
.name("example")
.namespaceId(this_.id())
.initializeWithReadme(true)
.build());
var thisRepositoryFile = new RepositoryFile("thisRepositoryFile", RepositoryFileArgs.builder()
.project(thisProject.id())
.filePath("meow.txt")
.branch("main")
.content(StdFunctions.base64encode(Base64encodeArgs.builder()
.input("Meow goes the cat")
.build()).result())
.authorEmail("terraform@example.com")
.authorName("Terraform")
.commitMessage("feature: add meow file")
.build());
var readme = new RepositoryFile("readme", RepositoryFileArgs.builder()
.project(thisProject.id())
.filePath("readme.txt")
.branch("main")
.content("Meow goes the cat")
.authorEmail("terraform@example.com")
.authorName("Terraform")
.commitMessage("feature: add readme file")
.build());
var readmeForDogs = new RepositoryFile("readmeForDogs", RepositoryFileArgs.builder()
.project(thisProject.id())
.filePath("readme.txt")
.branch("main")
.content("Bark goes the dog")
.authorEmail("terraform@example.com")
.authorName("Terraform")
.commitMessage("feature: update readme file")
.overwriteOnCreate(true)
.build());
}
}
resources:
this:
type: gitlab:Group
properties:
name: example
path: example
description: An example group
thisProject:
type: gitlab:Project
name: this
properties:
name: example
namespaceId: ${this.id}
initializeWithReadme: true
thisRepositoryFile:
type: gitlab:RepositoryFile
name: this
properties:
project: ${thisProject.id}
filePath: meow.txt
branch: main
content:
fn::invoke:
Function: std:base64encode
Arguments:
input: Meow goes the cat
Return: result
authorEmail: terraform@example.com
authorName: Terraform
commitMessage: 'feature: add meow file'
readme:
type: gitlab:RepositoryFile
properties:
project: ${thisProject.id}
filePath: readme.txt
branch: main
content: Meow goes the cat
authorEmail: terraform@example.com
authorName: Terraform
commitMessage: 'feature: add readme file'
readmeForDogs:
type: gitlab:RepositoryFile
name: readme_for_dogs
properties:
project: ${thisProject.id}
filePath: readme.txt
branch: main
content: Bark goes the dog
authorEmail: terraform@example.com
authorName: Terraform
commitMessage: 'feature: update readme file'
overwriteOnCreate: true

Import

A Repository File can be imported using an id made up of <project-id>:<branch-name>:<file-path>, e.g.

$ pulumi import gitlab:index/repositoryFile:RepositoryFile this 1:main:foo/bar.txt

Constructors

Link copied to clipboard
constructor(authorEmail: Output<String>? = null, authorName: Output<String>? = null, branch: Output<String>? = null, commitMessage: Output<String>? = null, content: Output<String>? = null, createCommitMessage: Output<String>? = null, deleteCommitMessage: Output<String>? = null, encoding: Output<String>? = null, executeFilemode: Output<Boolean>? = null, filePath: Output<String>? = null, overwriteOnCreate: Output<Boolean>? = null, project: Output<String>? = null, startBranch: Output<String>? = null, updateCommitMessage: Output<String>? = null)

Properties

Link copied to clipboard
val authorEmail: Output<String>? = null

Email of the commit author.

Link copied to clipboard
val authorName: Output<String>? = null

Name of the commit author.

Link copied to clipboard
val branch: Output<String>? = null

Name of the branch to which to commit to.

Link copied to clipboard
val commitMessage: Output<String>? = null

Commit message.

Link copied to clipboard
val content: Output<String>? = null

File content.

Link copied to clipboard
val createCommitMessage: Output<String>? = null

Create commit message.

Link copied to clipboard
val deleteCommitMessage: Output<String>? = null

Delete Commit message.

Link copied to clipboard
val encoding: Output<String>? = null

The file content encoding. Default value is base64. Valid values are: base64, text.

Link copied to clipboard
val executeFilemode: Output<Boolean>? = null

Enables or disables the execute flag on the file. Note: requires GitLab 14.10 or newer.

Link copied to clipboard
val filePath: Output<String>? = null

The full path of the file. It must be relative to the root of the project without a leading slash / or ./.

Link copied to clipboard
val overwriteOnCreate: Output<Boolean>? = null

Enable overwriting existing files, defaults to false. This attribute is only used during create and must be use carefully. We suggest to use imports whenever possible and limit the use of this attribute for when the project was imported on the same apply. This attribute is not supported during a resource import.

Link copied to clipboard
val project: Output<String>? = null

The name or ID of the project.

Link copied to clipboard
val startBranch: Output<String>? = null

Name of the branch to start the new commit from.

Link copied to clipboard
val updateCommitMessage: Output<String>? = null

Update commit message.

Functions

Link copied to clipboard
open override fun toJava(): RepositoryFileArgs