Skip to content

Commit

Permalink
fix: updates Dockerfile entrypoint to show log output
Browse files Browse the repository at this point in the history
Signed-off-by: Jennifer Power <[email protected]>
  • Loading branch information
jpower432 committed Jun 28, 2023
1 parent 1c13255 commit 0cbdcce
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,5 @@ COPY ./entrypoint.sh /

RUN chmod +x /entrypoint.sh

ENTRYPOINT ["python3.8 -m trestlebot"]
ENTRYPOINT ["python3.8", "-m" , "trestlebot"]

8 changes: 6 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -eu

commit=$(python3.8 -m trestlebot \
output=$(python3.8 -m trestlebot \
--markdown-path="${INPUT_MARKDOWN_PATH}" \
--assemble-model="${INPUT_ASSEMBLE_MODEL}" \
--ssp-index-path="${INPUT_SSP_INDEX_PATH}" \
Expand All @@ -13,7 +13,11 @@ commit=$(python3.8 -m trestlebot \
--committer-email="${INPUT_COMMIT_USER_EMAIL}" \
--author-name="${INPUT_COMMIT_AUTHOR_NAME}" \
--author-email="${INPUT_COMMIT_AUTHOR_EMAIL}" \
--working-dir="${INPUT_WORKING_DIR}")
--working-dir="${INPUT_WORKING_DIR}" 2>&1 | tee log.txt)

cat log.txt

commit=$(echo "$output" | grep "Commit Hash:" | sed 's/.*: //')

if [ -n "$commit" ]; then
echo "changes=true" >> "$GITHUB_OUTPUT"
Expand Down
2 changes: 1 addition & 1 deletion trestlebot/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def run() -> None:
)

# Print the full commit sha
print(commit_sha)
print(f' Commit Hash: {commit_sha}')

except Exception as e:
exit_code = handle_exception(e)
Expand Down

0 comments on commit 0cbdcce

Please sign in to comment.