Pipe SHORT_SHA into container builds (#1451)

This commit is contained in:
Deirdre Connolly 2020-12-03 22:51:42 -05:00 committed by GitHub
parent ef7e91c3c7
commit 8f58c41a38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 2 deletions

View File

@ -67,7 +67,7 @@ jobs:
gcloud compute ssh "zebrad-tests-$BRANCH_NAME-$SHORT_SHA" --zone "$ZONE" --command \
"git clone -b $BRANCH_NAME https://github.com/ZcashFoundation/zebra.git;
cd zebra/;
docker build -f docker/Dockerfile.test -t zebrad-test .;
docker build --build-arg SHORT_SHA=$SHORT_SHA -f docker/Dockerfile.test -t zebrad-test .;
docker run -i zebrad-test cargo test --workspace --no-fail-fast -- -Zunstable-options --include-ignored;
docker run -i --mount type=bind,source=/mnt/disks/gce-containers-mounts/gce-persistent-disks/zebrad-cache-$SHORT_SHA-mainnet-419200,target=/zebrad-cache zebrad-test:latest cargo test --verbose --features test_sync_past_sapling_mainnet --manifest-path zebrad/Cargo.toml sync_past_sapling_mainnet;
docker run -i --mount type=bind,source=/mnt/disks/gce-containers-mounts/gce-persistent-disks/zebrad-cache-$SHORT_SHA-testnet-280000,target=/zebrad-cache zebrad-test:latest cargo test --verbose --features test_sync_past_sapling_testnet --manifest-path zebrad/Cargo.toml sync_past_sapling_testnet;

View File

@ -1,6 +1,8 @@
steps:
- name: 'gcr.io/cloud-builders/docker'
args: ['build',
'--build-arg',
'SHORT_SHA=$SHORT_SHA',
'--build-arg',
'checkpoint_sync=${_CHECKPOINT_SYNC}',
'--build-arg',

View File

@ -8,11 +8,16 @@ RUN apt-get update && \
RUN mkdir /zebra
WORKDIR /zebra
ENV RUST_BACKTRACE 1
ARG SHORT_SHA
ENV SHORT_SHA $SHORT_SHA
ENV RUST_BACKTRACE full
ENV CARGO_HOME /zebra/.cargo/
RUN rustc -V; cargo -V; rustup -V
COPY . .
RUN cargo test --all --release; cargo build --release
@ -32,6 +37,7 @@ RUN printf "[state]\n" >> /zebrad.toml
RUN printf "cache_dir = '/zebrad-cache'\n" >> /zebrad.toml
RUN printf "[tracing]\n" >> /zebrad.toml
RUN printf "endpoint_addr = '0.0.0.0:3000'\n" >> /zebrad.toml
RUN cat /zebrad.toml
EXPOSE 3000 8233 18233

View File

@ -7,6 +7,9 @@ RUN apt-get update && \
RUN mkdir /zebra
WORKDIR /zebra
ARG SHORT_SHA
ENV SHORT_SHA $SHORT_SHA
ENV RUST_BACKTRACE full
ENV CARGO_HOME /zebra/.cargo/