|
12 | 12 | import os |
13 | 13 | import argparse |
14 | 14 | import base64 |
| 15 | +from pathlib import Path |
15 | 16 | import logging |
16 | 17 | import shutil |
17 | 18 | from hashlib import sha256 |
@@ -50,7 +51,7 @@ def upload_pkg_to_r2(self, filename, upload_file_path): |
50 | 51 | config=config, |
51 | 52 | ) |
52 | 53 |
|
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}...") |
54 | 55 | try: |
55 | 56 | r2.upload_file(filename, self.bucket_name, upload_file_path) |
56 | 57 | except ClientError as e: |
@@ -80,7 +81,7 @@ def create_distribution_conf(self, |
80 | 81 | components, |
81 | 82 | description, |
82 | 83 | gpg_key_id ): |
83 | | - with open(file_path, "w") as distributions_file: |
| 84 | + with open(file_path, "w+") as distributions_file: |
84 | 85 | for release in releases: |
85 | 86 | distributions_file.write(f"Origin: {origin}\n") |
86 | 87 | distributions_file.write(f"Label: {label}\n") |
@@ -219,6 +220,7 @@ def upload_from_directories(pkg_uploader, directory, release, binary): |
219 | 220 | def create_deb_packaging(pkg_creator, pkg_uploader, releases, gpg_key_id, binary_name, archs, package_component, release_version): |
220 | 221 | # set configuration for package creation. |
221 | 222 | print(f"initialising configuration for {binary_name} , {archs}") |
| 223 | + Path("./conf").mkdir(parents=True, exist_ok=True) |
222 | 224 | pkg_creator.create_distribution_conf( |
223 | 225 | "./conf/distributions", |
224 | 226 | binary_name, |
@@ -262,7 +264,7 @@ def parse_args(): |
262 | 264 | ) |
263 | 265 |
|
264 | 266 | 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" |
266 | 268 | ) |
267 | 269 | parser.add_argument( |
268 | 270 | "--id", default=os.environ.get("R2_CLIENT_ID"), help="R2 Client ID" |
|
0 commit comments