2017-10-13 16:30:15 +02:00
|
|
|
- name: SETUP-LOCAL-REPOS | create dirs
|
2017-01-06 23:38:53 +01:00
|
|
|
file:
|
2017-10-13 16:30:15 +02:00
|
|
|
name: "{{ item }}"
|
2017-01-06 23:38:53 +01:00
|
|
|
state: directory
|
|
|
|
with_items:
|
2017-10-13 16:30:15 +02:00
|
|
|
- "{{ repo_dir }}/minimal"
|
|
|
|
- "{{ repo_dir }}/shallow"
|
2018-02-08 00:07:02 +01:00
|
|
|
- "{{ repo_dir }}/shallow_branches"
|
2020-04-06 22:25:24 +02:00
|
|
|
- "{{ repo_dir }}/tag_force_push"
|
2017-01-06 23:38:53 +01:00
|
|
|
|
2017-10-13 16:30:15 +02:00
|
|
|
- name: SETUP-LOCAL-REPOS | prepare minimal git repo
|
2017-01-06 23:38:53 +01:00
|
|
|
shell: git init; echo "1" > a; git add a; git commit -m "1"
|
|
|
|
args:
|
2017-10-13 16:30:15 +02:00
|
|
|
chdir: "{{ repo_dir }}/minimal"
|
2017-01-06 23:38:53 +01:00
|
|
|
|
2017-10-13 16:30:15 +02:00
|
|
|
- name: SETUP-LOCAL-REPOS | prepare git repo for shallow clone
|
2017-01-06 23:38:53 +01:00
|
|
|
shell: |
|
|
|
|
git init;
|
|
|
|
echo "1" > a; git add a; git commit -m "1"; git tag earlytag; git branch earlybranch;
|
|
|
|
echo "2" > a; git add a; git commit -m "2";
|
|
|
|
args:
|
2017-10-13 16:30:15 +02:00
|
|
|
chdir: "{{ repo_dir }}/shallow"
|
2017-01-06 23:38:53 +01:00
|
|
|
|
2017-10-13 16:30:15 +02:00
|
|
|
- name: SETUP-LOCAL-REPOS | set old hash var for shallow test
|
2017-01-06 23:38:53 +01:00
|
|
|
command: 'git rev-parse HEAD~1'
|
|
|
|
register: git_shallow_head_1
|
|
|
|
args:
|
2017-10-13 16:30:15 +02:00
|
|
|
chdir: "{{ repo_dir }}/shallow"
|
2018-02-08 00:07:02 +01:00
|
|
|
|
2020-04-06 22:25:24 +02:00
|
|
|
- name: SETUP-LOCAL-REPOS | prepare tmp git repo with two branches
|
2018-02-08 00:07:02 +01:00
|
|
|
shell: |
|
|
|
|
git init
|
|
|
|
echo "1" > a; git add a; git commit -m "1"
|
|
|
|
git checkout -b test_branch; echo "2" > a; git commit -m "2 on branch" a
|
|
|
|
git checkout -b new_branch; echo "3" > a; git commit -m "3 on new branch" a
|
|
|
|
args:
|
|
|
|
chdir: "{{ repo_dir }}/shallow_branches"
|
2020-04-06 22:25:24 +02:00
|
|
|
|
|
|
|
# Make this a bare one, we need to be able to push to it from clones
|
|
|
|
# We make the repo here for consistency with the other repos,
|
|
|
|
# but we finish setting it up in forcefully-fetch-tag.yml.
|
|
|
|
- name: SETUP-LOCAL-REPOS | prepare tag_force_push git repo
|
|
|
|
shell: git init --bare
|
|
|
|
args:
|
|
|
|
chdir: "{{ repo_dir }}/tag_force_push"
|