From 43584e10890f2b85c2ef15c5fe55f027e2fd6669 Mon Sep 17 00:00:00 2001 From: Rui Lopes Date: Mon, 9 Dec 2024 08:40:17 +0000 Subject: [PATCH] use the nexus api to create the apt-hosted apt repository --- README.md | 1 + provision/provision-nexus.sh | 28 +++++++++++++++++++ .../src/main/groovy/provision.groovy | 5 ---- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 51904c2..3a3f921 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ This will: * Configure Nexus through the API. * Create the `adhoc-package` repository. + * Create the `apt-hosted` repository. * Configure the NuGet `nuget-hosted` repository to accept pushing with an API key. * Configure Nexus through Groovy scripts. * Create the `npm-group`, `npm-hosted` and `npmjs.org-proxy` repositories. diff --git a/provision/provision-nexus.sh b/provision/provision-nexus.sh index 02dce78..4a3d8e3 100644 --- a/provision/provision-nexus.sh +++ b/provision/provision-nexus.sh @@ -191,6 +191,34 @@ http \ EOF +# create the apt-hosted apt repository. +# see https://help.sonatype.com/repomanager3/formats/apt-repositories +http \ + --check-status \ + --auth "$api_auth" \ + POST \ + https://$nexus_domain/service/rest/v1/repositories/apt/hosted \ + <