|
9 | 9 | env: |
10 | 10 | BUILD_SUFFIX: -build-${{ github.run_id }}_${{ github.run_attempt }} |
11 | 11 | DOCKER_METADATA_SET_OUTPUT_ENV: 'true' |
12 | | - ARCHIVESSPACE_RESOURCE_TOOLBAR_SHA256: 2feb4bf50a103574dc541d36dd237b5d49f6e663439dfe23314b89ccf964b83d |
13 | 12 |
|
14 | 13 | 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 | | -
|
46 | 14 | build: |
47 | | - needs: verify-upstream |
48 | 15 | runs-on: ${{ matrix.runner }} |
49 | 16 | outputs: |
50 | 17 | image-arm64: ${{ steps.gen-output.outputs.image-arm64 }} |
@@ -170,6 +137,16 @@ jobs: |
170 | 137 | docker compose up --wait |
171 | 138 | docker compose exec -u root app chown archivesspace:archivesspace artifacts |
172 | 139 |
|
| 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 | +
|
173 | 150 | - name: Query the ASpace home page |
174 | 151 | run: | |
175 | 152 | curl --location --fail --retry 30 --retry-all-errors http://localhost:8080/ |
|
0 commit comments