Skip to content

Commit

Permalink
enable overridding of API URLs for each provider.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonhadfield committed Aug 18, 2022
1 parent 2c7f591 commit dc0a38b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 21 deletions.
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ go 1.18

require (
github.com/carlescere/scheduler v0.0.0-20170109141437-ee74d2f83d82
github.com/jonhadfield/githosts-utils v0.0.0-20220603104908-267d2d213256
github.com/jonhadfield/githosts-utils v0.0.0-20220818193144-0075915532b7
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.7.1
github.com/stretchr/testify v1.8.0
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/stretchr/objx v0.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

Expand Down
22 changes: 7 additions & 15 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,33 +1,25 @@
github.com/carlescere/scheduler v0.0.0-20170109141437-ee74d2f83d82 h1:9bAydALqAjBfPHd/eAiJBHnMZUYov8m2PkXVr+YGQeI=
github.com/carlescere/scheduler v0.0.0-20170109141437-ee74d2f83d82/go.mod h1:tyA14J0sA3Hph4dt+AfCjPrYR13+vVodshQSM7km9qw=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/jonhadfield/githosts-utils v0.0.0-20220313174609-54b364027c38 h1:9sB3pIS4JXOMY18BAmSBL+etUqXOo9PQa2F3SyMNho0=
github.com/jonhadfield/githosts-utils v0.0.0-20220313174609-54b364027c38/go.mod h1:PpF4g6DGFG4Fah8yeiPKLCo4qeFibKgYFAVTVkOy5iA=
github.com/jonhadfield/githosts-utils v0.0.0-20220603104908-267d2d213256 h1:Mw0089XidUaApLb9tp12gbXPZvqUiDGv7AGSJonOIfg=
github.com/jonhadfield/githosts-utils v0.0.0-20220603104908-267d2d213256/go.mod h1:kxbrB/486Q9V4m0uKzrp2bP4O6u3YO5FZCGwk95au5o=
github.com/jonhadfield/githosts-utils v0.0.0-20220818193144-0075915532b7 h1:4p8CKbpH6C/VVN2/Kqh6Fs2EQiNo7Wta7caSS5a1wo8=
github.com/jonhadfield/githosts-utils v0.0.0-20220818193144-0075915532b7/go.mod h1:v6wgdz/EhWvXy67qhMgXeCuiwAMfUt86nx3xGZQ5Yj8=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func execProviderBackups() {
if os.Getenv("BITBUCKET_USER") != "" {
logger.Println("backing up BitBucket repos")

err = githosts.Backup("bitbucket", backupDIR)
err = githosts.Backup("bitbucket", backupDIR, os.Getenv("BITBUCKET_APIURL"))
if err != nil {
logger.Fatal(err)
}
Expand All @@ -220,7 +220,7 @@ func execProviderBackups() {
if os.Getenv("GITLAB_TOKEN") != "" {
logger.Println("backing up GitLab repos")

err = githosts.Backup("gitlab", backupDIR)
err = githosts.Backup("gitlab", backupDIR, os.Getenv("GITLAB_APIURL"))
if err != nil {
logger.Fatal(err)
}
Expand All @@ -229,7 +229,7 @@ func execProviderBackups() {
if os.Getenv("GITHUB_TOKEN") != "" {
logger.Println("backing up GitHub repos")

err = githosts.Backup("github", backupDIR)
err = githosts.Backup("github", backupDIR, os.Getenv("GITHUB_APIURL"))
if err != nil {
logger.Fatal(err)
}
Expand Down

0 comments on commit dc0a38b

Please sign in to comment.