Fix --tobiko-refspec option in IR tobiko plugin
Change-Id: Ifaf1d5946ec2dad569faa3e205f4f50018ed63be
This commit is contained in:
parent
d1fe262992
commit
7d5d82d02e
|
@ -37,7 +37,7 @@ subparsers:
|
||||||
clean:
|
clean:
|
||||||
type: Flag
|
type: Flag
|
||||||
help: Cleanup directory where test cases will be downloaded
|
help: Cleanup directory where test cases will be downloaded
|
||||||
ansible_variable: clean_deploy_dir
|
ansible_variable: deploy_clean
|
||||||
git-base:
|
git-base:
|
||||||
type: Value
|
type: Value
|
||||||
help: Git Url prefix where test projects are fetched from
|
help: Git Url prefix where test projects are fetched from
|
||||||
|
@ -58,10 +58,6 @@ subparsers:
|
||||||
type: Value
|
type: Value
|
||||||
help: Git URL from where to download test files
|
help: Git URL from where to download test files
|
||||||
ansible_variable: test_git_repo
|
ansible_variable: test_git_repo
|
||||||
test-version:
|
|
||||||
type: Value
|
|
||||||
help: Git version to be used for checking out test scripts
|
|
||||||
ansible_variable: test_git_version
|
|
||||||
test-remote:
|
test-remote:
|
||||||
type: Value
|
type: Value
|
||||||
help: Git remote name to be used for checking out test scripts
|
help: Git remote name to be used for checking out test scripts
|
||||||
|
@ -91,10 +87,6 @@ subparsers:
|
||||||
help: Git URL from where to download tobiko files
|
help: Git URL from where to download tobiko files
|
||||||
ansible_variable: tobiko_git_repo
|
ansible_variable: tobiko_git_repo
|
||||||
default: 'https://opendev.org/x/tobiko.git'
|
default: 'https://opendev.org/x/tobiko.git'
|
||||||
tobiko-version:
|
|
||||||
type: Value
|
|
||||||
help: Git version to be used for checking out Tobiko scripts
|
|
||||||
ansible_variable: tobiko_git_version
|
|
||||||
tobiko-remote:
|
tobiko-remote:
|
||||||
type: Value
|
type: Value
|
||||||
help: Git remote name to be used for checking out test scripts
|
help: Git remote name to be used for checking out test scripts
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
deploy_dir: ''
|
deploy_dir: ''
|
||||||
deploy_clean: no
|
deploy_clean: '{{ (deploy_git_refspec | length) > 0 | default(false) }}'
|
||||||
deploy_src_dir: ''
|
deploy_src_dir: ''
|
||||||
|
|
||||||
deploy_git_repo: ''
|
deploy_git_repo: ''
|
||||||
deploy_git_version: ''
|
|
||||||
deploy_git_refspec: ''
|
deploy_git_refspec: ''
|
||||||
deploy_git_remote: ''
|
deploy_git_remote: ''
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
path: "{{ deploy_dir | realpath }}"
|
path: "{{ deploy_dir | realpath }}"
|
||||||
state: absent
|
state: absent
|
||||||
when:
|
when:
|
||||||
- deploy_clean | bool
|
- (deploy_clean | bool)
|
||||||
|
|
||||||
|
|
||||||
- name: "ensure target directory exists: '{{ deploy_dir }}'"
|
- name: "ensure target directory exists: '{{ deploy_dir }}'"
|
||||||
|
@ -15,6 +15,19 @@
|
||||||
register: create_dest_dir
|
register: create_dest_dir
|
||||||
|
|
||||||
|
|
||||||
|
- name: "checkout files from '{{ deploy_git_repo }}[{{ deploy_git_refspec }}]' to '{{ deploy_dir }}'"
|
||||||
|
git:
|
||||||
|
dest: '{{ deploy_dir }}'
|
||||||
|
repo: '{{ deploy_git_repo }}'
|
||||||
|
refspec: '{{ deploy_git_refspec }}'
|
||||||
|
version: FETCH_HEAD
|
||||||
|
remote: '{{ deploy_git_remote or omit }}'
|
||||||
|
force: yes
|
||||||
|
register: checkout_files
|
||||||
|
when:
|
||||||
|
- (deploy_git_refspec | length) > 0
|
||||||
|
|
||||||
|
|
||||||
- name: "copy '{{ deploy_src_dir }}' to '{{ deploy_dir }}'"
|
- name: "copy '{{ deploy_src_dir }}' to '{{ deploy_dir }}'"
|
||||||
synchronize:
|
synchronize:
|
||||||
src: "{{ deploy_src_dir | realpath }}/."
|
src: "{{ deploy_src_dir | realpath }}/."
|
||||||
|
@ -26,27 +39,7 @@
|
||||||
register: copy_src_dir
|
register: copy_src_dir
|
||||||
when:
|
when:
|
||||||
- (deploy_src_dir | length) > 0
|
- (deploy_src_dir | length) > 0
|
||||||
|
- checkout_files is skipped
|
||||||
|
|
||||||
- when: copy_src_dir is skipped
|
|
||||||
block:
|
|
||||||
|
|
||||||
- name: "override deploy_git_version and deploy_src_dir because deploy_git_refspec is '{{ deploy_git_refspec }}'"
|
|
||||||
set_fact:
|
|
||||||
deploy_git_version: 'FETCH_HEAD'
|
|
||||||
when: "(deploy_git_refspec | length) > 0"
|
|
||||||
|
|
||||||
- name: "checkout files from '{{ deploy_git_repo }}[{{ deploy_git_refspec | default(deploy_git_version) }}]' to '{{ deploy_dir }}'"
|
|
||||||
git:
|
|
||||||
dest: '{{ deploy_dir }}'
|
|
||||||
repo: '{{ deploy_git_repo }}'
|
|
||||||
refspec: '{{ deploy_git_refspec or omit }}'
|
|
||||||
version: '{{ deploy_git_version or omit }}'
|
|
||||||
remote: '{{ deploy_git_remote or omit }}'
|
|
||||||
force: yes
|
|
||||||
register: checkout_files
|
|
||||||
when:
|
|
||||||
- (deploy_git_version | length) > 0
|
|
||||||
|
|
||||||
|
|
||||||
- name: "get last change details for '{{ deploy_dir }}'" # noqa 303
|
- name: "get last change details for '{{ deploy_dir }}'" # noqa 303
|
||||||
|
@ -60,8 +53,9 @@
|
||||||
- name: "show last change details"
|
- name: "show last change details"
|
||||||
debug: var=get_git_log.stdout_lines
|
debug: var=get_git_log.stdout_lines
|
||||||
|
|
||||||
#we install validations-common here since it's
|
|
||||||
#packaged by rhel-osp
|
# we install validations-common here since it's
|
||||||
|
# packaged by rhel-osp
|
||||||
- name: install validations-common
|
- name: install validations-common
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
become: true
|
become: true
|
||||||
|
|
|
@ -12,9 +12,8 @@
|
||||||
vars:
|
vars:
|
||||||
deploy_dir: '{{ tobiko_src_dir | realpath }}'
|
deploy_dir: '{{ tobiko_src_dir | realpath }}'
|
||||||
deploy_git_repo: '{{ tobiko_git_repo }}'
|
deploy_git_repo: '{{ tobiko_git_repo }}'
|
||||||
deploy_git_version: "{{ tobiko_git_version | default('HEAD') }}"
|
deploy_git_refspec: "{{ tobiko_git_refspec | default('latest') }}"
|
||||||
deploy_git_refspec: "{{ tobiko_git_refspec | default('') }}"
|
deploy_git_remote: "{{ tobiko_git_remote | default('') }}"
|
||||||
deploy_git_remote: '{{ tobiko_git_remote | default(omit) }}'
|
|
||||||
when: create_tobiko_dir is changed
|
when: create_tobiko_dir is changed
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
# tobiko_git_refspec is empty to allow copying files from tobini_src_dir
|
||||||
|
tobiko_git_refspec: ''
|
||||||
|
test_git_refspec: ''
|
||||||
|
tobiko_git_remote: ''
|
||||||
|
test_git_remote: ''
|
|
@ -9,13 +9,11 @@
|
||||||
tobiko_dir: '{{ tobiko_dir | realpath }}'
|
tobiko_dir: '{{ tobiko_dir | realpath }}'
|
||||||
tobiko_src_dir: '{{ tobiko_src_dir | realpath }}'
|
tobiko_src_dir: '{{ tobiko_src_dir | realpath }}'
|
||||||
tobiko_git_repo: '{{ tobiko_git_repo }}'
|
tobiko_git_repo: '{{ tobiko_git_repo }}'
|
||||||
tobiko_git_version: "{{ tobiko_git_version }}"
|
|
||||||
tobiko_git_refspec: "{{ tobiko_git_refspec }}"
|
tobiko_git_refspec: "{{ tobiko_git_refspec }}"
|
||||||
tobiko_git_remote: "{{ tobiko_git_remote }}"
|
tobiko_git_remote: "{{ tobiko_git_remote }}"
|
||||||
test_dir: '{{ test_dir | realpath }}'
|
test_dir: '{{ test_dir | realpath }}'
|
||||||
test_src_dir: '{{ test_src_dir | realpath }}'
|
test_src_dir: '{{ test_src_dir | realpath }}'
|
||||||
test_git_repo: '{{ test_git_repo }}'
|
test_git_repo: '{{ test_git_repo }}'
|
||||||
test_git_version: "{{ test_git_version }}"
|
|
||||||
test_git_refspec: "{{ test_git_refspec }}"
|
test_git_refspec: "{{ test_git_refspec }}"
|
||||||
test_git_remote: "{{ test_git_remote }}"
|
test_git_remote: "{{ test_git_remote }}"
|
||||||
|
|
||||||
|
@ -25,7 +23,6 @@
|
||||||
deploy_dir: '{{ tobiko_dir }}'
|
deploy_dir: '{{ tobiko_dir }}'
|
||||||
deploy_src_dir: '{{ tobiko_src_dir }}'
|
deploy_src_dir: '{{ tobiko_src_dir }}'
|
||||||
deploy_git_repo: '{{ tobiko_git_repo }}'
|
deploy_git_repo: '{{ tobiko_git_repo }}'
|
||||||
deploy_git_version: "{{ tobiko_git_version }}"
|
|
||||||
deploy_git_refspec: "{{ tobiko_git_refspec }}"
|
deploy_git_refspec: "{{ tobiko_git_refspec }}"
|
||||||
deploy_git_remote: '{{ tobiko_git_remote }}'
|
deploy_git_remote: '{{ tobiko_git_remote }}'
|
||||||
|
|
||||||
|
@ -35,7 +32,6 @@
|
||||||
deploy_dir: '{{ test_dir }}'
|
deploy_dir: '{{ test_dir }}'
|
||||||
deploy_src_dir: '{{ test_src_dir }}'
|
deploy_src_dir: '{{ test_src_dir }}'
|
||||||
deploy_git_repo: '{{ test_git_repo }}'
|
deploy_git_repo: '{{ test_git_repo }}'
|
||||||
deploy_git_version: "{{ test_git_version }}"
|
|
||||||
deploy_git_refspec: "{{ test_git_refspec }}"
|
deploy_git_refspec: "{{ test_git_refspec }}"
|
||||||
deploy_git_remote: '{{ test_git_remote }}'
|
deploy_git_remote: '{{ test_git_remote }}'
|
||||||
when: test_dir != tobiko_dir
|
when: test_dir != tobiko_dir
|
||||||
|
|
|
@ -16,9 +16,6 @@ test_dir: "{{ test_deploy_home }}/{{ test_project }}"
|
||||||
test_project:
|
test_project:
|
||||||
"{{ test_git_repo | urlsplit('path') | regex_replace('^\\/|\\/$', '') | splitext | first }}"
|
"{{ test_git_repo | urlsplit('path') | regex_replace('^\\/|\\/$', '') | splitext | first }}"
|
||||||
test_git_repo: '{{ git_base }}/x/tobiko.git'
|
test_git_repo: '{{ git_base }}/x/tobiko.git'
|
||||||
test_git_refspec: ''
|
|
||||||
test_git_remote: ''
|
|
||||||
test_git_version: ''
|
|
||||||
test_src_dir: ''
|
test_src_dir: ''
|
||||||
|
|
||||||
|
|
||||||
|
@ -30,9 +27,6 @@ tobiko_dir: "{{ test_deploy_home }}/{{ tobiko_project }}"
|
||||||
tobiko_project:
|
tobiko_project:
|
||||||
"{{ tobiko_git_repo | urlsplit('path') | regex_replace('^\\/|\\/$', '') | splitext | first }}"
|
"{{ tobiko_git_repo | urlsplit('path') | regex_replace('^\\/|\\/$', '') | splitext | first }}"
|
||||||
tobiko_git_repo: '{{ git_base }}/x/tobiko.git'
|
tobiko_git_repo: '{{ git_base }}/x/tobiko.git'
|
||||||
tobiko_git_refspec: ''
|
|
||||||
tobiko_git_remote: ''
|
|
||||||
tobiko_git_version: ''
|
|
||||||
tobiko_src_dir: ''
|
tobiko_src_dir: ''
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue