Skip to content

Commit

Permalink
Output git commit id when running
Browse files Browse the repository at this point in the history
  • Loading branch information
avillar committed Apr 9, 2024
1 parent 7bc28ab commit f497d50
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ jobs:
- name: Add git environment variables
id: env-variables
run: |
echo "BBP_GIT_INFO=\"$(git rev-parse HEAD) $(date --iso-8601=seconds)\"" >> "$GITHUB_OUTPUT"
echo "BBP_GIT_INFO=\"$(git rev-parse HEAD) $(date --iso-8601=seconds)\"" >> "$GITHUB_OUTPUT"
git rev-parse HEAD > ogc/na/_VERSION
- name: Log in to the Container registry
if: github.event_name != 'pull_request'
Expand Down
9 changes: 8 additions & 1 deletion ogc/bblocks/entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

templates_dir = Path(__file__).parent / 'templates'
uplift_context_file = Path(__file__).parent / 'register-context.yaml'
version_file = Path(__file__).parent / '_VERSION'

if __name__ == '__main__':

Expand Down Expand Up @@ -123,7 +124,13 @@
deploy_viewer = args.deploy_viewer in ('true', 'on', 'yes', '1')
bb_config_file = Path(args.config_file) if args.config_file else None

print(f"""Running with the following configuration:
if version_file.is_file():
with open(version_file) as f:
version = f.readline().strip() + ' '
else:
version = ''

print(f"""Running {version}with the following configuration:
- register_file: {args.register_file}
- items_dir: {args.items_dir}
- generated_docs_path: {args.generated_docs_path}
Expand Down

0 comments on commit f497d50

Please sign in to comment.