Skip to content

Commit

Permalink
Updates from PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahflroiter committed Jul 9, 2024
1 parent 4afdced commit 5c448cf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ The Python `promote_solution.py` script calls Instabase APIs and can execute the

#### Solution builder projects: promote_sb_solution.py

##### **NOTE: Solution builder projects supported from 23.07**

- `--compile_source_solution`
- Compiles solution in source environment in path specified in `SOURCE_SOLUTION_DIR` environment variable.
- `--deploy_source_solution`
Expand Down
16 changes: 9 additions & 7 deletions ib_cicd/promote_sb_solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,12 @@ def get_sb_flow_path(solution_builder_name, flow_name, ib_root, ib_host, ib_toke
).content
metadata = json.loads(read_response)
if metadata["name"] == flow_name:
version = list_directory(ib_host, os.path.join(path, "versions"), ib_token)[
0
]
return version
# version = list_directory(ib_host, os.path.join(path, "versions"), ib_token)[
# 0
# ]
flow_version = metadata["versions_tree"]["version_id"]
flow_path = os.path.join(path, "versions", flow_version)
return flow_path


def parse_dependencies_from_env(dependencies):
Expand All @@ -101,19 +103,19 @@ def parse_dependencies_from_env(dependencies):
}


def upload_icon(ib_host, ib_token, path, icon_path="icon.png"):
def upload_icon(ib_host, ib_token, upload_path, icon_path="icon.png"):
"""
Uploads a local png file to the IB filesystem
:param ib_host: (string) IB host URL (e.g. https://platform.instabase.com/)
:param ib_token: (string) API token for IB environment
:param path: (string) IB path to upload icon
:param upload_path: (string) IB path to upload icon
:param icon_path: (string) optional local path to read icon
:return: Response object return from upload request
"""
with open(icon_path, "rb") as image:
f = image.read()
b = bytearray(f)
resp = upload_file(ib_host, ib_token, path, b)
resp = upload_file(ib_host, ib_token, upload_path, b)
return resp


Expand Down

0 comments on commit 5c448cf

Please sign in to comment.