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

Add git lfs to lambda layer #29

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
5 changes: 4 additions & 1 deletion lambda2/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
rm layer.zip

docker run --rm -v "$PWD":/tmp/layer lambci/yumda:2 bash -c "
yum install -y git-${GIT_VERSION} && \
curl -sSf 'https://packagecloud.io/install/repositories/github/git-lfs/config_file.repo?os=amzn&dist=2&source=script' > /lambda/etc/yum.repos.d/github_git-lfs.repo && \
yum -q makecache -y --disablerepo='*' --enablerepo='github_git-lfs' --enablerepo='github_git-lfs-source' && \
yum install -y git-${GIT_VERSION} git-lfs-${GIT_LFS_VERSION} && \
mv /lambda/usr/bin/git-lfs /lambda/opt/bin/git-lfs && \
cd /lambda/opt && \
zip -yr /tmp/layer/layer.zip .
"
1 change: 1 addition & 0 deletions lambda2/config.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export LAYER_NAME=git-lambda2
export GIT_VERSION=2.29.0
export GIT_LFS_VERSION=2.12.1
2 changes: 2 additions & 0 deletions lambda2/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ exports.handler = async(event) => {
execSync('ldd /opt/bin/ssh', { encoding: 'utf8', stdio: 'inherit' })

execSync('ssh -V', { encoding: 'utf8', stdio: 'inherit' })

execSync('git lfs', { encoding: 'utf8', stdio: 'inherit' })
}