How do I automate importing repos in gitlab?

Viewed 157

How do I automate cloning/pushing certain repos to a gitlab instance when it is instantiated?

I'm building an IaC project which uses Gitlab, Terraform and Docker to build testing lab pods.

Thanks!

1 Answers

With Gitlab provider:

resource "gitlab_project" "terraform" {
  name = "my_shiny_new_project"
  import_url = "https://github.com/hashicorp/terraform.git"
}

Above will create a new project named "terraform" containing cloned repo from given URL.

Related