[英]How can I deploy aws lambda as jenkins's agent?
I'm going to use Jenkins for CI/CD for the first time in my project.我将在我的项目中首次将 Jenkins 用于 CI/CD。 So, I'm using "gitHub hook trigger for GITScm polling" to automatically make the code into a docker image when github pushed, and upload the image to the ECR when passing the test using "pytest".
所以,我使用“gitHub hook trigger for GITScm polling”在github推送时自动将代码制作成docker图像,并在使用“pytest”通过测试时将图像上传到ECR。
However, it is burdensome to run the Docker image directly on the Jenkins master server and operate the pytest, so I just want to test the code in aws lambda whenever it is pushed.( in other words, I want to use lambda as Jenkins agent ) However, it is burdensome to run the Docker image directly on the Jenkins master server and operate the pytest, so I just want to test the code in aws lambda whenever it is pushed.( in other words, I want to use lambda as Jenkins agent )
I want to implement this process through Jenkins pipeline(Jenkinsfile), but I don't know how.我想通过 Jenkins 管道(Jenkinsfile)来实现这个过程,但我不知道怎么做。 Is there a way to create and deploy aws lambda through the Jenkins pipeline?
有没有办法通过 Jenkins 管道创建和部署 aws lambda?
What you could try is to use the AWS Lambda Plugin .您可以尝试使用AWS Lambda Plugin 。
It allows you to build and deploy lambdas from Jenkins.它允许您从 Jenkins 构建和部署 lambda。 So you could create a lambda containg your logic, invoking it and using the result afterwards.
因此,您可以创建一个 lambda 包含您的逻辑,然后调用它并使用结果。
But keep in mind that lambda might not be the right tool for the job.但请记住,lambda 可能不是适合这项工作的工具。 Execution only can take 15 minutes, and I think you are better off using ECS/EKS.
执行只需要 15 分钟,我认为你最好使用 ECS/EKS。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.