-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Support for GitHub enterprise as a build definition repository type #97
Add Support for GitHub enterprise as a build definition repository type #97
Conversation
Hi @shubydo , I'm afraid this new feature might not working if |
@xuzhang3 Yes, currently the ADO provider doesn't support creating GitHub enterprise service connections, but I was able to use the ID of an existing GitHub enterprise service connection (created through the console/UI) when creating the build definition. Also, there is a check to validate that a service connection ID is used when |
@@ -831,6 +848,12 @@ func expandBuildDefinition(d *schema.ResourceData) (*build.BuildDefinition, stri | |||
repoURL = fmt.Sprintf("https://bitbucket.org/%s.git", repoID) | |||
repoAPIURL = fmt.Sprintf("https://api.bitbucket.org/2.0/repositories/%s", repoID) | |||
} | |||
if strings.EqualFold(string(repoType), string(model.RepoTypeValues.GitHubEnterprise)) { | |||
githubEnterpriseURL := repository["github_enterprise_url"].(string) | |||
fmt.Println("githubEnterpriseURL: ", githubEnterpriseURL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fmt.Println
should removed or replace with log.Printf
@@ -11,6 +11,7 @@ Manages a Build Definition within Azure DevOps. | |||
|
|||
## Example Usage | |||
|
|||
### Tfs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does Tfs
mean ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Team Foundation Server + Git. It's an example when repo_type
is TfsGit
@@ -98,9 +122,10 @@ The following arguments are supported: | |||
|
|||
- `branch_name` - (Optional) The branch name for which builds are triggered. Defaults to `master`. | |||
- `repo_id` - (Required) The id of the repository. For `TfsGit` repos, this is simply the ID of the repository. For `Github` repos, this will take the form of `<GitHub Org>/<Repo Name>`. For `Bitbucket` repos, this will take the form of `<Workspace ID>/<Repo Name>`. | |||
- `repo_type` - (Optional) The repository type. Valid values: `GitHub` or `TfsGit` or `Bitbucket`. Defaults to `Github`. | |||
- `service_connection_id` - (Optional) The service connection ID. Used if the `repo_type` is `GitHub`. | |||
- `repo_type` - (Optional) The repository type. Valid values: `GitHub` or `TfsGit` or `Bitbucket` or `GitHub Enterprise`. Defaults to `Github`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Document should point out if repo_type
is `GitHubEnterprise`` , must use existing project and GitHub enterprise service connection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shubydo Thanks for contribution and I left some comments on what you might need to change.
Made the updates. Please let me know if there is anything else. |
All Submissions:
What about the current behavior has changed?
Add Support for GitHub enterprise as a build definition repository type.
Under the
repository
block in theazuredevops_build_definition
resource, you can now specifyGitHubEnterprise
as therepo_type
and specify the Github Enterprise URL using thegithub_enterprise_url
.Example:
Issue Number: #35
Does this introduce a change to
go.mod
,go.sum
orvendor/
?Does this introduce a breaking change?
Any relevant logs, error output, etc?
(If it’s long, please paste to https://ghostbin.com/ and insert the link here.)
Other information