Skip to content

Commit

Permalink
Merge branch 'develop' into 'main'
Browse files Browse the repository at this point in the history
Fixed GitHub URL

See merge request cpes/european-projects/enershare/tsg-client!92
  • Loading branch information
itsjrsa committed Dec 4, 2024
1 parent af14f71 commit b8fabb2
Show file tree
Hide file tree
Showing 5 changed files with 318 additions and 68 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ mirror_to_github:
- LAST_COMMIT_MSG=$(git log --format=%B -n 1)
- LAST_COMMIT_NAME=$(git log -1 --pretty=format:'%an')
- LAST_COMMIT_EMAIL=$(git log -1 --pretty=format:'%ae')
- git clone https://oauth2:${GITHUB_TOKEN}@github.com/CPES-Power-and-Energy-Systems/tsg-client.git
- git clone https://oauth2:${GITHUB_TOKEN}@github.com/INESCTEC/tsg-client.git
github
- rm -rf .git
- mv github/.git .git
Expand Down
23 changes: 10 additions & 13 deletions examples/post_artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Example - Publish a new data artifact via your connector
Last update: 2024-01-27
Last update: 2024-11-05
This request publishes a data artifact on a custom connector using a connection to the connector.
It uses a pre-established connection from the examples request to our connector.
Expand Down Expand Up @@ -63,18 +63,15 @@
with open(contract_offer_path, 'r') as file:
contract_offer_content = file.read()

with open(artifact_path, 'r') as file:
artifact_content = file.read()

# Post artifact on our connector:
data_artifact = conn.publish_data_artifact(
artifact=artifact_content,
contract_offer=contract_offer_content,
description=artifact_description,
title=artifact_title,
# catalog_id="resources" # OPTIONAL
)

# Open the artifact file in binary mode:
with open(artifact_path, 'rb') as artifact_file:
data_artifact = conn.publish_data_artifact(
title=artifact_title,
artifact_file=artifact_file,
description=artifact_description,
contract_offer=contract_offer_content
)

print("-" * 79)
print("Data Artifact:")
print(data_artifact)
Loading

0 comments on commit b8fabb2

Please sign in to comment.