From 9daa7fdb21263e1ebf092c9cc3253ffd19883bd5 Mon Sep 17 00:00:00 2001 From: Rui Lopes Date: Sat, 29 Jul 2023 12:05:11 +0100 Subject: [PATCH] create the pypi-hosted repository --- provision/provision-nexus.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/provision/provision-nexus.sh b/provision/provision-nexus.sh index 95ae648..3169a04 100644 --- a/provision/provision-nexus.sh +++ b/provision/provision-nexus.sh @@ -158,6 +158,29 @@ unset GNUPGHOME # configure nexus with the groovy script. bash /vagrant/provision/execute-provision.groovy-script.sh +# set the api credentials. +api_auth="admin:admin" + +# create the pypi-hosted repository. +http \ + --check-status \ + --auth "$api_auth" \ + POST \ + https://$nexus_domain/service/rest/v1/repositories/pypi/hosted \ + <<'EOF' +{ + "name": "pypi-hosted", + "online": true, + "storage": { + "blobStoreName": "default", + "strictContentTypeValidation": true, + "writePolicy": "allow_once" + }, + "component": { + "proprietaryComponents": true + } +} +EOF # configure nexus ldap with a groovy script. if [ "$config_authentication" = 'ldap' ]; then