You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by rh...@apache.org on 2018/11/08 20:24:30 UTC

[geode] branch develop updated: GEODE-5830 Use current and maintained pr-concourse-resource

This is an automated email from the ASF dual-hosted git repository.

rhoughton pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new 9de2221  GEODE-5830 Use current and maintained pr-concourse-resource
9de2221 is described below

commit 9de22214cf92cab33e2bcec77d3b2a624fff0aff
Author: Robert Houghton <rh...@pivotal.io>
AuthorDate: Tue Nov 6 10:14:34 2018 -0800

    GEODE-5830 Use current and maintained pr-concourse-resource
    
    The PR resource type used by geode is unmaintained. A new implementation
    has taken the mantle and run with it.
    
    * Follow migration steps for new/different/deprecated resource
    parameters
    * Remove `Build` job from PR pipeline, as it was paused anyway and the
    build is done by each other job
    * Remove `once-a-week` resource from `images` pipeline, which makes new
    deployments impossible
    * Use Jinja2 variable to create the PR status context for GitHub
    * Remove dead ci scripts from repository as their continued existence
    was confusing
    
    Co-authored-by: Robert Houghton <rh...@pivotal.io>
    Co-authored-by: Dick Cavender <dc...@pivotal.io>
---
 ci/pipelines/images/jinja.template.yml       |  13 --
 ci/pipelines/meta/deploy_meta.sh             |   1 -
 ci/pipelines/pull-request/jinja.template.yml |  97 ++------------
 ci/scripts/archive_results.sh                |   4 +-
 ci/scripts/build.sh                          | 181 ---------------------------
 ci/scripts/publish.sh                        |  96 --------------
 ci/scripts/test-archive.sh                   | 130 -------------------
 7 files changed, 15 insertions(+), 507 deletions(-)

diff --git a/ci/pipelines/images/jinja.template.yml b/ci/pipelines/images/jinja.template.yml
index f93960d..9dde1c3 100644
--- a/ci/pipelines/images/jinja.template.yml
+++ b/ci/pipelines/images/jinja.template.yml
@@ -20,15 +20,6 @@
 ---
 
 resources:
-- name: once-a-week
-  type: time
-  source:
-    days: [Monday]
-    start: 6:00 AM
-    stop: 7:00 AM
-    interval: 1h
-    location: US/Pacific
-
 - name: build-concourse-dockerfile
   type: git
   source:
@@ -168,8 +159,6 @@ jobs:
   serial: true
   plan:
   - aggregate:
-    - get: once-a-week
-      trigger: true
     - get: test-container-docker-image
       passed: [build-test-container-docker-image]
       trigger: true
@@ -198,8 +187,6 @@ jobs:
   serial: true
   plan:
   - aggregate:
-    - get: once-a-week
-      trigger: true
     - get: google-windows-geode-builder
       trigger: true
     - get: alpine-tools-docker-image
diff --git a/ci/pipelines/meta/deploy_meta.sh b/ci/pipelines/meta/deploy_meta.sh
index 4da3194..cb8a396 100755
--- a/ci/pipelines/meta/deploy_meta.sh
+++ b/ci/pipelines/meta/deploy_meta.sh
@@ -97,7 +97,6 @@ pushd ${SCRIPTDIR} 2>&1 > /dev/null
   fly -t ${FLY_TARGET} set-pipeline \
     -p ${META_PIPELINE} \
     --config ${SCRIPTDIR}/generated-pipeline.yml \
-    --var concourse-team="main" \
     --var concourse-url=${CONCOURSE_URL} \
     --var artifact-bucket=${ARTIFACT_BUCKET} \
     --var gcp-project=${GCP_PROJECT} \
diff --git a/ci/pipelines/pull-request/jinja.template.yml b/ci/pipelines/pull-request/jinja.template.yml
index 9bc0da0..4e2bff7 100644
--- a/ci/pipelines/pull-request/jinja.template.yml
+++ b/ci/pipelines/pull-request/jinja.template.yml
@@ -21,27 +21,20 @@
 groups:
 - name: main
   jobs:
-  - Build
 {%- for test in tests if not test.name.startswith("Windows") %}
   - {{test.name}}Test
 {%- endfor %}
 resources:
-- name: docker-geode-build-image
-  type: docker-image
-  source:
-    password: ((!docker-password))
-    repository: gcr.io/((gcp-project))/((pipeline-prefix))((!docker-image-name))
-    tag: latest
-    username: ((!docker-username))
 - name: geode
   type: pull-request
   source:
     access_token: ((!github-pr-access-token))
-    base: develop
     ignore_paths:
     - geode-docs/*
     - geode-book/*
-    repo: {{repository.fork}}/geode
+    repository: {{repository.fork}}/geode
+    disable_ci_skip: false
+    skip_ssl_verification: false
 - name: geode-ci
   type: git
   source:
@@ -62,9 +55,7 @@ resource_types:
 - name: pull-request
   type: docker-image
   source:
-    repository: jtarchie/pr
-# TODO : Is pipeline_prefix here correct?  is apachegeode-ci?  this bucket maybe doesn't exist?
-# Also see build jinja
+    repository: teliaoss/github-pr-resource
 - name: concourse-metadata-resource
   type: docker-image
   source:
@@ -73,62 +64,6 @@ resource_types:
     tag: latest
     username: ((!docker-username))
 jobs:
-- name: Build
-  public: true
-  plan:
-  - aggregate:
-    - get: geode
-      trigger: true
-      params:
-        fetch_merge: true
-        git:
-          depth: 100
-      version: every
-    - get: geode-ci
-    - get: docker-geode-build-image
-      params:
-        rootfs: true
-  - get: geode-unmerged-request
-    resource: geode
-    params:
-      fetch_merge: false
-    version: every
-  - aggregate:
-    - put: geode
-      params:
-        context: $BUILD_JOB_NAME
-        path: geode-unmerged-request
-        status: pending
-    - task: build
-      config:
-        platform: linux
-        params:
-          MAINTENANCE_VERSION: {{repository.branch}}
-          ARTIFACT_BUCKET: ((artifact-bucket))
-          SERVICE_ACCOUNT: ((!concourse-gcp-account))
-        run:
-          path: geode-ci/ci/scripts/build.sh
-        inputs:
-        - name: geode
-        - name: geode-ci
-        outputs:
-        - name: built-geode
-        - name: results
-      image: docker-geode-build-image
-      on_failure:
-        aggregate:
-        - put: geode
-          params:
-            context: $BUILD_JOB_NAME
-            path: geode-unmerged-request
-            status: failure
-      on_success:
-        aggregate:
-        - put: geode
-          params:
-            context: $BUILD_JOB_NAME
-            path: geode-unmerged-request
-            status: success
 {% for test in tests if not test.name.startswith("Windows")%}
 - name: {{test.name}}Test
   public: true
@@ -137,25 +72,17 @@ jobs:
     - aggregate:
       - get: geode
         trigger: true
-        params:
-          fetch_merge: true
-          git:
-            depth: 100
         version: every
       - get: geode-ci
     - aggregate:
       - do:
-        - get: geode-unmerged-request
-          resource: geode
-          params:
-            fetch_merge: false
-          version: every
         - put: pull-request-job-pending
           resource: geode
           params:
-            context: $BUILD_JOB_NAME
-            path: geode-unmerged-request
+            context: {{test.name}}Test
+            path: geode
             status: pending
+          get_params: {skip_download: true}
       - do:
         - put: concourse-metadata-resource
         - task: create_instance
@@ -218,9 +145,10 @@ jobs:
       - put: pull-request-job-failure
         resource: geode
         params:
-          context: $BUILD_JOB_NAME
-          path: geode-unmerged-request
+          context: {{test.name}}Test
+          path: geode
           status: failure
+        get_params: {skip_download: true}
     ensure:
       do:
       - task: rsync_code_down
@@ -268,7 +196,8 @@ jobs:
       - put: pull-request-job-success
         resource: geode
         params:
-          context: $BUILD_JOB_NAME
-          path: geode-unmerged-request
+          context: {{test.name}}Test
+          path: geode
           status: success
+        get_params: {skip_download: true}
 {% endfor %}
diff --git a/ci/scripts/archive_results.sh b/ci/scripts/archive_results.sh
index 3d33138..1164944 100755
--- a/ci/scripts/archive_results.sh
+++ b/ci/scripts/archive_results.sh
@@ -51,9 +51,9 @@ GEODE_BUILD=${DEST_DIR}/geode
 GEODE_BUILD_VERSION_NUMBER=$(grep "versionNumber *=" ${GEODE_BUILD}/gradle.properties | awk -F "=" '{print $2}' | tr -d ' ')
 BUILD_TIMESTAMP=$(date +%s)
 
-GEODE_PULL_REQUEST_ID_FILE=${GEODE_BUILD}/.git/id
+GEODE_PULL_REQUEST_ID_FILE=${BUILDROOT}/geode/.git/resource/version.json
 if [ -e "${GEODE_PULL_REQUEST_ID_FILE}" ]; then
-  GEODE_PULL_REQUEST_ID=$(cat ${GEODE_PULL_REQUEST_ID_FILE})
+  GEODE_PULL_REQUEST_ID=$(cat ${GEODE_PULL_REQUEST_ID_FILE} | jq --raw-output '.["pr"]')
 fi
 
 
diff --git a/ci/scripts/build.sh b/ci/scripts/build.sh
deleted file mode 100755
index cffc665..0000000
--- a/ci/scripts/build.sh
+++ /dev/null
@@ -1,181 +0,0 @@
-#!/usr/bin/env bash
-
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-
-set -e
-ROOT_DIR=$(pwd)
-BUILD_DATE=$(date +%s)
-EMAIL_SUBJECT="results/subject"
-EMAIL_BODY="results/body"
-
-GEODE_BUILD_VERSION_FILE=${ROOT_DIR}/geode-build-version/number
-GEODE_RESULTS_VERSION_FILE=${ROOT_DIR}/results/number
-GEODE_BUILD_VERSION_NUMBER=$(grep "versionNumber *=" geode/gradle.properties | awk -F "=" '{print $2}' | tr -d ' ')
-GEODE_BUILD_DIR=/tmp/geode-build
-GEODE_PULL_REQUEST_ID_FILE=${ROOT_DIR}/geode/.git/id
-if [ -e "${GEODE_PULL_REQUEST_ID_FILE}" ]; then
-  GEODE_PULL_REQUEST_ID=$(cat ${GEODE_PULL_REQUEST_ID_FILE})
-fi
-
-if [ ! -e "${GEODE_BUILD_VERSION_FILE}" ] && [ -z "${GEODE_PULL_REQUEST_ID}" ]; then
-  echo "${GEODE_BUILD_VERSION_FILE} file does not exist. Concourse is probably not configured correctly."
-  exit 1
-fi
-if [ -z ${MAINTENANCE_VERSION+x} ]; then
-  echo "MAINTENANCE_VERSION is unset. Check your pipeline configuration and make sure this script is called properly."
-  exit 1
-fi
-if [ -z ${SERVICE_ACCOUNT+x} ]; then
-  echo "SERVICE_ACCOUNT is unset. Check your pipeline configuration and make sure this script is called properly."
-  exit 1
-fi
-
-if [ -z ${ARTIFACT_BUCKET+x} ]; then
-  echo "ARTIFACT_BUCKET is unset. Check your pipeline configuration and make sure this script is called properly."
-  exit 1
-fi
-
-if [ -z ${GEODE_BUILD_VERSION_NUMBER+x} ]; then
-  echo "gradle.properties does not seem to contain a valid versionNumber. Please check the source tree."
-  exit 1
-fi
-
-if [ -z "${GEODE_PULL_REQUEST_ID}" ]; then
-  CONCOURSE_VERSION=$(cat ${GEODE_BUILD_VERSION_FILE})
-  CONCOURSE_PRODUCT_VERSION=${CONCOURSE_VERSION%%-*}
-  GEODE_PRODUCT_VERSION=${GEODE_BUILD_VERSION_NUMBER}
-  CONCOURSE_BUILD_SLUG=${CONCOURSE_VERSION##*-}
-  BUILD_ID=${CONCOURSE_VERSION##*.}
-  FULL_PRODUCT_VERSION=${GEODE_PRODUCT_VERSION}-${CONCOURSE_BUILD_SLUG}
-  echo "Concourse VERSION is ${CONCOURSE_VERSION}"
-  echo "Geode product VERSION is ${GEODE_PRODUCT_VERSION}"
-  echo "Build ID is ${BUILD_ID}"
-else
-  FULL_PRODUCT_VERSION="geode-pr-${GEODE_PULL_REQUEST_ID}"
-fi
-
-echo -n "${FULL_PRODUCT_VERSION}" > ${GEODE_RESULTS_VERSION_FILE}
-
-
-printf "\nUsing the following JDK:"
-java -version
-printf "\n\n"
-
-gcloud config set account ${SERVICE_ACCOUNT}
-
-export TERM=${TERM:-dumb}
-export DEST_DIR=${ROOT_DIR}/built-geode
-export TMPDIR=${DEST_DIR}/tmp
-mkdir -p ${TMPDIR}
-export BUILD_ARTIFACTS_DIR=${DEST_DIR}/test-artifacts
-mkdir -p ${BUILD_ARTIFACTS_DIR}
-
-ln -s ${ROOT_DIR}/geode ${GEODE_BUILD_DIR}
-
-pushd ${GEODE_BUILD_DIR}
-  set +e
-  set -x
-    ./gradlew --no-daemon --parallel -PbuildId=${BUILD_ID} --system-prop "java.io.tmpdir=${TMPDIR}" \
-      build install
-    GRADLE_EXIT_STATUS=$?
-  set +x
-  set -e
-popd
-
-ARTIFACTS_DESTINATION="${ARTIFACT_BUCKET}/builds/${FULL_PRODUCT_VERSION}"
-TEST_RESULTS_DESTINATION="${ARTIFACTS_DESTINATION}/test-results/build/"
-FULL_BUILD_ARCHIVE_DESTINATION="${ARTIFACTS_DESTINATION}/geodefiles-${FULL_PRODUCT_VERSION}.tgz"
-BUILD_ARTIFACTS_FILENAME=geode-build-artifacts-${FULL_PRODUCT_VERSION}.tgz
-BUILD_ARTIFACTS_DESTINATION="${ARTIFACTS_DESTINATION}/${BUILD_ARTIFACTS_FILENAME}"
-
-function sendFailureJobEmail {
-  echo "Sending job failure email"
-
-  cat <<EOF >${EMAIL_SUBJECT}
-Build for version ${FULL_PRODUCT_VERSION} of Apache Geode failed.
-EOF
-
-  cat <<EOF >${EMAIL_BODY}
-=================================================================================================
-
-The build job for Apache Geode version ${FULL_PRODUCT_VERSION} has failed.
-
-
-Build artifacts are available at:
-http://${BUILD_ARTIFACTS_DESTINATION}
-
-Test results are available at:
-http://${TEST_RESULTS_DESTINATION}
-
-
-Job: \${ATC_EXTERNAL_URL}/teams/\${BUILD_TEAM_NAME}/pipelines/\${BUILD_PIPELINE_NAME}/jobs/\${BUILD_JOB_NAME}/builds/\${BUILD_NAME}
-
-=================================================================================================
-EOF
-
-}
-
-if [ ! -d "geode/build/reports/combined" ]; then
-    echo "No tests exist, compile failed."
-    mkdir -p geode/build/reports/combined
-    echo "<html><head><title>No Test Results Were Captured</title></head><body><h1>No Test Results Were Captured</h1></body></html>" > geode/build/reports/combined/index.html
-fi
-
-pushd geode/build/reports/combined
-  gsutil -q -m cp -r * gs://${TEST_RESULTS_DESTINATION}
-popd
-
-echo ""
-printf "\033[92m=-=-=-=-=-=-=-=-=-=-=-=-=-=  Test Results Website =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\033[0m\n"
-printf "\033[92mhttp://${TEST_RESULTS_DESTINATION}\033[0m\n"
-printf "\033[92m=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\033[0m\n"
-printf "\n"
-
-tar zcf ${DEST_DIR}/geodefiles-${FULL_PRODUCT_VERSION}.tgz geode
-gsutil cp ${DEST_DIR}/geodefiles-${FULL_PRODUCT_VERSION}.tgz gs://${FULL_BUILD_ARCHIVE_DESTINATION}
-
-cp -r geode/geode-assembly/build/distributions ${BUILD_ARTIFACTS_DIR}/
-cp -r geode/build/reports/rat ${BUILD_ARTIFACTS_DIR}/
-cp -r geode/build/reports/combined ${BUILD_ARTIFACTS_DIR}/
-
-directories_file=${DEST_DIR}/artifact_directories
-
-pushd geode
-  find . -name "*-progress*txt" >> ${directories_file}
-  echo "Collecting the following artifacts..."
-  cat ${directories_file}
-  echo ""
-  mkdir -p ${BUILD_ARTIFACTS_DIR}/progress
-  tar cf - -T ${directories_file} | (cd ${BUILD_ARTIFACTS_DIR}/progress; tar xpf -)
-popd
-
-pushd ${BUILD_ARTIFACTS_DIR}
-  tar zcf ${DEST_DIR}/${BUILD_ARTIFACTS_FILENAME} .
-popd
-
-gsutil -q cp ${DEST_DIR}/${BUILD_ARTIFACTS_FILENAME} gs://${BUILD_ARTIFACTS_DESTINATION}
-printf "\033[92mBuild artifacts from this job are available at:\033[0m\n"
-printf "\n"
-printf "\033[92mhttp://${BUILD_ARTIFACTS_DESTINATION}\033[0m\n"
-
-if [ ${GRADLE_EXIT_STATUS} -ne 0 ]; then
-    sendFailureJobEmail
-fi
-
-exit ${GRADLE_EXIT_STATUS}
diff --git a/ci/scripts/publish.sh b/ci/scripts/publish.sh
deleted file mode 100755
index 953d92f..0000000
--- a/ci/scripts/publish.sh
+++ /dev/null
@@ -1,96 +0,0 @@
-#!/usr/bin/env bash
-
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-
-set -e
-ROOT_DIR=$(pwd)
-BUILD_DATE=$(date +%s)
-EMAIL_SUBJECT="results/subject"
-EMAIL_BODY="results/body"
-
-GEODE_BUILD_VERSION_FILE=${ROOT_DIR}/geode-build-version/number
-GEODE_RESULTS_VERSION_FILE=${ROOT_DIR}/results/number
-GEODE_BUILD_VERSION_NUMBER=$(grep "versionNumber *=" geode/gradle.properties | awk -F "=" '{print $2}' | tr -d ' ')
-GEODE_BUILD_DIR=/tmp/geode-build
-GEODE_PULL_REQUEST_ID_FILE=${ROOT_DIR}/geode/.git/id
-if [ -e "${GEODE_PULL_REQUEST_ID_FILE}" ]; then
-  GEODE_PULL_REQUEST_ID=$(cat ${GEODE_PULL_REQUEST_ID_FILE})
-fi
-
-if [ ! -e "${GEODE_BUILD_VERSION_FILE}" ] && [ -z "${GEODE_PULL_REQUEST_ID}" ]; then
-  echo "${GEODE_BUILD_VERSION_FILE} file does not exist. Concourse is probably not configured correctly."
-  exit 1
-fi
-if [ -z ${MAINTENANCE_VERSION+x} ]; then
-  echo "MAINTENANCE_VERSION is unset. Check your pipeline configuration and make sure this script is called properly."
-  exit 1
-fi
-if [ -z ${SERVICE_ACCOUNT+x} ]; then
-  echo "SERVICE_ACCOUNT is unset. Check your pipeline configuration and make sure this script is called properly."
-  exit 1
-fi
-
-if [ -z ${ARTIFACT_BUCKET+x} ]; then
-  echo "ARTIFACT_BUCKET is unset. Check your pipeline configuration and make sure this script is called properly."
-  exit 1
-fi
-
-if [ -z ${GEODE_BUILD_VERSION_NUMBER+x} ]; then
-  echo "gradle.properties does not seem to contain a valid versionNumber. Please check the source tree."
-  exit 1
-fi
-
-if [ -z "${GEODE_PULL_REQUEST_ID}" ]; then
-  CONCOURSE_VERSION=$(cat ${GEODE_BUILD_VERSION_FILE})
-  CONCOURSE_PRODUCT_VERSION=${CONCOURSE_VERSION%%-*}
-  GEODE_PRODUCT_VERSION=${GEODE_BUILD_VERSION_NUMBER}
-  CONCOURSE_BUILD_SLUG=${CONCOURSE_VERSION##*-}
-  BUILD_ID=${CONCOURSE_VERSION##*.}
-  FULL_PRODUCT_VERSION=${GEODE_PRODUCT_VERSION}-${CONCOURSE_BUILD_SLUG}
-  echo "Concourse VERSION is ${CONCOURSE_VERSION}"
-  echo "Geode product VERSION is ${GEODE_PRODUCT_VERSION}"
-  echo "Build ID is ${BUILD_ID}"
-else
-  FULL_PRODUCT_VERSION="geode-pr-${GEODE_PULL_REQUEST_ID}"
-fi
-
-printf "\nUsing the following JDK:"
-java -version
-printf "\n\n"
-
-gcloud config set account ${SERVICE_ACCOUNT}
-
-export TERM=${TERM:-dumb}
-export DEST_DIR=${ROOT_DIR}/built-geode
-export TMPDIR=${DEST_DIR}/tmp
-mkdir -p ${TMPDIR}
-export BUILD_ARTIFACTS_DIR=${DEST_DIR}/test-artifacts
-mkdir -p ${BUILD_ARTIFACTS_DIR}
-
-ln -s ${ROOT_DIR}/geode ${GEODE_BUILD_DIR}
-
-pushd ${GEODE_BUILD_DIR}
-  set +e
-  set -x
-  ./gradlew --no-daemon --parallel -PbuildId=${BUILD_ID} publish
-  GRADLE_EXIT_STATUS=$?
-  set +x
-popd
-
-exit ${GRADLE_EXIT_STATUS}
diff --git a/ci/scripts/test-archive.sh b/ci/scripts/test-archive.sh
deleted file mode 100755
index 108ab54..0000000
--- a/ci/scripts/test-archive.sh
+++ /dev/null
@@ -1,130 +0,0 @@
-#!/usr/local/bin/tini-wrapper /bin/bash
-
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-set -e
-
-export TERM=${TERM:-dumb}
-export BUILDROOT=$(pwd)
-export DEST_DIR=${BUILDROOT}/built-geode
-export GRADLE_TASK=${1}
-export SANITIZED_GRADLE_TASK=${GRADLE_TASK##*:}
-export BASE_FILENAME=${2}
-export TMPDIR=${DEST_DIR}/tmp
-export GEODE_BUILD=${DEST_DIR}/test
-export GEODE_BUILD_VERSION_NUMBER=$(grep "versionNumber *=" geode/gradle.properties | awk -F "=" '{print $2}' | tr -d ' ')
-export BUILD_TIMESTAMP=$(date +%s)
-GEODE_PULL_REQUEST_ID_FILE=${BUILDROOT}/geode/.git/id
-if [ -e "${GEODE_PULL_REQUEST_ID_FILE}" ]; then
-  GEODE_PULL_REQUEST_ID=$(cat ${GEODE_PULL_REQUEST_ID_FILE})
-fi
-
-
-GEODE_BUILD_VERSION_FILE=${BUILDROOT}/geode-build-version/number
-
-if [ ! -e "${GEODE_BUILD_VERSION_FILE}" ] && [ -z "${GEODE_PULL_REQUEST_ID}" ]; then
-  echo "${GEODE_BUILD_VERSION_FILE} file does not exist. Concourse is probably not configured correctly."
-  exit 1
-fi
-if [ -z ${MAINTENANCE_VERSION+x} ]; then
-  echo "MAINTENANCE_VERSION is unset. Check your pipeline configuration and make sure this script is called properly."
-  exit 1
-fi
-
-EMAIL_SUBJECT="${BUILDROOT}/built-geode/subject"
-EMAIL_BODY="${BUILDROOT}/built-geode/body"
-
-# Called by trap when the script is exiting
-function error_exit() {
-  echo "Geode unit tests completed in '\${BUILD_PIPELINE_NAME}/\${BUILD_JOB_NAME}' with non-zero exit code" > $EMAIL_SUBJECT
-  echo "Pipeline results can be found at:" >$EMAIL_BODY
-  echo "" >>$EMAIL_BODY
-  echo "Concourse: \${ATC_EXTERNAL_URL}/teams/\${BUILD_TEAM_NAME}/pipelines/\${BUILD_PIPELINE_NAME}/jobs/\${BUILD_JOB_NAME}/builds/\${BUILD_NAME}" >>$EMAIL_BODY
-  echo "" >>$EMAIL_BODY
-}
-
-trap error_exit ERR
-
-if [ -z "${GEODE_PULL_REQUEST_ID}" ]; then
-CONCOURSE_VERSION=$(cat ${GEODE_BUILD_VERSION_FILE})
-  CONCOURSE_PRODUCT_VERSION=${CONCOURSE_VERSION%%-*}
-  GEODE_PRODUCT_VERSION=${GEODE_BUILD_VERSION_NUMBER}
-  CONCOURSE_BUILD_SLUG=${CONCOURSE_VERSION##*-}
-  BUILD_ID=${CONCOURSE_VERSION##*.}
-  FULL_PRODUCT_VERSION=${GEODE_PRODUCT_VERSION}-${CONCOURSE_BUILD_SLUG}
-
-  echo "Concourse VERSION is ${CONCOURSE_VERSION}"
-  echo "Geode product VERSION is ${GEODE_PRODUCT_VERSION}"
-  echo "Build ID is ${BUILD_ID}"
-else
-  FULL_PRODUCT_VERSION="geode-pr-${GEODE_PULL_REQUEST_ID}"
-fi
-
-
-directories_file=${DEST_DIR}/artifact_directories
-mkdir -p ${TMPDIR}
-
-echo "TMPDIR = ${TMPDIR}"
-echo "GRADLE_TASK = ${GRADLE_TASK}"
-echo "BASE_FILENAME = ${BASE_FILENAME}"
-
-gcloud config set account ${SERVICE_ACCOUNT}
-
-
-export FILENAME=${BASE_FILENAME}-${FULL_PRODUCT_VERSION}.tgz
-
-pushd ${GEODE_BUILD}
-
-  set +e
-  ./gradlew combineReports
-  find . -type d -name "reports" > ${directories_file}
-  find . -type d -name "test-results" >> ${directories_file}
-  (find . -type d -name "*Test" | grep "build/[^/]*Test$") >> ${directories_file}
-  find . -name "*-progress*txt" >> ${directories_file}
-  find . -type d -name "callstacks" >> ${directories_file}
-  echo "Collecting the following artifacts..."
-  cat ${directories_file}
-  echo ""
-  tar zcf ${DEST_DIR}/${FILENAME} -T ${directories_file}
-popd
-
-ARTIFACTS_DESTINATION="${ARTIFACT_BUCKET}/builds/${FULL_PRODUCT_VERSION}"
-TEST_RESULTS_DESTINATION="${ARTIFACTS_DESTINATION}/test-results/${SANITIZED_GRADLE_TASK}/${BUILD_TIMESTAMP}/"
-TEST_ARTIFACTS_DESTINATION="${ARTIFACTS_DESTINATION}/test-artifacts/${BUILD_TIMESTAMP}/"
-
-
-if [ ! -d "${GEODE_BUILD}/build/reports/combined" ]; then
-    echo "No tests exist, compile failed."
-    mkdir -p ${GEODE_BUILD}/build/reports/combined
-    echo "<html><head><title>No Test Results Were Captured</title></head><body><h1>No Test Results Were Captured</h1></body></html>" > ${GEODE_BUILD}/build/reports/combined/index.html
-fi
-
-pushd ${GEODE_BUILD}/build/reports/combined
-gsutil -q -m cp -r * gs://${TEST_RESULTS_DESTINATION}
-popd
-
-echo ""
-printf "\033[92m=-=-=-=-=-=-=-=-=-=-=-=-=-=  Test Results Website =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\033[0m\n"
-printf "\033[92mhttp://${TEST_RESULTS_DESTINATION}\033[0m\n"
-printf "\033[92m=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\033[0m\n"
-printf "\n"
-
-gsutil cp ${DEST_DIR}/${FILENAME} gs://${TEST_ARTIFACTS_DESTINATION}
-
-printf "\033[92mTest artifacts from this job are available at:\033[0m\n"
-printf "\n"
-printf "\033[92mhttp://${TEST_ARTIFACTS_DESTINATION}${FILENAME}\033[0m\n"