From db66cebedb6d7f130aaf285a501828f13a2833e1 Mon Sep 17 00:00:00 2001 From: Ivan Usov Date: Tue, 30 Jul 2024 14:01:31 +0200 Subject: [PATCH] Create new user branches in git repos --- tasks/main.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tasks/main.yaml b/tasks/main.yaml index 9b6c74f..90ff3b2 100644 --- a/tasks/main.yaml +++ b/tasks/main.yaml @@ -54,6 +54,17 @@ version: "{{ bec_widgets_version }}" force: true +- name: Create user branches in git repositories + become_user: "{{ bec_user }}" + ansible.builtin.command: + cmd: git switch -c {{ bec_user }}_{{ ansible_date_time['iso8601_basic_short'] }} + chdir: "{{ bec_path }}/{{ item }}" + loop: + - bec + - ophyd_devices + - bec_widgets + when: not ansible_check_mode + - name: Clone BEC plugins become_user: "{{ bec_user }}" ansible.builtin.git: @@ -72,6 +83,14 @@ loop: "{{ bec_plugins | dict2items }}" when: not ansible_check_mode +- name: Create user branches in git repositories of plugins + become_user: "{{ bec_user }}" + ansible.builtin.command: + cmd: git switch -c {{ bec_user }}_{{ ansible_date_time['iso8601_basic_short'] }} + chdir: "{{ bec_path }}/{{ item.key }}" + loop: "{{ bec_plugins | dict2items }}" + when: not ansible_check_mode + - name: Check if venv exists ansible.builtin.stat: path: "{{ bec_venv_path }}"