diff --git a/dev-tools/common.bash b/dev-tools/common.bash index be2bb0d71b3..9763dd6d104 100755 --- a/dev-tools/common.bash +++ b/dev-tools/common.bash @@ -76,32 +76,6 @@ setup_go_path() { debug "GOPATH=${GOPATH}" } -jenkins_setup() { - : "${HOME:?Need to set HOME to a non-empty value.}" - : "${WORKSPACE:?Need to set WORKSPACE to a non-empty value.}" - - if [ -z ${GO_VERSION:-} ]; then - get_go_version - fi - - # Setup Go. - export GOPATH=${WORKSPACE} - export PATH=${GOPATH}/bin:${PATH} - eval "$(gvm ${GO_VERSION})" - - # Workaround for Python virtualenv path being too long. - export TEMP_PYTHON_ENV=$(mktemp -d) - - # Workaround for cryptography package (pip dependency) relying on rust - export CRYPTOGRAPHY_DONT_BUILD_RUST=1 - - export PYTHON_ENV="${TEMP_PYTHON_ENV}/python-env" - - # Write cached magefile binaries to workspace to ensure - # each run starts from a clean slate. - export MAGEFILE_CACHE="${WORKSPACE}/.magefile" -} - docker_setup() { OS="$(uname)" case $OS in diff --git a/dev-tools/jenkins_ci.sh b/dev-tools/jenkins_ci.sh deleted file mode 100755 index e425ef1752d..00000000000 --- a/dev-tools/jenkins_ci.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env bash -set -euox pipefail - -: "${HOME:?Need to set HOME to a non-empty value.}" -: "${WORKSPACE:?Need to set WORKSPACE to a non-empty value.}" -: "${beat:?Need to set beat to a non-empty value.}" - -if [ ! -d "$beat" ]; then - echo "$beat does not exist" - mkdir -p build - touch build/TEST-empty.out - exit -fi - -source ./dev-tools/common.bash - -jenkins_setup - -cleanup() { - echo "Running cleanup..." - rm -rf $TEMP_PYTHON_ENV - - if docker info > /dev/null ; then - make stop-environment || true - make fix-permissions || true - echo "Killing all running containers..." - ids=$(docker ps -q) - if [ -n "$ids" ]; then - docker kill $ids - fi - echo "Cleaning stopped docker containers and dangling images/networks/volumes..." - docker system prune -f || true - fi - - echo "Cleanup complete." -} -trap cleanup EXIT - -rm -rf ${GOPATH}/pkg -cd ${beat} -RACE_DETECTOR=1 make clean check testsuite diff --git a/dev-tools/jenkins_intake.sh b/dev-tools/jenkins_intake.sh deleted file mode 100755 index de8ec969ddb..00000000000 --- a/dev-tools/jenkins_intake.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash -set -euox pipefail - -: "${HOME:?Need to set HOME to a non-empty value.}" -: "${WORKSPACE:?Need to set WORKSPACE to a non-empty value.}" - -source ./dev-tools/common.bash - -jenkins_setup - -cleanup() { - echo "Running cleanup..." - rm -rf $TEMP_PYTHON_ENV - echo "Cleanup complete." -} -trap cleanup EXIT - -make check diff --git a/dev-tools/jenkins_release.sh b/dev-tools/jenkins_release.sh deleted file mode 100755 index 02950637610..00000000000 --- a/dev-tools/jenkins_release.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env bash -set -euox pipefail - -: "${HOME:?Need to set HOME to a non-empty value.}" -: "${WORKSPACE:?Need to set WORKSPACE to a non-empty value.}" - -source $(dirname "$0")/common.bash - -jenkins_setup -docker_setup - -cleanup() { - echo "Running cleanup..." - rm -rf $TEMP_PYTHON_ENV - - if docker info > /dev/null ; then - echo "Killing all running containers..." - ids=$(docker ps -q) - if [ -n "$ids" ]; then - docker kill $ids - fi - echo "Cleaning stopped docker containers and dangling images/networks/volumes..." - docker system prune -f || true - - os=$(uname -s) - if [ "$os" == "Darwin" ]; then - # Clean images accept for the ones we're currently using in order to - # gain some disk space. - echo "Disk space before image cleanup:" - df -h / - docker system df - echo "Cleaning images" - docker images --format "{{.ID}} {{.Repository}}:{{.Tag}}" \ - | grep -v "docker.elastic.co/beats-dev/golang-crossbuild:$(cat .go-version)-" \ - | awk '{print $1}' \ - | xargs docker rmi -f || true - echo "Disk space after image cleanup:" - df -h / - docker system df - fi - fi - - echo "Cleanup complete." -} -trap cleanup EXIT - -# This controls the defaults used the Jenkins package job. They can be -# overridden by setting them in the environment prior to running this script. -export SNAPSHOT="${SNAPSHOT:-true}" -export PLATFORMS="${PLATFORMS:-+linux/armv7 +linux/ppc64le +linux/s390x +linux/mips64}" - -make release