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

Remove large binaries from the deployed container #577

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions content/.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
{
"url": "git@github.com:Yubico/yubico-binaries.git",
"preserve_mtimes": true,
"skip_lfs": true,
"files": [
["%(name)s/releases/*", "Releases/"],
["%(name)s/mans/*.adoc", "Manuals/"],
Expand Down
1 change: 1 addition & 0 deletions content/Archive_Old_Dev_Docs/YubiHSM2/.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
{
"url": "git@github.com:Yubico/yubico-binaries.git",
"preserve_mtimes": true,
"skip_lfs": true,
"files": [
["yubihsm2/releases/*", "Releases/"]
]
Expand Down
1 change: 1 addition & 0 deletions content/YubiHSM2/.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
{
"url": "git@github.com:Yubico/yubico-binaries.git",
"preserve_mtimes": true,
"skip_lfs": true,
"files": [
["yubihsm2/releases/*", "Releases/"]
]
Expand Down
3 changes: 2 additions & 1 deletion content/projects/windows-apis/.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"git": [
{
"url": "git@github.com:Yubico/yubico-binaries.git",
"files": [["windows-apis/releases/*", "Releases/"]]
"skip_lfs": true,
"files": [["windows-apis/releases/*", "Releases/"]]
}
]
}
7 changes: 5 additions & 2 deletions devyco/modules/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
url: Git repository URL (required).
files: List of filepatterns to copy from the repository (default: all)
preserve_mtimes: If true, set mtimes based on commit times (default: false)
skip_lfs: If true, fetch the repo without pulling Git LFS objects

The "git" entry can also be a list of objects containing the settings above if
multiple repositories should be clones.
Expand Down Expand Up @@ -94,8 +95,10 @@ def _clone(self, conf):
cwd=repo_dir, stderr=sys.stdout.fileno())
else:
print "clone:", url
subprocess.check_call(['git', 'clone', url, repo_dir],
stderr=sys.stdout.fileno())
clone_cmd = ['git', 'clone', url, repo_dir]
if conf.get('skip_lfs'):
clone_cmd += ['-c', 'filter.lfs.process=git-lfs filter-process --skip']
subprocess.check_call(clone_cmd, stderr=sys.stdout.fileno())
subprocess.check_call(['git', 'reset', 'origin/%s' % branch, '--hard'],
cwd=repo_dir, stderr=sys.stdout.fileno())

Expand Down
Loading