diff options
author | Valerii Ponomarov <vponomar@redhat.com> | 2019-02-07 02:08:23 +0530 |
---|---|---|
committer | Valerii Ponomarov <vponomar@redhat.com> | 2019-02-07 02:36:02 +0530 |
commit | 25fcd9c5aa4c360eff19ef08fc4e2bdff6147ffd (patch) | |
tree | 544cf09479861ee7c434a7f9ece19167c14ddf35 /deployment/scripts | |
parent | a6c7dead0d6ddad4dae93a4292891617b50b44a0 (diff) |
Add end-to-end OCP 'deployment' functionality
Add end-to-end deployment tool of OpenShift and OpenShift Container
Storage on top of VMWare.
Added code is modified version of the
'reference-architecture/vmware-ansible' dir from the following repo:
https://github.com/vponomaryov/openshift-ansible-contrib
Read 'deployment/README.rst' file for more details about the
deployment tool.
Change-Id: Ic96f252ff786cc1ecf24d27f0ec47e324131e41b
Diffstat (limited to 'deployment/scripts')
-rwxr-xr-x | deployment/scripts/install_openshift_ansible.sh | 35 | ||||
-rwxr-xr-x | deployment/scripts/install_yedit_for_ansible.sh | 17 |
2 files changed, 52 insertions, 0 deletions
diff --git a/deployment/scripts/install_openshift_ansible.sh b/deployment/scripts/install_openshift_ansible.sh new file mode 100755 index 00000000..c258587a --- /dev/null +++ b/deployment/scripts/install_openshift_ansible.sh @@ -0,0 +1,35 @@ +#! /bin/bash +# +# List of expected input args: +# - $1 is an env dir, i.e '/home/username/.../.tox/ocp3.6' +# - $2 is a tag or PR to checkout from, +# 1) TAG -> i.e. 'openshift-ansible-3.6.173.0.96-1' for OCP v3.6 +# See list of tags here: https://github.com/openshift/openshift-ansible/tags +# 2) PR -> 'pull/12345/head'. Where '12345' is ID of a PR. +# See list of PRs here: https://github.com/openshift/openshift-ansible/pulls +# Note that PR is checked out, not cherry-picked. + +OPENSHIFT_ANSIBLE_GIT_URL='git://github.com/openshift/openshift-ansible.git' +TARGET_DIR=$1/usr/share/ansible/openshift-ansible +TAG=$2 + +if [ -z "$TAG" ]; then + # NOTE(vponomar): get latest tag by 3.X branch + TAG=$(git ls-remote --tags $OPENSHIFT_ANSIBLE_GIT_URL \ + "refs/tags/openshift-ansible-$(echo $1 | grep -oE '[^tox\/ocp]+$').*" \ + | grep -v "\{\}" | sort -t / -k 3 -V | tail -n 1 | awk '{print $2}' ) + echo "Custom Git tag hasn't been specified, using latest Git tag '$TAG'" +else + echo "Using custom Git tag '$TAG'" +fi + +TAG=${TAG/refs\/tags\//} + +if [[ ! -d $TARGET_DIR ]]; then + mkdir -p $TARGET_DIR + git clone --single-branch $OPENSHIFT_ANSIBLE_GIT_URL $TARGET_DIR +fi + +cd $TARGET_DIR +git fetch origin $TAG +git reset --hard FETCH_HEAD diff --git a/deployment/scripts/install_yedit_for_ansible.sh b/deployment/scripts/install_yedit_for_ansible.sh new file mode 100755 index 00000000..ac4b0c44 --- /dev/null +++ b/deployment/scripts/install_yedit_for_ansible.sh @@ -0,0 +1,17 @@ +#! /bin/bash +# +# List of expected input args: +# - $1 is an env dir, i.e '/home/username/.../.tox/ocp3.6' +# - $2 is a tag or branch name to checkout from. + +YEDIT_GIT_URL='git://github.com/vponomaryov/yedit.git' +TARGET_DIR=$1/src/yedit + +if [[ ! -d $TARGET_DIR ]]; then + mkdir -p $TARGET_DIR + git clone $YEDIT_GIT_URL --single-branch --branch $2 $TARGET_DIR +else + cd $TARGET_DIR + git fetch -t --all + git reset --hard $2 +fi |