-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
522 changed files
with
24,898 additions
and
1,644 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# Maven2 | ||
|
||
- [Download N3DR](./snippets/n3dr/DOWNLOAD.md). | ||
- [Start a Nexus3 server](./snippets/nexus3/SERVER.md). | ||
- Create a `some-maven2` repository: | ||
|
||
```bash | ||
./n3dr configRepository \ | ||
-u admin \ | ||
-p $(docker exec -it nexus3-n3dr-src cat /nexus-data/admin.password) \ | ||
-n localhost:8081 \ | ||
--https=false \ | ||
--configRepoName some-maven2 \ | ||
--configRepoType maven2 | ||
``` | ||
|
||
- Populate it with artifacts: | ||
|
||
```bash | ||
downloadDir=/tmp/some-dir/some-maven2 && \ | ||
mkdir -p ${downloadDir} && \ | ||
for i in $(seq 20); do | ||
path=${downloadDir}/some/group/1.0.0/1.0.0-${i} | ||
file="Some_Package-1.0.0-${i}" | ||
filePath="${path}/${file}" | ||
mkdir -p ${path} | ||
echo -e "<project>\n<modelVersion>4.0.0</modelVersion>\n<groupId>some.group</groupId>\n<artifactId>Some_Package</artifactId>\n<version>1.0.0-${i}</version>\n</project>" > ${filePath}.pom | ||
dd if=/dev/urandom of=${filePath} bs=1M count=${i} | ||
|
||
zip ${filePath}.zip ${filePath} | ||
# jar cvf ${filePath}.jar ${filePath} | ||
cp ${filePath} ${filePath}.jar | ||
cp ${filePath} ${filePath}-javadoc.jar | ||
cp ${filePath} ${filePath}-sources.jar | ||
cp ${filePath} ${filePath}.war | ||
echo hello > ${filePath}.module | ||
ls ${filePath}* | ||
|
||
curl -X 'POST' \ | ||
localhost:8081/service/rest/v1/components?repository=some-maven2 \ | ||
-v \ | ||
-f \ | ||
-u "admin:$(docker exec -it nexus3-n3dr-src cat /nexus-data/admin.password)" \ | ||
-H 'accept: application/json' \ | ||
-H 'Content-Type: multipart/form-data' \ | ||
-F "maven2.asset1=@${filePath}.pom" \ | ||
-F "maven2.asset1.extension=pom" \ | ||
-F "maven2.asset2=@${filePath}.jar;type=application/x-java-archive" \ | ||
-F "maven2.asset2.extension=jar" \ | ||
-F "maven2.asset3=@${filePath}.war;type=application/x-java-archive" \ | ||
-F "maven2.asset3.extension=war" \ | ||
-F "maven2.asset4=@${filePath}.zip" \ | ||
-F "maven2.asset4.extension=zip" \ | ||
-F "maven2.asset5=@${filePath}.module" \ | ||
-F "maven2.asset5.extension=module" \ | ||
-F "maven2.asset6=@${filePath}-javadoc.jar;type=application/x-java-archive" \ | ||
-F "maven2.asset6.classifier=javadoc" \ | ||
-F "maven2.asset6.extension=jar" \ | ||
-F "maven2.asset7=@${filePath}-sources.jar;type=application/x-java-archive" \ | ||
-F "maven2.asset7.classifier=sources" \ | ||
-F "maven2.asset7.extension=jar" | ||
done | ||
``` | ||
|
||
- [Backup all artifacts](./snippets/n3dr/BACKUP.md). | ||
- [Start another Nexus3 server](./snippets/nexus3/ANOTHERSERVER.md). | ||
- Create a repository in the other Nexus3 server: | ||
|
||
```bash | ||
./n3dr configRepository \ | ||
-u admin \ | ||
-p $(docker exec -it nexus3-n3dr-dest cat /nexus-data/admin.password) \ | ||
-n localhost:9000 \ | ||
--https=false \ | ||
--configRepoName some-maven2 \ | ||
--configRepoType maven2 | ||
``` | ||
|
||
- [Upload the artifacts to the other Nexus3 server](./snippets/n3dr/UPLOAD.md). | ||
- [Validate](./snippets/n3dr/VALIDATE.md). | ||
- [Cleanup](./snippets/nexus3/CLEANUP.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
# Validate | ||
|
||
```bash | ||
dir=/tmp/some-dir-validate | ||
mkdir -p "${dir}" | ||
./n3dr count \ | ||
-u admin \ | ||
-p $(docker exec -it nexus3-n3dr-src cat /nexus-data/admin.password) \ | ||
-n localhost:8081 \ | ||
--https=false \ | ||
--csv /tmp/some-dir/nexus3-n3dr-src && \ | ||
--csv ${dir}/nexus3-n3dr-src && \ | ||
./n3dr count \ | ||
-u admin \ | ||
-p $(docker exec -it nexus3-n3dr-dest cat /nexus-data/admin.password) \ | ||
-n localhost:9000 \ | ||
--https=false \ | ||
--csv /tmp/some-dir/nexus3-n3dr-dest && \ | ||
--csv ${dir}/nexus3-n3dr-dest && \ | ||
echo "Comparing Nexus3 src content:" | ||
cat /tmp/some-dir/nexus3-n3dr-src.csv | sed -e 1d | cut -d "," -f9- | sha256sum && \ | ||
cat ${dir}/nexus3-n3dr-src.csv | sed -e 1d | cut -d "," -f9- | sha256sum && \ | ||
echo "with Nexus3 dest:" | ||
cat /tmp/some-dir/nexus3-n3dr-dest.csv | sed -e 1d | cut -d "," -f9- | sha256sum && \ | ||
cat ${dir}/nexus3-n3dr-dest.csv | sed -e 1d | cut -d "," -f9- | sha256sum && \ | ||
echo "Check whether the sha256sums are identical." | ||
``` |
Oops, something went wrong.