Is it possible to copy the files from a repository in GitHub to a CodeCommit repository programmatically? (Lambda AWS-SDK)
Also, I've read a bit about using git clone --mirror and git push --mirror. Would that work from inside a Lambda? If so, how would I run such commands from inside a Lambda?
CodePudding user response:
Lambda default runtimes like node, python, java, etc. might not have git command available. What you can do is to use Docker runtime of Lambda and install git on the container and use that for git clone and git push.
Reference for how to run Docker on Lambda: https://medium.com/swlh/how-to-run-docker-containers-on-aws-lambda-c9bedd25fdf4
As far as AWS SDK is concerned there's no git support mentioned in the documentation.
CodePudding user response:
This repository seems to be offering a lambda layer for GIT. If you don't like how it works, I hope that viewing the source code inside would at least shed some light on how to do it. This blog also showcases a lambda function cloning a Github repository and pushing them to code commit.
