Release
The gitlab.Release
resource allows to manage the lifecycle of releases in gitlab. Upstream API: GitLab REST API docs
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
// Create a project
const example = new gitlab.Project("example", {
name: "example",
description: "An example project",
});
// Create a release
const exampleRelease = new gitlab.Release("example", {
project: example.id,
name: "test-release",
tagName: "v1.0.0",
description: "Test release description",
ref: "main",
});
import pulumi
import pulumi_gitlab as gitlab
# Create a project
example = gitlab.Project("example",
name="example",
description="An example project")
# Create a release
example_release = gitlab.Release("example",
project=example.id,
name="test-release",
tag_name="v1.0.0",
description="Test release description",
ref="main")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;
return await Deployment.RunAsync(() =>
{
// Create a project
var example = new GitLab.Project("example", new()
{
Name = "example",
Description = "An example project",
});
// Create a release
var exampleRelease = new GitLab.Release("example", new()
{
Project = example.Id,
Name = "test-release",
TagName = "v1.0.0",
Description = "Test release description",
Ref = "main",
});
});
package main
import (
"github.com/pulumi/pulumi-gitlab/sdk/v8/go/gitlab"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Create a project
example, err := gitlab.NewProject(ctx, "example", &gitlab.ProjectArgs{
Name: pulumi.String("example"),
Description: pulumi.String("An example project"),
})
if err != nil {
return err
}
// Create a release
_, err = gitlab.NewRelease(ctx, "example", &gitlab.ReleaseArgs{
Project: example.ID(),
Name: pulumi.String("test-release"),
TagName: pulumi.String("v1.0.0"),
Description: pulumi.String("Test release description"),
Ref: pulumi.String("main"),
})
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.Project;
import com.pulumi.gitlab.ProjectArgs;
import com.pulumi.gitlab.Release;
import com.pulumi.gitlab.ReleaseArgs;
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) {
// Create a project
var example = new Project("example", ProjectArgs.builder()
.name("example")
.description("An example project")
.build());
// Create a release
var exampleRelease = new Release("exampleRelease", ReleaseArgs.builder()
.project(example.id())
.name("test-release")
.tagName("v1.0.0")
.description("Test release description")
.ref("main")
.build());
}
}
resources:
# Create a project
example:
type: gitlab:Project
properties:
name: example
description: An example project
# Create a release
exampleRelease:
type: gitlab:Release
name: example
properties:
project: ${example.id}
name: test-release
tagName: v1.0.0
description: Test release description
ref: main
Import
Starting in Terraform v1.5.0 you can use an import block to import gitlab_release
. For example: terraform import { to = gitlab_release.example id = "see CLI command below for ID" } Import using the CLI is supported using the following syntax: Gitlab release link can be imported with a key composed of <project>:<tag_name>
, e.g.
$ pulumi import gitlab:index/release:Release example "12345:test"
Properties
The release assets.
The author of the release.
The release commit.
The path to the commit
The description of the release. You can use Markdown.
HTML rendered Markdown of the release description.
Links of the release
The title of each milestone the release is associated with. GitLab Premium customers can specify group milestones.
Date and time for the release. Defaults to the current time. Expected in ISO 8601 format (2019-03-15T08:00:00Z). Only provide this field if creating an upcoming or historical release.
Message to use if creating a new annotated tag.
Whether the release_at attribute is set to a future date.