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 b6158bf GEODE-5864: Adds support for private/public github.
b6158bf is described below
commit b6158bf09a1e5e832d6d564a1b780096084c598b
Author: Jacob Barrett <[email protected]>
AuthorDate: Wed Oct 17 11:16:05 2018 -0700
GEODE-5864: Adds support for private/public github.
Co-authored-by: Robert Houghton <[email protected]>
Co-authored-by: Jacob Barrett <[email protected]>
---
ci/pipelines/examples/jinja.template.yml | 2 ++
ci/pipelines/geode-build/deploy_pipeline.sh | 2 +-
ci/pipelines/geode-build/jinja.template.yml | 7 +++++--
ci/pipelines/images/deploy_images_pipeline.sh | 7 +++++++
.../images/{images.yml => jinja.template.yml} | 19 +++++++++++--------
ci/pipelines/meta/deploy_meta.sh | 3 ++-
ci/pipelines/meta/jinja.template.yml | 21 +++++++++++++--------
ci/pipelines/pull-request/deploy_pr_pipeline.sh | 2 +-
ci/pipelines/render.py | 6 ++++--
ci/pipelines/shared/shared_jinja.yml | 8 ++++++++
10 files changed, 54 insertions(+), 23 deletions(-)
diff --git a/ci/pipelines/examples/jinja.template.yml
b/ci/pipelines/examples/jinja.template.yml
index 49d000d..661d3de 100644
--- a/ci/pipelines/examples/jinja.template.yml
+++ b/ci/pipelines/examples/jinja.template.yml
@@ -15,6 +15,8 @@
# limitations under the License.
#
+{% from 'shared/shared_jinja.yml' import github_access with context %}
+
---
resource_types:
diff --git a/ci/pipelines/geode-build/deploy_pipeline.sh
b/ci/pipelines/geode-build/deploy_pipeline.sh
index 69206f9..0cce6ae 100755
--- a/ci/pipelines/geode-build/deploy_pipeline.sh
+++ b/ci/pipelines/geode-build/deploy_pipeline.sh
@@ -55,7 +55,7 @@ VERSION_BUCKET="concourse-${ENV_ID}-version"
#echo "Pipeline prefix = ${PIPELINE_PREFIX}"
#echo "Docker image prefix = ${DOCKER_IMAGE_PREFIX}"]
pushd ${SCRIPTDIR} 2>&1 > /dev/null
- python3 ../render.py $(basename ${SCRIPTDIR}) ${GEODE_FORK} ${GEODE_BRANCH}
${UPSTREAM_FORK} || exit 1
+ python3 ../render.py $(basename ${SCRIPTDIR}) ${GEODE_FORK} ${GEODE_BRANCH}
${UPSTREAM_FORK} ${REPOSITORY_PUBLIC} || exit 1
popd 2>&1 > /dev/null
cp ${SCRIPTDIR}/generated-pipeline.yml
${OUTPUT_DIRECTORY}/generated-pipeline.yml
diff --git a/ci/pipelines/geode-build/jinja.template.yml
b/ci/pipelines/geode-build/jinja.template.yml
index b97c9d4..5195a83 100644
--- a/ci/pipelines/geode-build/jinja.template.yml
+++ b/ci/pipelines/geode-build/jinja.template.yml
@@ -17,6 +17,9 @@
{% from 'shared/shared_jinja.yml' import alpine_tools_config with context %}
{% from 'shared/shared_jinja.yml' import pipeline_prefix with context %}
+{% from 'shared/shared_jinja.yml' import github_access with context %}
+
+---
{% macro plan_resource_gets() %}
- get: geode-ci
@@ -150,7 +153,7 @@ resources:
depth: 1
ignore_paths:
- ci/*
- uri: https://github.com/((geode-fork))/{{repository.project}}.git
+ {{ github_access() | indent(4) }}
- name: geode-ci
type: git
source:
@@ -159,7 +162,7 @@ resources:
paths:
- ci/pipelines/geode-build/*
- ci/scripts/*
- uri: https://github.com/((geode-fork))/{{repository.project}}.git
+ {{ github_access() | indent(4) }}
- name: geode-build-version
type: semver
source:
diff --git a/ci/pipelines/images/deploy_images_pipeline.sh
b/ci/pipelines/images/deploy_images_pipeline.sh
index 953ce52..7ac30aa 100755
--- a/ci/pipelines/images/deploy_images_pipeline.sh
+++ b/ci/pipelines/images/deploy_images_pipeline.sh
@@ -45,6 +45,13 @@ echo "Sanitized Goede Branch = ${SANITIZED_GEODE_BRANCH}"
#echo "Pipeline prefix = ${PIPELINE_PREFIX}"
#echo "Docker image prefix = ${DOCKER_IMAGE_PREFIX}"
+pushd ${SCRIPTDIR} 2>&1 > /dev/null
+ python3 ../render.py $(basename ${SCRIPTDIR}) ${GEODE_FORK} ${GEODE_BRANCH}
${UPSTREAM_FORK} ${REPOSITORY_PUBLIC} || exit 1
+popd 2>&1 > /dev/null
+cp ${SCRIPTDIR}/generated-pipeline.yml
${OUTPUT_DIRECTORY}/generated-pipeline.yml
+
+grep -n . ${OUTPUT_DIRECTORY}/generated-pipeline.yml
+
cat > ${OUTPUT_DIRECTORY}/pipeline-vars.yml <<YML
geode-build-branch: ${GEODE_BRANCH}
geode-fork: ${GEODE_FORK}
diff --git a/ci/pipelines/images/images.yml
b/ci/pipelines/images/jinja.template.yml
similarity index 94%
rename from ci/pipelines/images/images.yml
rename to ci/pipelines/images/jinja.template.yml
index 9be47ff..9dde1c3 100644
--- a/ci/pipelines/images/images.yml
+++ b/ci/pipelines/images/jinja.template.yml
@@ -15,12 +15,15 @@
# limitations under the License.
#
+{% from 'shared/shared_jinja.yml' import github_access with context %}
+
---
+
resources:
- name: build-concourse-dockerfile
type: git
source:
- uri: https://github.com/((geode-fork))/geode.git
+ {{ github_access() | indent(4) }}
branch: ((geode-build-branch))
paths:
- ci/docker/*
@@ -41,7 +44,7 @@ resources:
- name: google-geode-builder
type: git
source:
- uri: https://github.com/((geode-fork))/geode.git
+ {{ github_access() | indent(4) }}
branch: ((geode-build-branch))
paths:
- ci/images/google-geode-builder
@@ -49,7 +52,7 @@ resources:
- name: google-windows-geode-builder
type: git
source:
- uri: https://github.com/((geode-fork))/geode.git
+ {{ github_access() | indent(4) }}
branch: ((geode-build-branch))
paths:
- ci/images/google-windows-geode-builder
@@ -64,7 +67,7 @@ resources:
- name: alpine-tools-dockerfile
type: git
source:
- uri: https://github.com/((geode-fork))/geode.git
+ {{ github_access() | indent(4) }}
branch: ((geode-build-branch))
paths:
- ci/images/alpine-tools/*
@@ -79,7 +82,7 @@ resources:
- name: test-container-dockerfile
type: git
source:
- uri: https://github.com/((geode-fork))/geode.git
+ {{ github_access() | indent(4) }}
branch: ((geode-build-branch))
paths:
- ci/images/test-container/*
@@ -94,7 +97,7 @@ resources:
- name: concourse-metadata-resource-dockerfile
type: git
source:
- uri: https://github.com/((geode-fork))/geode.git
+ {{ github_access() | indent(4) }}
branch: ((geode-build-branch))
paths:
- ci/resource-types/concourse-metadata-resource/*
@@ -109,7 +112,7 @@ resources:
- name: metric-tools-dockerfile
type: git
source:
- uri: https://github.com/((geode-fork))/geode.git
+ {{ github_access() | indent(4) }}
branch: ((geode-build-branch))
paths:
- ci/images/metric-tools/*
@@ -124,7 +127,7 @@ resources:
- name: gce-instances-resource-dockerfile
type: git
source:
- uri: https://github.com/((geode-fork))/geode.git
+ {{ github_access() | indent(4) }}
branch: ((geode-build-branch))
paths:
- ci/resource-types/gce-instances-resource/*
diff --git a/ci/pipelines/meta/deploy_meta.sh b/ci/pipelines/meta/deploy_meta.sh
index 1517ada..5bb2657 100755
--- a/ci/pipelines/meta/deploy_meta.sh
+++ b/ci/pipelines/meta/deploy_meta.sh
@@ -55,6 +55,7 @@ UPSTREAM_FORK=${3:-"apache"}
CONCOURSE_HOST=${4:-"concourse.apachegeode-ci.info"}
ARTIFACT_BUCKET=${5:-"files.apachegeode-ci.info"}
PUBLIC=${6:-"true"}
+REPOSITORY_PUBLIC=${7:-"true"}
if [[ "${CONCOURSE_HOST}" == "concourse.apachegeode-ci.info" ]]; then
CONCOURSE_SCHEME=https
fi
@@ -77,7 +78,7 @@ fi
pushd ${SCRIPTDIR} 2>&1 > /dev/null
# Template and output share a directory with this script, but variables are
shared in the parent directory.
- python3 ../render.py $(basename ${SCRIPTDIR}) ${GEODE_FORK} ${GEODE_BRANCH}
${UPSTREAM_FORK} || exit 1
+ python3 ../render.py $(basename ${SCRIPTDIR}) ${GEODE_FORK} ${GEODE_BRANCH}
${UPSTREAM_FORK} ${REPOSITORY_PUBLIC} || exit 1
fly -t ${FLY_TARGET} sync
fly -t ${FLY_TARGET} set-pipeline \
diff --git a/ci/pipelines/meta/jinja.template.yml
b/ci/pipelines/meta/jinja.template.yml
index 3626f75..8004bd5 100644
--- a/ci/pipelines/meta/jinja.template.yml
+++ b/ci/pipelines/meta/jinja.template.yml
@@ -15,6 +15,8 @@
# limitations under the License.
#
+{% from 'shared/shared_jinja.yml' import github_access with context %}
+
---
resource_types:
- name: concourse-pipeline
@@ -35,7 +37,7 @@ resources:
- name: geode-pipeline
type: git
source:
- uri: https://github.com/((!geode-fork))/((geode-repo-name)).git
+ {{ github_access() | indent(4) }}
branch: ((!geode-build-branch))
paths:
- ci/pipelines/geode-build/*
@@ -44,21 +46,21 @@ resources:
- name: geode-images-pipeline
type: git
source:
- uri: https://github.com/((!geode-fork))/((geode-repo-name)).git
+ {{ github_access() | indent(4) }}
branch: ((!geode-build-branch))
paths:
- ci/pipelines/images/*
- name: geode-reaper-pipeline
type: git
source:
- uri: https://github.com/((!geode-fork))/((geode-repo-name)).git
+ {{ github_access() | indent(4) }}
branch: ((!geode-build-branch))
paths:
- ci/pipelines/reaper.yml
- name: meta-mini-dockerfile
type: git
source:
- uri: https://github.com/((!geode-fork))/((geode-repo-name)).git
+ {{ github_access() | indent(4) }}
branch: ((!geode-build-branch))
paths:
- ci/images/meta-mini/*
@@ -72,7 +74,7 @@ resources:
- name: geode-examples-pipeline
type: git
source:
- uri: https://github.com/((!geode-fork))/((geode-repo-name)).git
+ {{ github_access() | indent(4) }}
branch: ((!geode-build-branch))
paths:
- ci/pipelines/examples/*
@@ -81,7 +83,7 @@ resources:
- name: geode-pr-pipeline
type: git
source:
- uri: https://github.com/((!geode-fork))/((geode-repo-name)).git
+ {{ github_access() | indent(4) }}
branch: ((!geode-build-branch))
paths:
- ci/pipelines/pull-request/*
@@ -90,7 +92,7 @@ resources:
- name: geode-metrics-pipeline
type: git
source:
- uri: https://github.com/((!geode-fork))/((geode-repo-name)).git
+ {{ github_access() | indent(4) }}
branch: ((!geode-build-branch))
paths:
- ci/pipelines/metrics.yml
@@ -122,6 +124,7 @@ jobs:
GEODE_BRANCH: ((geode-build-branch))
GEODE_FORK: ((geode-fork))
GEODE_REPO_NAME: ((geode-repo-name))
+ REPOSITORY_PUBLIC: {{ repository.public }}
UPSTREAM_FORK: {{ repository.upstream_fork }}
PIPELINE_PREFIX: ((pipeline-prefix))
SANITIZED_GEODE_BRANCH: ((sanitized-geode-build-branch))
@@ -135,7 +138,7 @@ jobs:
pipelines:
- name: ((!pipeline-prefix))images
team: ((!concourse-team))
- config_file: geode-images-pipeline/ci/pipelines/images/images.yml
+ config_file: results/generated-pipeline.yml
vars_files:
- results/pipeline-vars.yml
@@ -164,6 +167,7 @@ jobs:
GEODE_BRANCH: ((geode-build-branch))
GEODE_FORK: ((geode-fork))
GEODE_REPO_NAME: ((geode-repo-name))
+ REPOSITORY_PUBLIC: {{ repository.public }}
ARTIFACT_BUCKET: ((artifact-bucket))
UPSTREAM_FORK: {{ repository.upstream_fork }}
PIPELINE_PREFIX: ((pipeline-prefix))
@@ -239,6 +243,7 @@ jobs:
GEODE_BRANCH: ((!geode-build-branch))
GEODE_FORK: ((!geode-fork))
GEODE_REPO_NAME: ((geode-repo-name))
+ REPOSITORY_PUBLIC: {{ repository.public }}
ARTIFACT_BUCKET: ((artifact-bucket))
UPSTREAM_FORK: {{ repository.upstream_fork }}
PIPELINE_PREFIX: ((pipeline-prefix))
diff --git a/ci/pipelines/pull-request/deploy_pr_pipeline.sh
b/ci/pipelines/pull-request/deploy_pr_pipeline.sh
index 3b986f5..9677714 100755
--- a/ci/pipelines/pull-request/deploy_pr_pipeline.sh
+++ b/ci/pipelines/pull-request/deploy_pr_pipeline.sh
@@ -74,7 +74,7 @@ fi
pushd ${SCRIPTDIR} 2>&1 > /dev/null
# Template and output share a directory with this script, but variables are
shared in the parent directory.
- python3 ../render.py $(basename ${SCRIPTDIR}) ${GEODE_FORK} ${GEODE_BRANCH}
${UPSTREAM_FORK} || exit 1
+ python3 ../render.py $(basename ${SCRIPTDIR}) ${GEODE_FORK} ${GEODE_BRANCH}
${UPSTREAM_FORK} ${REPOSITORY_PUBLIC} || exit 1
popd 2>&1 > /dev/null
cp ${SCRIPTDIR}/generated-pipeline.yml
${OUTPUT_DIRECTORY}/generated-pipeline.yml
diff --git a/ci/pipelines/render.py b/ci/pipelines/render.py
index dd32661..62227be 100755
--- a/ci/pipelines/render.py
+++ b/ci/pipelines/render.py
@@ -26,7 +26,7 @@ import jinja2.exceptions
import os
import subprocess
-def main(template_dir_name, geode_fork, geode_branch, upstream_fork):
+def main(template_dir_name, geode_fork, geode_branch, upstream_fork,
repository_public):
script_dir_ = os.path.dirname(os.path.abspath(__file__))
shared_dir_ = os.path.join(script_dir_, 'shared')
@@ -48,6 +48,7 @@ def main(template_dir_name, geode_fork, geode_branch,
upstream_fork):
variables['repository']['branch'] = geode_branch
variables['repository']['fork'] = geode_fork
variables['repository']['upstream_fork'] = upstream_fork
+ variables['repository']['public'] = repository_public
# Use the one-true-way to truncate fork and branches, trimming the Python
bytestream characters from the front and
# back. If this is too ugly, then convert the BASH functions into python
files, and call that Python from the
@@ -79,6 +80,7 @@ if __name__ == '__main__':
parser.add_argument("geode_fork", help="Name of the git fork")
parser.add_argument("geode_branch", help="Branch against which
pull-requests are made")
parser.add_argument("upstream_fork", help="Name of the upstream into which
this fork would merge")
+ parser.add_argument("repository_public", help="Is repository public?")
# parser.add_argument("variables", help="Jinja variables file.")
# parser.add_argument("output", help="Output target.")
parser.add_argument("--debug", help="It's debug. If you have to ask,
you'll never know.", action="store_true")
@@ -90,5 +92,5 @@ if __name__ == '__main__':
logging.debug(f"cwd: {os.getcwd()}")
- main(_args.template_dir_name, _args.geode_fork, _args.geode_branch,
_args.upstream_fork)
+ main(_args.template_dir_name, _args.geode_fork, _args.geode_branch,
_args.upstream_fork, _args.repository_public)
diff --git a/ci/pipelines/shared/shared_jinja.yml
b/ci/pipelines/shared/shared_jinja.yml
index e387e22..694330b 100644
--- a/ci/pipelines/shared/shared_jinja.yml
+++ b/ci/pipelines/shared/shared_jinja.yml
@@ -30,3 +30,11 @@ config:
repository: gcr.io/((gcp-project))/((pipeline-prefix))alpine-tools
tag: latest
{%- endmacro %}
+
+{%- macro github_access(public) -%}
+uri: https://github.com/((geode-fork))/((geode-repo-name)).git
+{%- if repository.public == "false" %}
+username: ((github-username))
+password: ((github-password))
+{%- endif %}
+{%- endmacro %}