openstack-ansible-os_keystone/tests/test-clone-repo.yml
Andy McCrae c8631347e7 Use a custom git checkout in developer mode
This patch allows a developer to customise the code for
keystone, then test the changes when executing any of
the tox tests we implement.

The workflow means that by default the git_repo will be cloned from
upstream (this ensures gating continues to work). If the developer
specifies a "keystone_dev_local_directory" then the repo will not be
cloned, and it assumes the developer has already cloned and edited that
repo. A clone can be forced using "keystone_dev_force_clone" to "True".

Change-Id: Ibb666a803e73b50e3ee1918e633a9bbb84b084da
2017-04-06 12:36:38 +01:00

27 lines
975 B
YAML

---
# Copyright 2017, Rackspace US, Inc.
#
# Licensed 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.
- name: Clone keystone repository if it doesn't exist
hosts: localhost
user: root
pre_tasks:
- name: Clone the repo
git:
repo: "{{ keystone_dev_clone_repo }}"
dest: "{{ keystone_dev_local_directory | default('/opt/keystone') }}"
version: "{{ keystone_dev_git_branch | default('master') }}"
register: git_clone
until: git_clone|success