Skip to content

Commit 5d0b2ff

Browse files
committed
Moved checksum check for _toolbar.html.erb into test step
1 parent 420b47d commit 5d0b2ff

1 file changed

Lines changed: 10 additions & 33 deletions

File tree

.github/workflows/build.yml

Lines changed: 10 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,42 +9,9 @@ on:
99
env:
1010
BUILD_SUFFIX: -build-${{ github.run_id }}_${{ github.run_attempt }}
1111
DOCKER_METADATA_SET_OUTPUT_ENV: 'true'
12-
ARCHIVESSPACE_RESOURCE_TOOLBAR_SHA256: 2feb4bf50a103574dc541d36dd237b5d49f6e663439dfe23314b89ccf964b83d
1312

1413
jobs:
15-
verify-upstream:
16-
runs-on: ubuntu-24.04
17-
steps:
18-
- name: Checkout code
19-
uses: actions/checkout@v4
20-
21-
- name: Verify upstream resource toolbar checksum
22-
run: |
23-
set -euo pipefail
24-
version="$(sed -n 's/^ARG ARCHIVESSPACE_VERSION="\([^"]*\)"/\1/p' Dockerfile)"
25-
repo_dir="$(mktemp -d)"
26-
trap 'rm -rf "$repo_dir"' EXIT
27-
28-
if [[ -z "$version" ]]; then
29-
echo "Could not determine ARCHIVESSPACE_VERSION from Dockerfile"
30-
exit 1
31-
fi
32-
33-
git init -q "$repo_dir"
34-
git -C "$repo_dir" remote add origin https://github.com/archivesspace/archivesspace.git
35-
git -C "$repo_dir" fetch --depth 1 origin "refs/tags/${version}:refs/tags/${version}"
36-
37-
actual="$(git -C "$repo_dir" show "${version}:frontend/app/views/resources/_toolbar.html.erb" | shasum -a 256 | awk '{print $1}')"
38-
39-
if [[ "$actual" != "$ARCHIVESSPACE_RESOURCE_TOOLBAR_SHA256" ]]; then
40-
echo "Expected checksum: $ARCHIVESSPACE_RESOURCE_TOOLBAR_SHA256"
41-
echo "Actual checksum: $actual"
42-
echo "Upstream file changed for ArchivesSpace ${version}"
43-
exit 1
44-
fi
45-
4614
build:
47-
needs: verify-upstream
4815
runs-on: ${{ matrix.runner }}
4916
outputs:
5017
image-arm64: ${{ steps.gen-output.outputs.image-arm64 }}
@@ -170,6 +137,16 @@ jobs:
170137
docker compose up --wait
171138
docker compose exec -u root app chown archivesspace:archivesspace artifacts
172139
140+
- name: Verify deployed resource toolbar matches upstream
141+
run: |
142+
set -euo pipefail
143+
csum="$(docker compose exec -T app sh -lc "diff /opt/app/data/tmp/jetty-0_0_0_0-8080-frontend_war-_-any-*/webapp/WEB-INF/app/views/resources/_toolbar.html.erb /opt/app/plugins/local/frontend/views/resources/_toolbar.html.erb | sha256sum | cut -f1 -d' '")"
144+
145+
if [[ "$csum" != "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" ]]; then
146+
echo "resources/toolbar.html.erb checksum differs. We override this file in plugins so probably needs to be compared and updated"
147+
exit 1
148+
fi
149+
173150
- name: Query the ASpace home page
174151
run: |
175152
curl --location --fail --retry 30 --retry-all-errors http://localhost:8080/

0 commit comments

Comments
 (0)