define upload_package
This commit is contained in:
@@ -26,6 +26,24 @@ def download_all_package():
|
||||
packages_urls = get_all_urls_packages()
|
||||
for package_url in packages_urls:
|
||||
download_npm_package(package_url, "npm-packages")
|
||||
|
||||
def upload_package(nexus_host, repository, package_file):
|
||||
if nexus_host[-1] != "/":
|
||||
nexus_host += "/"
|
||||
res = requests.post(
|
||||
nexus_host + "service/rest/v1/components?repository=" + repository,
|
||||
headers={
|
||||
"accept": "application/json",
|
||||
"Content-Type": "multipart/form-data"
|
||||
},
|
||||
files={
|
||||
"npm.asset": open(package_file, "rb")
|
||||
})
|
||||
return res
|
||||
|
||||
|
||||
def publish_all_packages():
|
||||
pass
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
Reference in New Issue
Block a user