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

[geode] branch develop updated: GEODE-5538 create examples pipeline

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

jbarrett 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 895fdce  GEODE-5538 create examples pipeline
895fdce is described below

commit 895fdce48231b2113b054b785621346377d7463c
Author: Finn Southerland <fs...@pivotal.io>
AuthorDate: Tue Aug 7 14:19:36 2018 -0700

    GEODE-5538 create examples pipeline
---
 ci/pipelines/deploy_meta.sh              |  2 +
 ci/pipelines/examples/deploy_pipeline.sh | 88 ++++++++++++++++++++++++++++++++
 ci/pipelines/examples/examples.yml       | 84 ++++++++++++++++++++++++++++++
 ci/pipelines/geode-build/base.yml        | 39 --------------
 ci/pipelines/meta.yml                    | 32 ++++++++++++
 5 files changed, 206 insertions(+), 39 deletions(-)

diff --git a/ci/pipelines/deploy_meta.sh b/ci/pipelines/deploy_meta.sh
index 611164f..a76ac66 100755
--- a/ci/pipelines/deploy_meta.sh
+++ b/ci/pipelines/deploy_meta.sh
@@ -53,5 +53,7 @@ if [[ "${GEODE_FORK}" != "apache" ]]; then
   -j ${META_PIPELINE}/set-pr-pipeline
   fly -t ${TARGET} pause-job \
   -j ${META_PIPELINE}/set-metrics-pipeline
+  fly -t ${TARGET} pause-job \
+  -j ${META_PIPELINE}/set-reaper-pipeline
   set +x
 fi
\ No newline at end of file
diff --git a/ci/pipelines/examples/deploy_pipeline.sh b/ci/pipelines/examples/deploy_pipeline.sh
new file mode 100755
index 0000000..825ea3c
--- /dev/null
+++ b/ci/pipelines/examples/deploy_pipeline.sh
@@ -0,0 +1,88 @@
+#!/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.
+
+SOURCE="${BASH_SOURCE[0]}"
+while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
+  SCRIPTDIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
+  SOURCE="$(readlink "$SOURCE")"
+  [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
+done
+SCRIPTDIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
+
+if ! [ -x "$(command -v spruce)" ]; then
+    echo "Spruce must be installed for pipeline deployment to work."
+    echo "For macos: 'brew tap starkandwayne/cf; brew install spruce'"
+    echo "For Ubuntu: follow the instructions at https://github.com/geofffranks/spruce"
+    echo ""
+    exit 1
+else
+    SPRUCE=$(which spruce || true)
+fi
+
+set -e
+
+if [ -z "${GEODE_BRANCH}" ]; then
+  GEODE_BRANCH=$(git rev-parse --abbrev-ref HEAD)
+fi
+
+if [ "${GEODE_BRANCH}" = "HEAD" ]; then
+  echo "Unable to determine branch for deployment. Quitting..."
+  exit 1
+fi
+
+SANITIZED_GEODE_BRANCH=$(echo ${GEODE_BRANCH} | tr "/" "-" | tr '[:upper:]' '[:lower:]')
+
+BIN_DIR=${OUTPUT_DIRECTORY}/bin
+TMP_DIR=${OUTPUT_DIRECTORY}/tmp
+mkdir -p ${BIN_DIR} ${TMP_DIR}
+curl -o ${BIN_DIR}/fly "https://concourse.apachegeode-ci.info/api/v1/cli?arch=amd64&platform=linux"
+chmod +x ${BIN_DIR}/fly
+
+PATH=${PATH}:${BIN_DIR}
+
+echo "Spruce branch-name into resources"
+${SPRUCE} merge --prune metadata \
+  ${SCRIPTDIR}/examples.yml \
+  <(echo "metadata:"; \
+    echo "  geode-build-branch: ${GEODE_BRANCH}"; \
+    echo "  geode-fork: ${GEODE_FORK}"; \
+    echo "  ") > ${TMP_DIR}/final.yml
+
+
+TARGET="geode"
+
+TEAM="staging"
+if [[ "${GEODE_BRANCH}" == "develop" ]] || [[ ${GEODE_BRANCH} =~ ^release/* ]]; then
+  TEAM="main"
+fi
+
+if [[ "${GEODE_FORK}" == "apache" ]]; then
+  PIPELINE_NAME=${SANITIZED_GEODE_BRANCH}
+  DOCKER_IMAGE_PREFIX=""
+else
+  PIPELINE_NAME="${GEODE_FORK}-${SANITIZED_GEODE_BRANCH}"
+  DOCKER_IMAGE_PREFIX="${PIPELINE_NAME}-"
+fi
+PIPELINE_NAME="${PIPELINE_NAME}-examples"
+
+fly login -t ${TARGET} -n ${TEAM} -c https://concourse.apachegeode-ci.info -u ${CONCOURSE_USERNAME} -p ${CONCOURSE_PASSWORD}
+fly -t ${TARGET} set-pipeline --non-interactive \
+  --pipeline ${PIPELINE_NAME} \
+  --var docker-image-prefix=${DOCKER_IMAGE_PREFIX} \
+  --config ${TMP_DIR}/final.yml
+
diff --git a/ci/pipelines/examples/examples.yml b/ci/pipelines/examples/examples.yml
new file mode 100644
index 0000000..79dd2bd
--- /dev/null
+++ b/ci/pipelines/examples/examples.yml
@@ -0,0 +1,84 @@
+#
+# 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.
+#
+
+---
+
+resource_types:
+- name: maven-resource
+  type: docker-image
+  source:
+    repository: nulldriver/maven-resource
+    tag: latest
+
+resources:
+- name: geode-examples
+  type: git
+  source:
+    uri: https://github.com/apache/geode-examples.git
+    branch: develop
+    depth: 10
+- name: geode-ci
+  type: git
+  source:
+    depth: 1
+    uri: (( concat "https://github.com/" metadata.geode-fork "/geode.git" ))
+    branch: (( grab metadata.geode-build-branch ))
+    paths:
+    - ci/pipelines/geode-build/*
+    - ci/scripts/*
+- name: docker-geode-build-image
+  type: docker-image
+  source:
+    username: ((!docker-username))
+    password: ((!docker-password))
+    repository: gcr.io/apachegeode-ci/((!docker-image-prefix))((!docker-image-name))
+    tag: latest
+- name: 24h
+  type: time
+  source: {interval: 24h}
+
+jobs:
+- name: TestExamples
+  serial: true
+  public: true
+  plan:
+  - aggregate:
+    - get: geode-ci
+    - get: geode-examples
+      trigger: true
+    - get: 24h
+      trigger: true
+    - get: docker-geode-build-image
+      params:
+        rootfs: true
+  - task: testexamples
+    image: docker-geode-build-image
+    privileged: true
+    timeout: 7h
+    config:
+      inputs:
+      - name: geode-ci
+      - name: geode-examples
+      - name: docker-geode-build-image
+      platform: linux
+      params:
+        MAINTENANCE_VERSION: (( grab metadata.geode-build-branch ))
+        SERVICE_ACCOUNT: ((!concourse-gcp-account))
+        PUBLIC_BUCKET: ((!public-bucket))
+      run:
+        args:
+        path: geode-ci/ci/scripts/build-examples.sh
diff --git a/ci/pipelines/geode-build/base.yml b/ci/pipelines/geode-build/base.yml
index 9773262..93d41aa 100644
--- a/ci/pipelines/geode-build/base.yml
+++ b/ci/pipelines/geode-build/base.yml
@@ -59,12 +59,6 @@ resources:
     paths:
     - ci/pipelines/geode-build/*
     - ci/scripts/*
-- name: geode-examples
-  type: git
-  source:
-    uri: https://github.com/apache/geode-examples.git
-    branch: develop
-    depth: 10
 - name: geode-build-version
   type: semver
   source:
@@ -100,7 +94,6 @@ groups:
   - AcceptanceTest
   - IntegrationTest
   - UpgradeTest
-  - TestExamples
   - UpdatePassingRef
 
 jobs:
@@ -150,38 +143,6 @@ jobs:
           - put: geode-build-version
             params:
               file: results/number
-- name: TestExamples
-  serial: true
-  public: true
-  plan:
-    - get: geode
-      passed: [AcceptanceTest, DistributedTest, IntegrationTest, UpgradeTest]
-      trigger: true
-    - aggregate:
-      - get: geode-ci
-      - get: geode-examples
-        trigger: true
-      - get: docker-geode-build-image
-        params:
-          rootfs: true
-    - task: testexamples
-      image: docker-geode-build-image
-      privileged: true
-      timeout: 7h
-      config:
-        inputs:
-          - name: geode-ci
-          - name: geode-examples
-          - name: docker-geode-build-image
-        platform: linux
-        params:
-          MAINTENANCE_VERSION: (( grab metadata.geode-build-branch ))
-          SERVICE_ACCOUNT: ((!concourse-gcp-account))
-          PUBLIC_BUCKET: ((!public-bucket))
-        run:
-          args:
-          path: geode-ci/ci/scripts/build-examples.sh
-
 - name: UpdatePassingRef
   serial: true
   public: true
diff --git a/ci/pipelines/meta.yml b/ci/pipelines/meta.yml
index 3c37cf5..542df7a 100644
--- a/ci/pipelines/meta.yml
+++ b/ci/pipelines/meta.yml
@@ -39,6 +39,13 @@ resources:
     branch: ((!geode-build-branch))
     paths:
     - ci/pipelines/geode-build/*
+- name: geode-examples-pipeline
+  type: git
+  source:
+    uri: https://github.com/((!geode-fork))/geode.git
+    branch: ((!geode-build-branch))
+    paths:
+    - ci/pipelines/examples/*
 - name: geode-pr-pipeline
   type: git
   source:
@@ -101,6 +108,31 @@ jobs:
       run:
         path: geode-pipeline/ci/pipelines/geode-build/deploy_pipeline.sh
 
+- name: set-examples-pipeline
+  serial: true
+  public: ((!public-pipelines))
+  plan:
+  - get: geode-examples-pipeline
+    trigger: true
+  - get: apachegeode-build-concourse-docker-image
+  - task: deploy-build
+    image: apachegeode-build-concourse-docker-image
+    config:
+      inputs:
+      - name: geode-examples-pipeline
+      outputs:
+      - name: results
+      platform: linux
+      params:
+        OUTPUT_DIRECTORY: results
+        GEODE_BRANCH: ((!geode-build-branch))
+        GEODE_FORK: ((!geode-fork))
+        CONCOURSE_USERNAME: ((!concourse-username))
+        CONCOURSE_PASSWORD: ((!concourse-password))
+        CONCOURSE_TEAM: ((!concourse-team))
+      run:
+        path: geode-examples-pipeline/ci/pipelines/examples/deploy_pipeline.sh
+
 - name: set-pr-pipeline
   serial: true
   public: ((!public-pipelines))