Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed git archive issue #62

Merged
merged 1 commit into from
Jul 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions terraform/roles/repo/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,23 @@
state: absent
path: /tmp/{{ repo_name }}/

- name: Remove prior clones repo
file:
state: absent
path: /tmp/git-{{ repo_name }}/

- name: Download the repo content locally
shell: |
if (echo a version 1.9.1; git --version) | sort -Vk3 | tail -1 | grep -q git
then
echo "Modern git version"
git clone -b master --single-branch --no-tags --depth 1 https://github.com/solo-io/{{ repo_name }}.git /tmp/{{ repo_name }}
git clone -b master --single-branch --no-tags --depth 1 https://github.com/solo-io/{{ repo_name }}.git /tmp/git-{{ repo_name }}
else
echo "Legacy git version"
git clone https://github.com/solo-io/{{ repo_name }}.git /tmp/{{ repo_name }}
git clone https://github.com/solo-io/{{ repo_name }}.git /tmp/git-{{ repo_name }}
fi
cd /tmp/{{ repo_name }}
mkdir -p /tmp/{{ repo_name }}
cd /tmp/git-{{ repo_name }}
git archive --format tgz --output /tmp/{{ repo_name }}/repo.tgz master
exit 0
delegate_to: localhost
Expand Down