Project Mirror
The gitlab.ProjectMirror
resource allows to manage the lifecycle of a project mirror. This is for pushing changes to a remote repository. Pull Mirroring can be configured using a combination of the import_url, mirror, and mirror_trigger_builds properties on the gitlab.Project resource.
Destroy Behavior GitLab 14.10 introduced an API endpoint to delete a project mirror. Therefore, for GitLab 14.10 and newer the project mirror will be destroyed when the resource is destroyed. For older versions, the mirror will be disabled and the resource will be destroyed. Upstream API: GitLab REST API docs
Example Usage
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.ProjectMirror;
import com.pulumi.gitlab.ProjectMirrorArgs;
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 ProjectMirror("foo", ProjectMirrorArgs.builder()
.project("1")
.url("https://username:password@github.com/org/repository.git")
.build());
}
}
Content copied to clipboard
Import
GitLab project mirror can be imported using an id made up of project_id:mirror_id
, e.g.
$ pulumi import gitlab:index/projectMirror:ProjectMirror foo "12345:1337"
Content copied to clipboard