Skip to content

Commit a2a4b06

Browse files
TUN-6304: Fixed some file permission issues
1 parent ec509e1 commit a2a4b06

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

release_pkgs.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import os
1313
import argparse
1414
import base64
15+
from pathlib import Path
1516
import logging
1617
import shutil
1718
from hashlib import sha256
@@ -50,7 +51,7 @@ def upload_pkg_to_r2(self, filename, upload_file_path):
5051
config=config,
5152
)
5253

53-
print(f"uploading asset: {filename} to {upload_file_path}...")
54+
print(f"uploading asset: {filename} to {upload_file_path} in bucket{self.bucket_name}...")
5455
try:
5556
r2.upload_file(filename, self.bucket_name, upload_file_path)
5657
except ClientError as e:
@@ -80,7 +81,7 @@ def create_distribution_conf(self,
8081
components,
8182
description,
8283
gpg_key_id ):
83-
with open(file_path, "w") as distributions_file:
84+
with open(file_path, "w+") as distributions_file:
8485
for release in releases:
8586
distributions_file.write(f"Origin: {origin}\n")
8687
distributions_file.write(f"Label: {label}\n")
@@ -219,6 +220,7 @@ def upload_from_directories(pkg_uploader, directory, release, binary):
219220
def create_deb_packaging(pkg_creator, pkg_uploader, releases, gpg_key_id, binary_name, archs, package_component, release_version):
220221
# set configuration for package creation.
221222
print(f"initialising configuration for {binary_name} , {archs}")
223+
Path("./conf").mkdir(parents=True, exist_ok=True)
222224
pkg_creator.create_distribution_conf(
223225
"./conf/distributions",
224226
binary_name,
@@ -262,7 +264,7 @@ def parse_args():
262264
)
263265

264266
parser.add_argument(
265-
"--bucket", default=os.environ.get("R2_BUCKET_NAME"), help="R2 Bucket name"
267+
"--bucket", default=os.environ.get("R2_BUCKET"), help="R2 Bucket name"
266268
)
267269
parser.add_argument(
268270
"--id", default=os.environ.get("R2_CLIENT_ID"), help="R2 Client ID"

0 commit comments

Comments
 (0)