diff --git a/.cicd/build.sh b/.cicd/build.sh index eb2228595..1be513f82 100755 --- a/.cicd/build.sh +++ b/.cicd/build.sh @@ -15,10 +15,21 @@ else export DOCKER_IMAGE fi ARGS=${ARGS:-"--rm -v $(pwd):$MOUNTED_DIR"} -CDT_COMMANDS="apt-get install -y wget && wget -q $CDT_URL -O eosio.cdt.deb && dpkg -i eosio.cdt.deb && export PATH=/usr/opt/eosio.cdt/\\\$(ls /usr/opt/eosio.cdt/)/bin:\\\$PATH" +CDT_COMMANDS="dpkg -i $MOUNTED_DIR/eosio.cdt.deb && export PATH=/usr/opt/eosio.cdt/\\\$(ls /usr/opt/eosio.cdt/)/bin:\\\$PATH" PRE_COMMANDS="$CDT_COMMANDS && cd $MOUNTED_DIR/build" BUILD_COMMANDS="cmake -DBUILD_TESTS=true .. && make -j $JOBS" COMMANDS="$PRE_COMMANDS && $BUILD_COMMANDS" +# Test CDT binary download to prevent failures due to eosio.cdt pipeline. +INDEX='1' +echo "$ curl -sSf $CDT_URL --output eosio.cdt.deb" +while ! $(curl -sSf $CDT_URL --output eosio.cdt.deb); do + echo "ERROR: Expected CDT binary for commit ${CDT_COMMIT:0:7} from $CDT_VERSION. It does not exist at $CDT_URL!" + printf "There must be a successful build against ${CDT_COMMIT:0:7} \033]1339;url=https://buildkite.com/EOSIO/eosio-dot-cdt/builds?commit=$CDT_COMMIT;content=here\a for this package to exist.\n" + echo "Attempt $INDEX, retry in 60 seconds..." + echo '' + INDEX=$(( $INDEX + 1 )) + sleep 60 +done # retry docker pull to protect against failures due to race conditions with eosio pipeline INDEX='1' echo "$ docker pull $DOCKER_IMAGE" diff --git a/.cicd/pipeline.yml b/.cicd/pipeline.yml index 9c9a4ab21..7d2839846 100644 --- a/.cicd/pipeline.yml +++ b/.cicd/pipeline.yml @@ -8,7 +8,7 @@ steps: buildkite-agent artifact upload build.tar.gz agents: queue: "automation-eks-eos-builder-fleet" - timeout: "${TIMEOUT:-40}" + timeout: "${TIMEOUT:-60}" skip: "$SKIP_UBUNTU_18" - wait diff --git a/.cicd/test.sh b/.cicd/test.sh index d4e45617e..bdb8473e9 100755 --- a/.cicd/test.sh +++ b/.cicd/test.sh @@ -9,10 +9,11 @@ if [[ "$BUILDKITE" == 'true' ]]; then DOCKER_IMAGE="$(buildkite-agent meta-data get docker-image)" fi ARGS=${ARGS:-"--rm -v $(pwd):$MOUNTED_DIR"} -CDT_COMMANDS="apt-get install -y wget && wget -q $CDT_URL -O eosio.cdt.deb && dpkg -i eosio.cdt.deb && export PATH=/usr/opt/eosio.cdt/$CDT_VERSION/bin:\\\$PATH" +CDT_COMMANDS="dpkg -i $MOUNTED_DIR/eosio.cdt.deb && export PATH=/usr/opt/eosio.cdt/$CDT_VERSION/bin:\\\$PATH" PRE_COMMANDS="$CDT_COMMANDS && cd $MOUNTED_DIR/build/tests" TEST_COMMANDS="ctest -j $JOBS --output-on-failure -T Test" COMMANDS="$PRE_COMMANDS && $TEST_COMMANDS" +curl -sSf $CDT_URL --output eosio.cdt.deb set +e eval docker run $ARGS $(buildkite-intrinsics) $DOCKER_IMAGE bash -c \"$COMMANDS\" EXIT_STATUS=$?