From 85e13a59c338901044b163db1390e789e4385cbe Mon Sep 17 00:00:00 2001 From: William Blevins Date: Thu, 8 Jul 2021 18:35:25 -0400 Subject: [PATCH 1/2] Disable docker interactions for security-like repos. --- .cicd/create-docker-from-binary.sh | 6 +++++- .cicd/helpers/general.sh | 9 +++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.cicd/create-docker-from-binary.sh b/.cicd/create-docker-from-binary.sh index 42bbfc47569..90119edb5f8 100755 --- a/.cicd/create-docker-from-binary.sh +++ b/.cicd/create-docker-from-binary.sh @@ -16,7 +16,11 @@ echo "$ $DOCKER_BUILD" eval $DOCKER_BUILD # docker tag echo '--- :label: Tag Container' -REGISTRIES=("$EOSIO_REGISTRY" "$DOCKERHUB_REGISTRY") +if [[ "$BUILDKITE_PIPELINE_SLUG" =~ "security" ]] ; then + REGISTRIES=("$EOSIO_REGISTRY") +else + REGISTRIES=("$EOSIO_REGISTRY" "$DOCKERHUB_REGISTRY") +fi for REG in ${REGISTRIES[@]}; do DOCKER_TAG_BRANCH="docker tag '$IMAGE' '$REG:$SANITIZED_BRANCH'" echo "$ $DOCKER_TAG_BRANCH" diff --git a/.cicd/helpers/general.sh b/.cicd/helpers/general.sh index 4de9bb626b2..5e3d2a3d9d5 100644 --- a/.cicd/helpers/general.sh +++ b/.cicd/helpers/general.sh @@ -7,8 +7,13 @@ export MOUNTED_DIR='/eos' export DOCKER_CLI_EXPERIMENTAL='enabled' export DOCKERHUB_CI_REGISTRY="docker.io/eosio/ci" export DOCKERHUB_CONTRACTS_REGISTRY="docker.io/eosio/ci-contracts-builder" -export CI_REGISTRIES=("$DOCKERHUB_CI_REGISTRY" "$MIRROR_REGISTRY") -export CONTRACT_REGISTRIES=("$DOCKERHUB_CONTRACTS_REGISTRY" "$MIRROR_REGISTRY") +if [[ "$BUILDKITE_PIPELINE_SLUG" =~ "security" ]] ; then + export CI_REGISTRIES=("$MIRROR_REGISTRY") + export CONTRACT_REGISTRIES=("$MIRROR_REGISTRY") +else + export CI_REGISTRIES=("$DOCKERHUB_CI_REGISTRY" "$MIRROR_REGISTRY") + export CONTRACT_REGISTRIES=("$DOCKERHUB_CONTRACTS_REGISTRY" "$MIRROR_REGISTRY") +fi # capitalize each word in a string function capitalize() From b2e8ecf816d753aeb7845ffec9c81005bd524e47 Mon Sep 17 00:00:00 2001 From: William Blevins Date: Fri, 9 Jul 2021 10:29:56 -0400 Subject: [PATCH 2/2] Update check string to catch other repo. --- .cicd/create-docker-from-binary.sh | 2 +- .cicd/helpers/general.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.cicd/create-docker-from-binary.sh b/.cicd/create-docker-from-binary.sh index 90119edb5f8..5c3c3a234d0 100755 --- a/.cicd/create-docker-from-binary.sh +++ b/.cicd/create-docker-from-binary.sh @@ -16,7 +16,7 @@ echo "$ $DOCKER_BUILD" eval $DOCKER_BUILD # docker tag echo '--- :label: Tag Container' -if [[ "$BUILDKITE_PIPELINE_SLUG" =~ "security" ]] ; then +if [[ "$BUILDKITE_PIPELINE_SLUG" =~ "-sec" ]] ; then REGISTRIES=("$EOSIO_REGISTRY") else REGISTRIES=("$EOSIO_REGISTRY" "$DOCKERHUB_REGISTRY") diff --git a/.cicd/helpers/general.sh b/.cicd/helpers/general.sh index 5e3d2a3d9d5..cc2b4cc24e0 100644 --- a/.cicd/helpers/general.sh +++ b/.cicd/helpers/general.sh @@ -7,7 +7,7 @@ export MOUNTED_DIR='/eos' export DOCKER_CLI_EXPERIMENTAL='enabled' export DOCKERHUB_CI_REGISTRY="docker.io/eosio/ci" export DOCKERHUB_CONTRACTS_REGISTRY="docker.io/eosio/ci-contracts-builder" -if [[ "$BUILDKITE_PIPELINE_SLUG" =~ "security" ]] ; then +if [[ "$BUILDKITE_PIPELINE_SLUG" =~ "-sec" ]] ; then export CI_REGISTRIES=("$MIRROR_REGISTRY") export CONTRACT_REGISTRIES=("$MIRROR_REGISTRY") else