Skip to content

Commit

Permalink
refactor: fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
nurupo committed Jan 31, 2024
1 parent 45195fe commit 5dbd657
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/scripts/tox-bootstrapd-docker
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
set -exu -o pipefail

LOCAL="${1:-}"
CHECK="${2:-}"
CHECK_HASH="${2:-}"

readarray -t FILES <<<"$(git ls-files)"

if ! tar c "${FILES[@]}" | docker build --build-arg="CHECK=$CHECK" -f other/bootstrap_daemon/docker/Dockerfile -t toxchat/bootstrap-node - 2>&1 | tee docker-build.log; then
if ! tar c "${FILES[@]}" | docker build --build-arg="CHECK_HASH=$CHECK_HASH" -f other/bootstrap_daemon/docker/Dockerfile -t toxchat/bootstrap-node - 2>&1 | tee docker-build.log; then
grep -o "::error.*::[a-f0-9]* /usr/local/bin/tox-bootstrapd" docker-build.log
false
fi
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ jobs:
with:
submodules: recursive
- name: Docker Build
run: .github/scripts/tox-bootstrapd-docker local "$CHECK"
run: .github/scripts/tox-bootstrapd-docker local "$CHECK_HASH"
env:
CHECK: "${{ contains(github.event.pull_request.title, 'chore: Release ') && 'sha256sum' || 'echo' }}"
CHECK_HASH: "${{ contains(github.event.pull_request.title, 'chore: Release ') && 'true' || 'false' }}"
- name: Push latest image to DockerHub
if: ${{ github.event_name == 'push' }}
run: docker push toxchat/bootstrap-node:latest
Expand Down
6 changes: 3 additions & 3 deletions other/bootstrap_daemon/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ RUN CC=clang cmake -B_build -H. \
# Verify checksum from dev-built binary, so we can be sure Docker Hub doesn't
# mess with your binaries.
COPY other/bootstrap_daemon/docker/tox-bootstrapd.sha256 other/bootstrap_daemon/docker/
ARG CHECK=sha256sum
RUN SHA256="$("$CHECK" /usr/local/bin/tox-bootstrapd)" && \
("$CHECK" -c other/bootstrap_daemon/docker/tox-bootstrapd.sha256 || \
ARG CHECK_HASH=true
RUN "$CHECK_HASH" && SHA256="$(sha256sum /usr/local/bin/tox-bootstrapd)" && \
(sha256sum -c other/bootstrap_daemon/docker/tox-bootstrapd.sha256 || \
(echo "::error file=other/bootstrap_daemon/docker/tox-bootstrapd.sha256,line=1::$SHA256" && \
false))

Expand Down

0 comments on commit 5dbd657

Please sign in to comment.