Mar*_*cIT 5 amazon-web-services gitlab docker gitlab-ci-runner amazon-lightsail
我在将 docker 映像部署到AWS LightSail. 我在 GitLab 上使用私有容器,我的图像在构建后推送到那里。我为 ci/cd 创建了第二阶段,用于将映像部署到 Lightsail。
image: docker:19.03.12
services:
- docker:19.03.12-dind
build:
stage: build
before_script:
- docker login registry.gitlab.com --username $UserName -p $CiCdToken
script:
- docker build -t registry.gitlab.com/nickname/testprojectname .
- docker push registry.gitlab.com/nickname/testprojectname
deploy:
stage: deploy
image: python:latest
script:
- pip install awscli
- pip install lightsailctl
- aws lightsail push-container-image --service-name testprojectname --label testprojectname --image registry.gitlab.com/nickname/testprojectname
Run Code Online (Sandbox Code Playgroud)
不幸的是Python没有lightsailctl和awscli不支持lightsail。
lightsailaws ctlvia runner。最好的,Marcin W?och
小智 1
“aws lightsail Push-container-image”可能需要 docker。
我创建了一个包含 awscli、lightsailctl 和 docker 的映像。
- image: python:latest
+ image: ytoune/aws-lightsail-cli
script:
- - pip install awscli
- - pip install lightsailctl
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1050 次 |
| 最近记录: |