-
Notifications
You must be signed in to change notification settings - Fork 61
/
main.tf
38 lines (33 loc) · 1.2 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Make sure to set the following environment variables:
# AZDO_PERSONAL_ACCESS_TOKEN
# AZDO_ORG_SERVICE_URL
# AZDO_GITHUB_SERVICE_CONNECTION_PAT
provider "azuredevops" {
version = ">= 0.0.1"
}
resource "azuredevops_project" "project" {
project_name = "Test Project"
description = "Test Project Description"
visibility = "private"
version_control = "Git"
work_item_template = "Agile"
}
resource "azuredevops_build_definition" "build_definition" {
project_id = azuredevops_project.project.id
name = "Test Pipeline"
agent_pool_name = "Hosted Ubuntu 1604"
repository {
repo_type = "GitHub"
repo_name = "nmiodice/terraform-azure-devops-hack"
branch_name = "master"
yml_path = "azdo-api-samples/azure-pipeline.yml"
service_connection_id = azuredevops_serviceendpoint.github_serviceendpoint.id
}
}
resource "azuredevops_serviceendpoint" "github_serviceendpoint" {
project_id = azuredevops_project.project.id
service_endpoint_name = "GitHub Service Connection"
service_endpoint_type = "github"
service_endpoint_url = "http://github.com"
service_endpoint_owner = "Library"
}