-
Notifications
You must be signed in to change notification settings - Fork 9
/
cci_casc_edit.yml
51 lines (42 loc) · 1.58 KB
/
cci_casc_edit.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---
- name: Creating an empty file
file:
path: "/home/{{ cci_os_username }}/{{ gitlab_repo }}"
state: directory
- name: "Clone source code of personal forked {{ gitlab_repo }}"
git:
repo: "{{ forked_repo_link }}"
dest: "/home/{{ cci_os_username }}/{{ gitlab_repo }}"
version: master
key_file: "{{ local_pubkey_path }}"
- name: Add upstream
ansible.builtin.command: "git remote add upstream {{ upstream_repo_link }}"
args:
chdir: "/home/{{ cci_os_username }}/{{ gitlab_repo }}"
- name: Fetch upstream
ansible.builtin.command: "git fetch upstream"
args:
chdir: "/home/{{ cci_os_username }}/{{ gitlab_repo }}"
- name: Merge upstream
ansible.builtin.command: "git merge upstream/master"
args:
chdir: "/home/{{ cci_os_username }}/{{ gitlab_repo }}"
- name: Modify casc file with new images
ansible.builtin.command: "sed -i 's/{{ cci_os_old_snapshot_name }}/{{ cci_os_snapshot_name }}/' /home/{{ cci_os_username }}/{{ gitlab_repo }}/casc.yaml"
- name: Add the new changes
ansible.builtin.command: "git add -A"
args:
chdir: "/home/{{ cci_os_username }}/{{ gitlab_repo }}"
- name: Create new Commmit
ansible.builtin.command: "git commit -m 'Edit casc.yaml with new image'"
args:
chdir: "/home/{{ cci_os_username }}/{{ gitlab_repo }}"
- name: create a new PR
ansible.builtin.command: "git push origin -f master"
args:
chdir: "/home/{{ cci_os_username }}/{{ gitlab_repo }}"
register: results
- name: "Delete {{ gitlab_repo }} from local."
ansible.builtin.file:
state: absent
path: "/home/{{ cci_os_username }}/{{ gitlab_repo }}"