From 7023465d91023ba388742e670000fd1f88a5a93c Mon Sep 17 00:00:00 2001 From: Deirdre Connolly Date: Fri, 13 Nov 2020 22:06:48 -0500 Subject: [PATCH] Pass in workflow inputs for network and checkpoint_sync (with defaults) all the way down --- .github/workflows/manual-deploy.yml | 5 ++++- Dockerfile | 7 ++++++- cloudbuild.yaml | 19 +++++++++++++++++-- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/.github/workflows/manual-deploy.yml b/.github/workflows/manual-deploy.yml index 414dabb3..e0db3962 100644 --- a/.github/workflows/manual-deploy.yml +++ b/.github/workflows/manual-deploy.yml @@ -40,7 +40,10 @@ jobs: run: | gcloud builds submit \ --config cloudbuild.yaml \ - --substitutions SHORT_SHA="$SHORT_SHA",BRANCH_NAME="$BRANCH_NAME" + --substitutions SHORT_SHA="$SHORT_SHA",\ + BRANCH_NAME="$BRANCH_NAME",\ + _CHECKPOINT_SYNC="${{ github.event.inputs.checkpoint_sync }}",\ + _NETWORK="${{ github.event.inputs.network }}" # Run once: create firewall rule to allow incoming traffic to the node # - name: Create Zcash incoming traffic firewall rule diff --git a/Dockerfile b/Dockerfile index 6bc8f4ad..d10dc0c7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,8 +35,13 @@ FROM debian:buster-slim AS zebrad-release COPY --from=builder /zebra/target/release/zebrad / +ARG checkpoint_sync=true +ARG network=Mainnet + RUN printf "[consensus]\n" >> /zebrad.toml -RUN printf "checkpoint_sync = true\n" >> /zebrad.toml +RUN printf "checkpoint_sync = $checkpoint_sync\n" >> /zebrad.toml +RUN printf "[network]\n" >> /zebrad.toml +RUN printf "network = $network\n" >> /zebrad.toml RUN printf "[state]\n" >> /zebrad.toml RUN printf "cache_dir = '/zebrad-cache'\n" >> /zebrad.toml RUN printf "memory_cache_bytes = 52428800\n" >> /zebrad.toml diff --git a/cloudbuild.yaml b/cloudbuild.yaml index 7cd64677..b96b0c95 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -1,8 +1,22 @@ steps: - name: 'gcr.io/cloud-builders/docker' - args: ['build', '--target', 'zebra-tests', '-t', 'gcr.io/$PROJECT_ID/zcashfoundation/zebra/tests/$BRANCH_NAME:$SHORT_SHA', '.'] + args: ['build', + '--target', + 'zebra-tests', + '-t', + 'gcr.io/$PROJECT_ID/zcashfoundation/zebra/tests/$BRANCH_NAME:$SHORT_SHA', + '.'] - name: 'gcr.io/cloud-builders/docker' - args: ['build', '--target', 'zebrad-release', '-t', 'gcr.io/$PROJECT_ID/zcashfoundation/zebra/$BRANCH_NAME:$SHORT_SHA', '.'] + args: ['build', + '--build-arg', + 'checkpoint_sync=${_CHECKPOINT_SYNC}', + '--build-arg', + 'network=${_NETWORK}', + '--target', + 'zebrad-release', + '-t', + 'gcr.io/$PROJECT_ID/zcashfoundation/zebra/$BRANCH_NAME:$SHORT_SHA', + '.'] images: - 'gcr.io/$PROJECT_ID/zcashfoundation/zebra/tests/$BRANCH_NAME:$SHORT_SHA' @@ -10,5 +24,6 @@ images: options: machineType: 'N1_HIGHCPU_32' + substitution_option: 'ALLOW_LOOSE' timeout: 1800s # 30 mins