TUN-6304: Fixed some file permission issues
This commit is contained in:
parent
ec509e114a
commit
a2a4b06eb4
|
@ -12,6 +12,7 @@ from subprocess import Popen, PIPE
|
||||||
import os
|
import os
|
||||||
import argparse
|
import argparse
|
||||||
import base64
|
import base64
|
||||||
|
from pathlib import Path
|
||||||
import logging
|
import logging
|
||||||
import shutil
|
import shutil
|
||||||
from hashlib import sha256
|
from hashlib import sha256
|
||||||
|
@ -50,7 +51,7 @@ class PkgUploader:
|
||||||
config=config,
|
config=config,
|
||||||
)
|
)
|
||||||
|
|
||||||
print(f"uploading asset: {filename} to {upload_file_path}...")
|
print(f"uploading asset: {filename} to {upload_file_path} in bucket{self.bucket_name}...")
|
||||||
try:
|
try:
|
||||||
r2.upload_file(filename, self.bucket_name, upload_file_path)
|
r2.upload_file(filename, self.bucket_name, upload_file_path)
|
||||||
except ClientError as e:
|
except ClientError as e:
|
||||||
|
@ -80,7 +81,7 @@ class PkgCreator:
|
||||||
components,
|
components,
|
||||||
description,
|
description,
|
||||||
gpg_key_id ):
|
gpg_key_id ):
|
||||||
with open(file_path, "w") as distributions_file:
|
with open(file_path, "w+") as distributions_file:
|
||||||
for release in releases:
|
for release in releases:
|
||||||
distributions_file.write(f"Origin: {origin}\n")
|
distributions_file.write(f"Origin: {origin}\n")
|
||||||
distributions_file.write(f"Label: {label}\n")
|
distributions_file.write(f"Label: {label}\n")
|
||||||
|
@ -219,6 +220,7 @@ def upload_from_directories(pkg_uploader, directory, release, binary):
|
||||||
def create_deb_packaging(pkg_creator, pkg_uploader, releases, gpg_key_id, binary_name, archs, package_component, release_version):
|
def create_deb_packaging(pkg_creator, pkg_uploader, releases, gpg_key_id, binary_name, archs, package_component, release_version):
|
||||||
# set configuration for package creation.
|
# set configuration for package creation.
|
||||||
print(f"initialising configuration for {binary_name} , {archs}")
|
print(f"initialising configuration for {binary_name} , {archs}")
|
||||||
|
Path("./conf").mkdir(parents=True, exist_ok=True)
|
||||||
pkg_creator.create_distribution_conf(
|
pkg_creator.create_distribution_conf(
|
||||||
"./conf/distributions",
|
"./conf/distributions",
|
||||||
binary_name,
|
binary_name,
|
||||||
|
@ -262,7 +264,7 @@ def parse_args():
|
||||||
)
|
)
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--bucket", default=os.environ.get("R2_BUCKET_NAME"), help="R2 Bucket name"
|
"--bucket", default=os.environ.get("R2_BUCKET"), help="R2 Bucket name"
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--id", default=os.environ.get("R2_CLIENT_ID"), help="R2 Client ID"
|
"--id", default=os.environ.get("R2_CLIENT_ID"), help="R2 Client ID"
|
||||||
|
|
Loading…
Reference in New Issue