Skip to content

Commit

Permalink
Add comment bot to report Docker image package versions (#290)
Browse files Browse the repository at this point in the history
* Add comment bot to report Docker image package versions

* Update integration-test.yml
  • Loading branch information
robbibt authored Jul 30, 2024
1 parent 2953bd0 commit 225789f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
26 changes: 26 additions & 0 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ on:
permissions:
id-token: write
contents: read
pull-requests: write # Required for Sandbox image packages comment bot

jobs:
integration-test:
Expand Down Expand Up @@ -56,6 +57,31 @@ jobs:
cd ./dea-sandbox/integration-testing
CURRENT_UID=1000:100 docker-compose up -d
- name: Extract package versions
run: |
cd ./dea-sandbox/integration-testing
docker-compose exec -T sandbox cat /tmp/requirements.txt > requirements.txt
- name: Read package versions
id: versions
run: |
{
echo 'content<<EOF'
cat ./dea-sandbox/integration-testing/requirements.txt
echo EOF
} >> "$GITHUB_OUTPUT"
# Post package versions as a comment on the PR
- name: Post package versions as a comment
uses: mshick/add-pr-comment@v2
if: github.event_name == 'pull_request'
with:
message: |
### Installed packages:
```
${{ steps.versions.outputs.content }}
```
- name: Set up Datacube and Test
run: |
cd ./dea-sandbox/integration-testing
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ RUN echo "Enable server extensions" \
COPY assets/sync_repo assets/jupyterhub-singleuser /usr/local/bin/
COPY assets/overrides.json /env/share/jupyter/lab/settings/

RUN pip list --format=freeze
RUN pip list --format=freeze > /tmp/requirements.txt

WORKDIR "/home/$nb_user"
ENTRYPOINT ["/env/bin/tini", "--"]
Expand Down

0 comments on commit 225789f

Please sign in to comment.