[AWS] Pulling external resources into CodeBuild
During the deployment, if you have any external files you need to add into build process. You can save those files into S3. Then pulling those files in buildspec.yml
version: 0.2 phases: install: runtime-versions: docker: 18 pre_build: commands: - echo Logging in to Amazon ECR... - aws --version - ls -l - pwd - $(aws ecr get-login --region $AWS_DEFAULT_REGION --no-include-email) - REPOSITORY_URI=738690925118.dkr.ecr.eu-central-1.amazonaws.com/demowebcontainer - COMMIT_HASH=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7) - IMAGE_TAG=${COMMIT_HASH:=latest} - aws s3 cp s3://yourbucket/file1.jar build: commands: - echo Build started on `date` - echo Building the Docker image... - docker build -t $REPOSITORY_URI:latest . - docker tag $REPOSITORY_URI:latest $REPOSITORY_URI:$IMAGE_TAG post_build: commands: - echo Build completed on `date` - echo Pushing the Docker images... - docker push $REPOSITORY_URI:latest - docker push $REPOSITORY_URI:$IMAGE_TAG
[NOTE]: Since we are using S3, then it means in CodeBuild, it requries premission for S3 as well.
AmazonS3FullAccess
分类:
AWS
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· AI技术革命,工作效率10个最佳AI工具
2019-02-22 [Functional Programming] Write simple Semigroups type
2019-02-22 [Functional Programming] Function signature
2018-02-22 [Python Test] Use pytest fixtures to reduce duplicated code across unit tests
2018-02-22 [CSS3] CSS Background Images
2018-02-22 [CSS3] The different of Background-size between 'cover' and 'contain'
2018-02-22 [React] Integration test a React component that consumes a Render Prop
2018-02-22 [React] Unit test a React Render Prop component