Skip to content

Commit

Permalink
Merge pull request #239 from 030/238-upload-additional-formats
Browse files Browse the repository at this point in the history
[GH-238] Allow actions in conjunction with rproxy.
  • Loading branch information
030 authored Jan 10, 2022
2 parents 789b072 + 989df5e commit 425258e
Show file tree
Hide file tree
Showing 27 changed files with 765 additions and 455 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
---
name: Go
on:
push:
branches: [master]
pull_request:
branches: [master]
on: [push]
jobs:
build:
runs-on: ${{ matrix.os }}
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
---
name: Integration
on:
push:
branches: [master]
pull_request:
branches: [master]
on: [push]
jobs:
build:
runs-on: ${{ matrix.os }}
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

Please run the following tests before creating a Pull Request:

```
```bash
go test ./... -cover
```

and

```
```bash
./integration-tests.sh
```
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.17.5-alpine3.15 as builder
FROM golang:1.17.6-alpine3.15 as builder
ENV USERNAME n3dr
RUN adduser -D -g '' $USERNAME
COPY . /go/${USERNAME}/
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ n3dr config \
### Build

```bash
docker build -t utrecht/n3dr:6.4.2 .
docker build -t utrecht/n3dr:6.4.3 .
```

[![dockeri.co](https://dockeri.co/image/utrecht/n3dr)](https://hub.docker.com/r/utrecht/n3dr)
Expand All @@ -324,7 +324,7 @@ docker build -t utrecht/n3dr:6.4.2 .
```bash
docker run -it \
-v /home/${USER}/.n3dr:/root/.n3dr \
-v /tmp/n3dr:/tmp/n3dr utrecht/n3dr:6.4.2
-v /tmp/n3dr:/tmp/n3dr utrecht/n3dr:6.4.3
```

### Upload
Expand All @@ -333,7 +333,7 @@ docker run -it \
docker run -it \
--entrypoint=/bin/ash \
-v /home/${USER}/.n3dr:/root/.n3dr \
-v /tmp/n3dr:/tmp/n3dr utrecht/n3dr:6.4.2
-v /tmp/n3dr:/tmp/n3dr utrecht/n3dr:6.4.3
```

navigate to the repository folder, e.g. `/tmp/n3dr/download*/` and upload:
Expand Down Expand Up @@ -528,9 +528,12 @@ a single command.
| apt | x | x | `^` |
| bower | | | |
| cocoapods | | | |
| composer | | | |
| conan | | | |
| conda | | | |
| cpan | | | |
| docker | | | |
| elpa | | | |
| gitlfs | | | |
| go | | | |
| helm | | | |
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: core20
version: 6.4.2
version: 6.4.3
summary: Nexus3 Disaster Recovery
description: |
Download all artifacts at once or migrate automatically from Nexus to Nexus.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion cmd/n3dr/repositoriesV2.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ download artifacts from all repositories`,
}
log.Fatal("One of the required flags \"names\", \"count\" or \"backup\" not set")
}
n := connection.Nexus3{FQDN: n3drURL, Pass: n3drPass, User: n3drUser, DownloadDirName: downloadDirName, HTTPS: https}
n := connection.Nexus3{BasePathPrefix: basePathPrefix, FQDN: n3drURL, Pass: n3drPass, User: n3drUser, DownloadDirName: downloadDirName, HTTPS: https}
a := artifactsv2.Nexus3{Nexus3: &n}
if namesV2 {
if err := a.RepositoryNamesV2(); err != nil {
Expand Down
10 changes: 6 additions & 4 deletions cmd/n3dr/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,21 @@ import (
"os"
"path/filepath"

"github.com/spf13/cobra"
"github.com/spf13/viper"

cli "github.com/030/n3dr/internal/artifacts"
homedir "github.com/mitchellh/go-homedir"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
jww "github.com/spf13/jwalterweatherman"
"github.com/spf13/viper"
)

//go:embed assets/logo/text-image-com-n3dr.txt
var logo string

var (
apiVersion, cfgFile, n3drRepo, n3drURL, n3drPass, n3drUser, Version, zipName, downloadDirName, downloadDirNameZip string
anonymous, debug, https, insecureSkipVerify, skipErrors, zip bool
apiVersion, basePathPrefix, cfgFile, n3drRepo, n3drURL, n3drPass, n3drUser, Version, zipName, downloadDirName, downloadDirNameZip string
anonymous, debug, https, insecureSkipVerify, skipErrors, zip bool
)

var rootCmd = &cobra.Command{
Expand Down Expand Up @@ -58,6 +59,7 @@ func init() {
rootCmd.PersistentFlags().BoolVar(&anonymous, "anonymous", false, "Skip authentication")
rootCmd.PersistentFlags().BoolVarP(&skipErrors, "skipErrors", "s", false, "Skip errors")
rootCmd.PersistentFlags().BoolVarP(&https, "https", "", true, "https true or false")
rootCmd.PersistentFlags().StringVarP(&basePathPrefix, "basePathPrefix", "", "", "the nexus basePathPrefix. Default: \"\"")
}

func n3drHiddenHome() (string, error) {
Expand Down
23 changes: 22 additions & 1 deletion CHANGELOG.md → docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [6.4.3] - 2021-01-10

### Added

- docs folder.
- examples.

### Changed

- libraries updated.
- moved CHANGELOG to docs folder.

### Fixed

- unable to use repositoriesV2 in conjunction with different Nexus3 basePath.

### Removed

- integration tests from unit testing.

## [6.4.2] - 2021-01-03

### Fixed
Expand Down Expand Up @@ -612,7 +632,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.4.2...HEAD
[Unreleased]: https://github.com/030/n3dr/compare/6.4.3...HEAD
[6.4.3]: https://github.com/030/n3dr/compare/6.4.2...6.4.3
[6.4.2]: https://github.com/030/n3dr/compare/6.4.1...6.4.2
[6.4.1]: https://github.com/030/n3dr/compare/6.4.0...6.4.1
[6.4.0]: https://github.com/030/n3dr/compare/6.3.0...6.4.0
Expand Down
3 changes: 3 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# docs

* [examples](./../examples)
6 changes: 6 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Examples

## repositoriesV2

Use the [basePathPrefix](./repositoriesV2/BASE_PATH_PREFIX.md) subcommand if Nexus3 is running
behind a proxy.
11 changes: 11 additions & 0 deletions examples/repositoriesV2/BASE_PATH_PREFIX.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# basePathPrefix

```bash
n3dr repositoriesV2 \
--count \
-p some-pass \
-n localhost:9990 \
-u admin \
--https=false \
--basePathPrefix=alternativeBasePathNexus3
```
77 changes: 36 additions & 41 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,78 +4,73 @@ go 1.17

require (
github.com/030/go-multipart v1.0.2
github.com/030/mij v0.12.1
github.com/PuerkitoBio/goquery v1.6.1
github.com/andybalholm/cascadia v1.2.0
github.com/PuerkitoBio/goquery v1.8.0
github.com/andybalholm/cascadia v1.3.1
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d
github.com/dsnet/compress v0.0.1 // indirect
github.com/frankban/quicktest v1.11.3 // indirect
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/go-playground/validator/v10 v10.4.1
github.com/golang/snappy v0.0.3 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-retryablehttp v0.6.8
github.com/leodido/go-urn v1.2.1 // indirect
github.com/go-openapi/errors v0.20.1
github.com/go-openapi/runtime v0.21.0
github.com/go-openapi/strfmt v0.21.1
github.com/go-openapi/swag v0.19.15
github.com/go-openapi/validate v0.20.3
github.com/go-playground/validator/v10 v10.10.0
github.com/hashicorp/go-retryablehttp v0.7.0
github.com/levigross/grequests v0.0.0-20190908174114-253788527a1a
github.com/magiconair/properties v1.8.5 // indirect
github.com/mholt/archiver v3.1.1+incompatible
github.com/mitchellh/go-homedir v1.1.0
github.com/mitchellh/mapstructure v1.4.1 // indirect
github.com/nwaples/rardecode v1.1.0 // indirect
github.com/oracle/oci-go-sdk v24.3.0+incompatible
github.com/pelletier/go-toml v1.8.1 // indirect
github.com/pierrec/lz4 v2.6.0+incompatible // indirect
github.com/sirupsen/logrus v1.8.1
github.com/spf13/afero v1.6.0 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/cobra v1.1.3
github.com/spf13/cobra v1.3.0
github.com/spf13/jwalterweatherman v1.1.0
github.com/spf13/viper v1.7.1
github.com/spf13/viper v1.10.1
github.com/stretchr/testify v1.7.0
github.com/svenfuchs/jq v0.0.0-20180603193138-b038733a5990
github.com/thedevsaddam/gojsonq v2.3.0+incompatible
github.com/ulikunitz/xz v0.5.10 // indirect
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 // indirect
golang.org/x/net v0.0.0-20210421230115-4e50805a0758
golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe // indirect
golang.org/x/text v0.3.7 // indirect
gopkg.in/ini.v1 v1.62.0 // indirect
golang.org/x/net v0.0.0-20220107192237-5cfca573fb4d
gopkg.in/validator.v2 v2.0.0-20210331031555-b37d688a7fb0
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)

require (
github.com/go-openapi/errors v0.20.1
github.com/go-openapi/runtime v0.21.0
github.com/go-openapi/strfmt v0.21.0
github.com/go-openapi/swag v0.19.15
github.com/go-openapi/validate v0.20.3
)

require (
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dsnet/compress v0.0.1 // indirect
github.com/frankban/quicktest v1.14.0 // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/go-openapi/analysis v0.20.1 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.6 // indirect
github.com/go-openapi/loads v0.21.0 // indirect
github.com/go-openapi/spec v0.20.4 // indirect
github.com/go-playground/locales v0.13.0 // indirect
github.com/go-playground/universal-translator v0.17.0 // indirect
github.com/go-playground/locales v0.14.0 // indirect
github.com/go-playground/universal-translator v0.18.0 // indirect
github.com/go-stack/stack v1.8.0 // indirect
github.com/google/go-cmp v0.5.4 // indirect
github.com/golang/snappy v0.0.3 // indirect
github.com/google/go-querystring v1.0.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
github.com/magiconair/properties v1.8.5 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
github.com/mitchellh/mapstructure v1.4.3 // indirect
github.com/nwaples/rardecode v1.1.2 // indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pelletier/go-toml v1.9.4 // indirect
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/spf13/afero v1.6.0 // indirect
github.com/spf13/cast v1.4.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
go.mongodb.org/mongo-driver v1.7.3 // indirect
github.com/ulikunitz/xz v0.5.10 // indirect
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
go.mongodb.org/mongo-driver v1.7.5 // indirect
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect
golang.org/x/sys v0.0.0-20211210111614-af8b64212486 // indirect
golang.org/x/text v0.3.7 // indirect
gopkg.in/ini.v1 v1.66.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)
Loading

0 comments on commit 425258e

Please sign in to comment.