ProjectBadge

class ProjectBadge : KotlinCustomResource

The gitlab.ProjectBadge resource allows to manage the lifecycle of project badges. Upstream API: GitLab REST API docs

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
const foo = new gitlab.Project("foo", {});
const example = new gitlab.ProjectBadge("example", {
project: foo.id,
linkUrl: "https://example.com/badge-123",
imageUrl: "https://example.com/badge-123.svg",
});
// Pipeline status badges with placeholders will be enabled
const gitlabPipeline = new gitlab.ProjectBadge("gitlabPipeline", {
project: foo.id,
linkUrl: "https://gitlab.example.com/%{project_path}/-/pipelines?ref=%{default_branch}",
imageUrl: "https://gitlab.example.com/%{project_path}/badges/%{default_branch}/pipeline.svg",
});
// Test coverage report badges with placeholders will be enabled
const gitlabCoverage = new gitlab.ProjectBadge("gitlabCoverage", {
project: foo.id,
linkUrl: "https://gitlab.example.com/%{project_path}/-/jobs",
imageUrl: "https://gitlab.example.com/%{project_path}/badges/%{default_branch}/coverage.svg",
});
// Latest release badges with placeholders will be enabled
const gitlabRelease = new gitlab.ProjectBadge("gitlabRelease", {
project: foo.id,
linkUrl: "https://gitlab.example.com/%{project_path}/-/releases",
imageUrl: "https://gitlab.example.com/%{project_path}/-/badges/release.svg",
});
import pulumi
import pulumi_gitlab as gitlab
foo = gitlab.Project("foo")
example = gitlab.ProjectBadge("example",
project=foo.id,
link_url="https://example.com/badge-123",
image_url="https://example.com/badge-123.svg")
# Pipeline status badges with placeholders will be enabled
gitlab_pipeline = gitlab.ProjectBadge("gitlabPipeline",
project=foo.id,
link_url="https://gitlab.example.com/%{project_path}/-/pipelines?ref=%{default_branch}",
image_url="https://gitlab.example.com/%{project_path}/badges/%{default_branch}/pipeline.svg")
# Test coverage report badges with placeholders will be enabled
gitlab_coverage = gitlab.ProjectBadge("gitlabCoverage",
project=foo.id,
link_url="https://gitlab.example.com/%{project_path}/-/jobs",
image_url="https://gitlab.example.com/%{project_path}/badges/%{default_branch}/coverage.svg")
# Latest release badges with placeholders will be enabled
gitlab_release = gitlab.ProjectBadge("gitlabRelease",
project=foo.id,
link_url="https://gitlab.example.com/%{project_path}/-/releases",
image_url="https://gitlab.example.com/%{project_path}/-/badges/release.svg")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;
return await Deployment.RunAsync(() =>
{
var foo = new GitLab.Project("foo");
var example = new GitLab.ProjectBadge("example", new()
{
Project = foo.Id,
LinkUrl = "https://example.com/badge-123",
ImageUrl = "https://example.com/badge-123.svg",
});
// Pipeline status badges with placeholders will be enabled
var gitlabPipeline = new GitLab.ProjectBadge("gitlabPipeline", new()
{
Project = foo.Id,
LinkUrl = "https://gitlab.example.com/%{project_path}/-/pipelines?ref=%{default_branch}",
ImageUrl = "https://gitlab.example.com/%{project_path}/badges/%{default_branch}/pipeline.svg",
});
// Test coverage report badges with placeholders will be enabled
var gitlabCoverage = new GitLab.ProjectBadge("gitlabCoverage", new()
{
Project = foo.Id,
LinkUrl = "https://gitlab.example.com/%{project_path}/-/jobs",
ImageUrl = "https://gitlab.example.com/%{project_path}/badges/%{default_branch}/coverage.svg",
});
// Latest release badges with placeholders will be enabled
var gitlabRelease = new GitLab.ProjectBadge("gitlabRelease", new()
{
Project = foo.Id,
LinkUrl = "https://gitlab.example.com/%{project_path}/-/releases",
ImageUrl = "https://gitlab.example.com/%{project_path}/-/badges/release.svg",
});
});
package main
import (
"github.com/pulumi/pulumi-gitlab/sdk/v6/go/gitlab"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
foo, err := gitlab.NewProject(ctx, "foo", nil)
if err != nil {
return err
}
_, err = gitlab.NewProjectBadge(ctx, "example", &gitlab.ProjectBadgeArgs{
Project: foo.ID(),
LinkUrl: pulumi.String("https://example.com/badge-123"),
ImageUrl: pulumi.String("https://example.com/badge-123.svg"),
})
if err != nil {
return err
}
// Pipeline status badges with placeholders will be enabled
_, err = gitlab.NewProjectBadge(ctx, "gitlabPipeline", &gitlab.ProjectBadgeArgs{
Project: foo.ID(),
LinkUrl: pulumi.String("https://gitlab.example.com/%{project_path}/-/pipelines?ref=%{default_branch}"),
ImageUrl: pulumi.String("https://gitlab.example.com/%{project_path}/badges/%{default_branch}/pipeline.svg"),
})
if err != nil {
return err
}
// Test coverage report badges with placeholders will be enabled
_, err = gitlab.NewProjectBadge(ctx, "gitlabCoverage", &gitlab.ProjectBadgeArgs{
Project: foo.ID(),
LinkUrl: pulumi.String("https://gitlab.example.com/%{project_path}/-/jobs"),
ImageUrl: pulumi.String("https://gitlab.example.com/%{project_path}/badges/%{default_branch}/coverage.svg"),
})
if err != nil {
return err
}
// Latest release badges with placeholders will be enabled
_, err = gitlab.NewProjectBadge(ctx, "gitlabRelease", &gitlab.ProjectBadgeArgs{
Project: foo.ID(),
LinkUrl: pulumi.String("https://gitlab.example.com/%{project_path}/-/releases"),
ImageUrl: pulumi.String("https://gitlab.example.com/%{project_path}/-/badges/release.svg"),
})
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.ProjectBadge;
import com.pulumi.gitlab.ProjectBadgeArgs;
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 foo = new Project("foo");
var example = new ProjectBadge("example", ProjectBadgeArgs.builder()
.project(foo.id())
.linkUrl("https://example.com/badge-123")
.imageUrl("https://example.com/badge-123.svg")
.build());
// Pipeline status badges with placeholders will be enabled
var gitlabPipeline = new ProjectBadge("gitlabPipeline", ProjectBadgeArgs.builder()
.project(foo.id())
.linkUrl("https://gitlab.example.com/%{project_path}/-/pipelines?ref=%{default_branch}")
.imageUrl("https://gitlab.example.com/%{project_path}/badges/%{default_branch}/pipeline.svg")
.build());
// Test coverage report badges with placeholders will be enabled
var gitlabCoverage = new ProjectBadge("gitlabCoverage", ProjectBadgeArgs.builder()
.project(foo.id())
.linkUrl("https://gitlab.example.com/%{project_path}/-/jobs")
.imageUrl("https://gitlab.example.com/%{project_path}/badges/%{default_branch}/coverage.svg")
.build());
// Latest release badges with placeholders will be enabled
var gitlabRelease = new ProjectBadge("gitlabRelease", ProjectBadgeArgs.builder()
.project(foo.id())
.linkUrl("https://gitlab.example.com/%{project_path}/-/releases")
.imageUrl("https://gitlab.example.com/%{project_path}/-/badges/release.svg")
.build());
}
}
resources:
foo:
type: gitlab:Project
example:
type: gitlab:ProjectBadge
properties:
project: ${foo.id}
linkUrl: https://example.com/badge-123
imageUrl: https://example.com/badge-123.svg
# Pipeline status badges with placeholders will be enabled
gitlabPipeline:
type: gitlab:ProjectBadge
properties:
project: ${foo.id}
linkUrl: https://gitlab.example.com/%{project_path}/-/pipelines?ref=%{default_branch}
imageUrl: https://gitlab.example.com/%{project_path}/badges/%{default_branch}/pipeline.svg
# Test coverage report badges with placeholders will be enabled
gitlabCoverage:
type: gitlab:ProjectBadge
properties:
project: ${foo.id}
linkUrl: https://gitlab.example.com/%{project_path}/-/jobs
imageUrl: https://gitlab.example.com/%{project_path}/badges/%{default_branch}/coverage.svg
# Latest release badges with placeholders will be enabled
gitlabRelease:
type: gitlab:ProjectBadge
properties:
project: ${foo.id}
linkUrl: https://gitlab.example.com/%{project_path}/-/releases
imageUrl: https://gitlab.example.com/%{project_path}/-/badges/release.svg

Import

GitLab project badges can be imported using an id made up of {project_id}:{badge_id}, e.g.

$ pulumi import gitlab:index/projectBadge:ProjectBadge foo 1:3

Properties

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val imageUrl: Output<String>

The image url which will be presented on project overview.

Link copied to clipboard
val linkUrl: Output<String>

The url linked with the badge.

Link copied to clipboard
val name: Output<String>

The name of the badge.

Link copied to clipboard
val project: Output<String>

The id of the project to add the badge to.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The image_url argument rendered (in case of use of placeholders).

Link copied to clipboard
val renderedLinkUrl: Output<String>

The link_url argument rendered (in case of use of placeholders).

Link copied to clipboard
val urn: Output<String>