Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Add Sync from Genesis Test #8358

Merged
merged 12 commits into from
Dec 20, 2019
Merged
22 changes: 22 additions & 0 deletions .cicd/docker-tag.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
set -eo pipefail
echo '+++ :evergreen_tree: Configuring Environment'
REPO='eosio/ci-contracts-builder'
PREFIX='base-ubuntu-18.04'
IMAGE="$REPO:$PREFIX-$BUILDKITE_COMMIT"
SANITIZED_BRANCH=$(echo "$BUILDKITE_BRANCH" | tr '/' '_')
SANITIZED_TAG=$(echo "$BUILDKITE_TAG" | tr '/' '_')
echo '+++ :arrow_down: Pulling Container'
echo "Pulling \"$IMAGE\""
docker pull "$IMAGE"
echo '+++ :label: Tagging Container'
docker tag "$IMAGE" "$REPO:$PREFIX-$SANITIZED_BRANCH"
echo "Tagged \"$REPO:$PREFIX-$SANITIZED_BRANCH\"."
[[ -z "$BUILDKITE_TAG" ]] || docker tag "$IMAGE" "$REPO:$PREFIX-$SANITIZED_TAG" && echo "Tagged \"$REPO:$PREFIX-$SANITIZED_TAG\"."
echo '+++ :arrow_up: Pushing Container'
docker push "$REPO:$PREFIX-$SANITIZED_BRANCH"
[[ -z "$BUILDKITE_TAG" ]] || docker push "$REPO:$PREFIX-$SANITIZED_TAG"
echo '+++ :put_litter_in_its_place: Cleaning Up'
docker rmi "$REPO:$PREFIX-$SANITIZED_BRANCH"
[[ -z "$BUILDKITE_TAG" ]] || docker rmi "$REPO:$PREFIX-$SANITIZED_TAG"
docker rmi "$IMAGE"
57 changes: 45 additions & 12 deletions .cicd/generate-pipeline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,21 @@ EOF
EOF
fi
done
echo
echo ' - wait'
echo ''
cat <<EOF

- label: ":docker: Docker - Build and Install"
command: "./.cicd/installation-build.sh"
env:
IMAGE_TAG: "ubuntu-18.04-unpinned"
PLATFORM_TYPE: "unpinned"
agents:
queue: "$BUILDKITE_BUILD_AGENT_QUEUE"
timeout: ${TIMEOUT:-180}
skip: ${SKIP_INSTALL}${SKIP_LINUX}${SKIP_DOCKER}

- wait

EOF
# tests
IFS=$oIFS
for ROUND in $(seq 1 $ROUNDS); do
Expand Down Expand Up @@ -452,18 +464,19 @@ done
# trigger eosio-lrt post pr
if [[ -z $BUILDKITE_TRIGGERED_FROM_BUILD_ID && $TRIGGER_JOB == "true" ]]; then
if ( [[ ! $PINNED == false ]] ); then
cat <<EOF
cat <<EOF
- label: ":pipeline: Trigger Long Running Tests"
trigger: "eosio-lrt"
async: true
build:
message: "${BUILDKITE_MESSAGE}"
message: "Triggered by EOSIO build ${BUILDKITE_BUILD_NUMBER}"
commit: "${BUILDKITE_COMMIT}"
branch: "${BUILDKITE_BRANCH}"
env:
BUILDKITE_PULL_REQUEST: "${BUILDKITE_PULL_REQUEST}"
BUILDKITE_PULL_REQUEST_BASE_BRANCH: "${BUILDKITE_PULL_REQUEST_BASE_BRANCH}"
BUILDKITE_PULL_REQUEST_REPO: "${BUILDKITE_PULL_REQUEST_REPO}"
BUILDKITE_TRIGGERED_FROM_BUILD_LINK: "${BUILDKITE_BUILD_URL}"
SKIP_BUILD: "true"
SKIP_WASM_SPEC_TESTS: "true"
PINNED: "${PINNED}"
Expand All @@ -474,22 +487,42 @@ fi
# trigger multiversion post pr
if [[ -z $BUILDKITE_TRIGGERED_FROM_BUILD_ID && $TRIGGER_JOB = "true" ]]; then
if ( [[ ! $PINNED == false ]] ); then
cat <<EOF
cat <<EOF
- label: ":pipeline: Trigger Multiversion Test"
trigger: "eos-multiversion-tests"
async: true
build:
message: "${BUILDKITE_MESSAGE}"
message: "Triggered by EOSIO build ${BUILDKITE_BUILD_NUMBER}"
commit: "${BUILDKITE_COMMIT}"
branch: "${BUILDKITE_BRANCH}"
env:
BUILDKITE_PULL_REQUEST: "${BUILDKITE_PULL_REQUEST}"
BUILDKITE_PULL_REQUEST_BASE_BRANCH: "${BUILDKITE_PULL_REQUEST_BASE_BRANCH}"
BUILDKITE_PULL_REQUEST_REPO: "${BUILDKITE_PULL_REQUEST_REPO}"
BUILDKITE_TRIGGERED_FROM_BUILD_LINK: "${BUILDKITE_BUILD_URL}"

EOF
fi
fi
# trigger eosio-sync-from-genesis for every build
if [[ -z $BUILDKITE_TRIGGERED_FROM_BUILD_ID && -z "${SKIP_INSTALL}${SKIP_LINUX}${SKIP_DOCKER}" ]]; then
cat <<EOF
- label: ":chains: Sync-from-Genesis Test"
trigger: "eosio-sync-from-genesis"
async: false
build:
message: "Triggered by EOSIO build ${BUILDKITE_BUILD_NUMBER}"
commit: "${BUILDKITE_COMMIT}"
branch: "${BUILDKITE_BRANCH}"
env:
BUILDKITE_TRIGGERED_FROM_BUILD_LINK: "${BUILDKITE_BUILD_URL}"
SKIP_JUNGLE: "${SKIP_JUNGLE}"
SKIP_KYLIN: "${SKIP_KYLIN}"
SKIP_MAIN: "${SKIP_MAIN}"
TIMEOUT: "${TIMEOUT}"

EOF
fi
# pipeline tail
cat <<EOF
- wait:
Expand Down Expand Up @@ -597,18 +630,18 @@ cat <<EOF
cd: ~
agents:
- "queue=mac-anka-node-fleet"
timeout: ${TIMEOUT:-60}
timeout: ${TIMEOUT:-10}
skip: ${SKIP_MACOS_10_14}${SKIP_PACKAGE_BUILDER}${SKIP_MAC}

- label: ":ubuntu: Ubuntu 18.04 - Contract Builder"
command: "./.cicd/installation-build.sh"
- label: ":docker: Docker - Label Container with Git Branch and Git Tag"
command: .cicd/docker-tag.sh
env:
IMAGE_TAG: "ubuntu-18.04-unpinned"
PLATFORM_TYPE: "unpinned"
agents:
queue: "$BUILDKITE_BUILD_AGENT_QUEUE"
timeout: ${TIMEOUT:-30}
skip: ${SKIP_CONTRACT_BUILDER}${SKIP_LINUX}
timeout: ${TIMEOUT:-10}
skip: ${SKIP_INSTALL}${SKIP_LINUX}${SKIP_DOCKER}${SKIP_PACKAGE_BUILDER}

- wait

Expand Down
26 changes: 10 additions & 16 deletions .cicd/installation-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,13 @@
set -eo pipefail
. ./.cicd/helpers/general.sh
export ENABLE_INSTALL=true
if [[ $BUILDKITE_BRANCH =~ ^release/[0-9]+.[0-9]+.x$ || $BUILDKITE_BRANCH =~ ^master$ || $BUILDKITE_BRANCH =~ ^develop$ || ! -z $BUILDKITE_TAG || $FORCE_BINARIES_BUILD == true ]]; then
export BRANCH=$(echo $BUILDKITE_BRANCH | sed 's/\//\_/')
export CONTRACTS_BUILDER_TAG="eosio/ci-contracts-builder:base-ubuntu-18.04"
export ARGS="--name ci-contracts-builder-$BUILDKITE_COMMIT --init -v $(pwd):$MOUNTED_DIR"
$CICD_DIR/build.sh
docker commit ci-contracts-builder-$BUILDKITE_COMMIT $CONTRACTS_BUILDER_TAG-$BUILDKITE_COMMIT
docker commit ci-contracts-builder-$BUILDKITE_COMMIT $CONTRACTS_BUILDER_TAG-$BRANCH
docker commit ci-contracts-builder-$BUILDKITE_COMMIT $CONTRACTS_BUILDER_TAG-$BRANCH-$BUILDKITE_COMMIT
docker push $CONTRACTS_BUILDER_TAG-$BUILDKITE_COMMIT
docker push $CONTRACTS_BUILDER_TAG-$BRANCH
docker push $CONTRACTS_BUILDER_TAG-$BRANCH-$BUILDKITE_COMMIT
docker stop ci-contracts-builder-$BUILDKITE_COMMIT && docker rm ci-contracts-builder-$BUILDKITE_COMMIT
else
echo "Contract builder images are only created for tags or master, develop, and release branches. Start a new build with FORCE_BINARIES_BUILD=true to create a Contract Builder image for other branches/commits. Exiting..."
exit 0
fi
export BRANCH=$(echo $BUILDKITE_BRANCH | sed 's/\//\_/')
export CONTRACTS_BUILDER_TAG="eosio/ci-contracts-builder:base-ubuntu-18.04"
export ARGS="--name ci-contracts-builder-$BUILDKITE_COMMIT --init -v $(pwd):$MOUNTED_DIR"
$CICD_DIR/build.sh
docker commit ci-contracts-builder-$BUILDKITE_COMMIT $CONTRACTS_BUILDER_TAG-$BUILDKITE_COMMIT
docker commit ci-contracts-builder-$BUILDKITE_COMMIT $CONTRACTS_BUILDER_TAG-$BRANCH-$BUILDKITE_COMMIT
docker push $CONTRACTS_BUILDER_TAG-$BUILDKITE_COMMIT
docker push $CONTRACTS_BUILDER_TAG-$BRANCH-$BUILDKITE_COMMIT
docker stop ci-contracts-builder-$BUILDKITE_COMMIT
docker rm ci-contracts-builder-$BUILDKITE_COMMIT
18 changes: 0 additions & 18 deletions .cicd/pipeline.yml

This file was deleted.