test
This commit is contained in:
commit
1a5d369513
22
recursive_the_dirs.py
Normal file
22
recursive_the_dirs.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import os
|
||||
import subprocess
|
||||
|
||||
def list_files_recursively(directory):
|
||||
for root, dirs, files in os.walk(directory):
|
||||
for file in files:
|
||||
print(os.path.join(root, file))
|
||||
upload_file_with_curl(root, file)
|
||||
|
||||
def upload_file_with_curl(file_path, file_name):
|
||||
print(file_path)
|
||||
os.chdir(file_path)
|
||||
out = subprocess.run(f'curl -u "a.pivkin:qweqwe" -H "Content-Type: multipart/form-data" --data-binary "@./{file_name}" "https://nexus.test.repo.int.nt-com.ru/repository/apt-norsi/"', cwd=file_path, shell=True)
|
||||
|
||||
# Call the function to upload the file
|
||||
|
||||
# Specify the directory you want to start listing files from
|
||||
directory_path = "/opt/norsi/mirror/nexus.test.repo.int.nt-com.ru/repository/apt-norsi-test/pool/"
|
||||
|
||||
# Call the function to list files recursively
|
||||
list_files_recursively(directory_path)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user