define upload_package
This commit is contained in:
@@ -27,6 +27,24 @@ def download_all_package():
|
|||||||
for package_url in packages_urls:
|
for package_url in packages_urls:
|
||||||
download_npm_package(package_url, "npm-packages")
|
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():
|
def main():
|
||||||
npm_create_package_lock_file(argv[1])
|
npm_create_package_lock_file(argv[1])
|
||||||
|
|||||||
Reference in New Issue
Block a user