Skip to content

Commit

Permalink
Added Azure Repos VCS (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
omerzi committed Nov 21, 2022
1 parent 46aa552 commit 4b1c5f4
Show file tree
Hide file tree
Showing 24 changed files with 1,102 additions and 103 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: "~1.17"
go-version: 1.19.x

# Run lint
- name: Lint
run: go vet ./...
- name: Staticcheck
uses: dominikh/staticcheck-action@v1
with:
install-go: false

# Run tests
- name: Tests
Expand Down
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Froggit-Go

Froggit-Go is a Go library, allowing to perform actions on VCS providers.
Currently supported providers are: [GitHub](#github), [Bitbucket Server](#bitbucket-server), [Bitbucket Cloud](#bitbucket-cloud), and [GitLab](#gitlab).
Currently supported providers are: [GitHub](#github), [Bitbucket Server](#bitbucket-server)
, [Bitbucket Cloud](#bitbucket-cloud), [Azure Repos](#azure-repos) and [GitLab](#gitlab).

## Project status

Expand All @@ -18,6 +19,7 @@ Currently supported providers are: [GitHub](#github), [Bitbucket Server](#bitbuc
- [GitLab](#gitlab)
- [Bitbucket Server](#bitbucket-server)
- [Bitbucket Cloud](#bitbucket-cloud)
- [Azure Repos](#azure-repos)
- [Test Connection](#test-connection)
- [List Repositories](#list-repositories)
- [List Branches](#list-branches)
Expand Down Expand Up @@ -115,6 +117,25 @@ logger := log.Default()
client, err := vcsclient.NewClientBuilder(vcsProvider).ApiEndpoint(apiEndpoint).Username(username).Token(token).Build()
```

##### Azure Repos

Azure DevOps api version v6 is used.

```go
// The VCS provider. Cannot be changed.
vcsProvider := vcsutils.AzureRepos
// API endpoint to Azure Repos. Set the organization.
apiEndpoint := "https://dev.azure.com/<organization>"
// Personal Access Token to Azure DevOps
token := "secret-azure-devops-token"
// Logger
logger := log.Default()
// Project name
project := "name-of-the-relevant-project"

client, err := vcsclient.NewClientBuilder(vcsProvider).ApiEndpoint(apiEndpoint).Token(token).Project(project).Build()
```

#### Test Connection

```go
Expand Down
9 changes: 6 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
module github.com/jfrog/froggit-go

go 1.17
go 1.19

require (
github.com/gfleury/go-bitbucket-v1 v0.0.0-20220418082332-711d7d5e805f
github.com/google/go-github/v45 v45.2.0
github.com/google/uuid v1.3.0
github.com/grokify/mogo v0.40.4
github.com/ktrysmt/go-bitbucket v0.9.32
github.com/microsoft/azure-devops-go-api/azuredevops v1.0.0-b5
github.com/mitchellh/mapstructure v1.4.3
github.com/stretchr/testify v1.7.0
github.com/xanzy/go-gitlab v0.52.2
Expand All @@ -20,11 +21,13 @@ require (
github.com/google/go-querystring v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.1 // indirect
github.com/hashicorp/go-retryablehttp v0.6.8 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/crypto v0.0.0-20220817201139-bc19a97f63c8 // indirect
golang.org/x/net v0.0.0-20220812174116-3211cb980234 // indirect
golang.org/x/net v0.0.0-20220906165146-f3363e06e74c // indirect
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
81 changes: 14 additions & 67 deletions go.sum

Large diffs are not rendered by default.

0 comments on commit 4b1c5f4

Please sign in to comment.