Update ansible job

Since we are now storing the _service in OBS, use it instead of
constructing the file. Clean-up the unused code.

Initial testing with fault, more to come.

Story: 2006673
Task: 36943
Change-Id: Ic9cd73ee31d213550263b415670b0bcae8953236
Signed-off-by: Saul Wold <sgw@linux.intel.com>
This commit is contained in:
Saul Wold 2019-10-07 09:53:31 -07:00
parent 057693fe37
commit b4e1802a66
4 changed files with 22 additions and 84 deletions

View File

@ -115,8 +115,6 @@
- debug: - debug:
msg: "{{ repo_name }}: {{ repo_dir }} " msg: "{{ repo_name }}: {{ repo_dir }} "
- meta: end_play
- name: List spec files - name: List spec files
debug: debug:
msg: "Specfile List: {{ specfiles }}" msg: "Specfile List: {{ specfiles }}"
@ -135,31 +133,16 @@
msg: "Sorted Directories: {{ item }}" msg: "Sorted Directories: {{ item }}"
with_items: "{{ sorted_dirs }}" with_items: "{{ sorted_dirs }}"
- name: OSC mkpac - name: OSC Link Package
import_role: import_role:
name: osc name: osc
tasks_from: mkpac tasks_from: linkpackage
- name: OSC detachbranch - name: OSC detachbranch
import_role: import_role:
name: osc name: osc
tasks_from: detachbranch tasks_from: detachbranch
- name: Create Service file
include_role:
name: osc
tasks_from: create_service
vars:
package_dir_orig: "{{ package_name }}/{{ lookup('ini', 'SRC_DIR type=properties file=/fault/' + package_name + '/centos/build_srpm.data') | regex_replace('\"', '') | regex_replace('\\/\\.', '') }}"
with_items: "{{ sorted_dirs }}"
loop_control:
loop_var: package_name
- name: OSC commit
import_role:
name: osc
tasks_from: commit
# pushd ./out # pushd ./out
# sleep 5 # sleep 5
# # Check if there is no change, then pretent success # # Check if there is no change, then pretent success

View File

@ -1,51 +1,12 @@
--- ---
# Create the _meta template file - name: OSC Checkout
#- name: OSC detachbranch command: "osc checkout {{ item }}"
# command: "osc detachbranch {{ test_project }} {{ item }}" args:
# args: chdir: "{{ stx_pkg_tmpdir.path }}"
# chdir: "{{ stx_pkg_tmpdir.path }}" with_items: "{{ sorted_dirs }}"
# with_items: "{{ sorted_dirs }}"
#- name: Remove directory - name: Detach branch
# file: command: "osc detachbranch"
# path: "{{ stx_pkg_tmpdir.path }}/{{ item }}" args:
# state: absent chdir: "{{ stx_pkg_tmpdir.path }}/{{ item }}"
# with_items: "{{ sorted_dirs }}"
#- name: OSC Checkout
# command: "osc checkout {{ item }}"
# args:
# chdir: "{{ stx_pkg_tmpdir.path }}"
# with_items: "{{ sorted_dirs }}"
- name: Restore meta-data
shell: cp {{ src_dir }}/{{ item }}/{{ target_distro }}/*[.cpst]* {{ stx_pkg_tmpdir.path }}/{{ item }}
with_items: "{{ sorted_dirs }}" with_items: "{{ sorted_dirs }}"
#- name: OSC AddRemove
# command: "osc addremove"
# args:
# chdir: "{{ stx_pkg_tmpdir.path }}/{{ item }}"
# with_items: "{{ sorted_dirs }}"
#- name: OSC Commit
# command: "osc commit"
# args:
# chdir: "{{ stx_pkg_tmpdir.path }}/{{ item }}"
# with_items: "{{ sorted_dirs }}"
#
#def osc_detachbranch(workdir, project, pkgname):
# olddir = os.getcwd()
# try:
# os.chdir(os.path.join(workdir))
# sh.osc('detachbranch', project, pkgname)
# os.mkdir(pkgname + '.b')
# for f in glob.glob(os.path.join(pkgname, '*')):
# os.rename(f, os.path.join(pkgname + '.b', os.path.basename(f)))
# sh.rm('-rf', pkgname)
# sh.osc('co', pkgname)
# for f in glob.glob(os.path.join(pkgname + '.b', '*')):
# dst = os.path.basename(f)
# try:
# os.unlink(os.path.join(pkgname, dst))
# except OSError:
# pass
# os.rename(f, os.path.join(pkgname, dst))
# os.rmdir(pkgname + '.b')
# finally:
# os.chdir(olddir)

View File

@ -0,0 +1,10 @@
---
# Create the _meta template file
- name: OSC Link Packages
command: "osc linkpac {{ src_project }} {{ item }} {{ target_project }}-1.0"
args:
chdir: "{{ stx_pkg_tmpdir.path }}"
with_items: "{{ sorted_dirs }}"
#- name: Copy meta-data
#shell: ls -la {{ top_dir }}/save/{{ item }}/*.[cstp]* {{ stx_pkg_tmpdir.path }}/{{ item }} >> /tmp/list; cp {{ top_dir }}/save/{{ item }}/*.[cstp]* {{ stx_pkg_tmpdir.path }}/{{ item }}
#with_items: "{{ sorted_dirs }}"

View File

@ -1,16 +0,0 @@
<services>
<service name="tar_scm">
<param name="scm">git</param>
<param name="url">https://opendev.org/starlingx/fault</param>
<param name="version">1.0</param>
<param name="subdir">{{ package_dir }}</param>
<param name="filename">{{ package_name }}</param>
<param name="changesgenerate">disable</param>
</service>
<service name="recompress">
<param name="compression">gz</param>
<param name="file">*.tar</param>
</service>
<service name="set_version" mode="disabled"/>
</services>