create the pypi-hosted repository

This commit is contained in:
Rui Lopes 2023-07-29 12:05:11 +01:00
parent db1a0b8614
commit 9daa7fdb21
1 changed files with 23 additions and 0 deletions

View File

@ -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