Skip to content

Commit

Permalink
[GH-213] Resolve 'Some repositories were excluded' issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
030 committed May 28, 2021
1 parent 605f95a commit 3506d8f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [6.0.11] - 2021-05-28

### Fixed

- Some repositories were not backed up while using the `repositories` command.

## [6.0.10] - 2021-04-12

### Fixed
Expand Down Expand Up @@ -531,7 +537,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Download all artifacts from a certain Nexus3 repository.

[Unreleased]: https://github.com/030/n3dr/compare/6.0.10...HEAD
[Unreleased]: https://github.com/030/n3dr/compare/6.0.11...HEAD
[6.0.11]: https://github.com/030/n3dr/compare/6.0.10...6.0.11
[6.0.10]: https://github.com/030/n3dr/compare/6.0.9...6.0.10
[6.0.9]: https://github.com/030/n3dr/compare/6.0.8...6.0.9
[6.0.8]: https://github.com/030/n3dr/compare/6.0.7...6.0.8
Expand Down
2 changes: 1 addition & 1 deletion build/package/snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: n3dr
base: core
version: 6.0.10
version: 6.0.11
summary: Nexus3 Disaster Recovery
description: |
Download all artifacts at once or migrate automatically from Nexus to Nexus.
Expand Down
1 change: 1 addition & 0 deletions internal/artifacts/npm.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
)

func (n *Nexus3) BackupAllNPMArtifacts(repository, dir, regex string) error {
log.Infof("Backing up: '%v'", n.Repository)
url := n.URL + "/service/rest/repository/browse/" + repository
npmRepoHTML, err := n.npmURL(url)
if err != nil {
Expand Down
13 changes: 6 additions & 7 deletions internal/artifacts/repositories.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,21 +83,20 @@ func (n *Nexus3) repositoriesChannel(m repositoriesNamesAndFormatsMap, dir, rege
errs := make(chan error)

for name, format := range m {
log.Debugf("Name: '%v'. Format: '%v'", name, format)
n.Repository = name
log.Infof("Name: '%s'. Format: '%s'", n.Repository, format)

go func(dir, format, name string) {
go func(dir, format string, n Nexus3) {
switch format {
case "maven2":
n.Repository = name
log.Debugf("Repository: '%v'", n.Repository)
errs <- n.StoreArtifactsOnDiskChannel(dir, regex)
case "npm":
errs <- n.BackupAllNPMArtifacts(name, dir, regex)
errs <- n.BackupAllNPMArtifacts(n.Repository, dir, regex)
default:
log.Warnf("Nexus repository: '%s', format: '%v' download not supported", name, format)
log.Warnf("Nexus repository: '%s', format: '%v' download not supported", n.Repository, format)
errs <- nil
}
}(dir, format, name)
}(dir, format, *n)
}
for range m {
if err := <-errs; err != nil {
Expand Down

0 comments on commit 3506d8f

Please sign in to comment.