【发布时间】:2020-08-05 05:55:39
【问题描述】:
我创建了一个简单的反应来练习 gitlab 的 CI/CD 管道。我成功实现了 CI/CD 管道并将其部署在 S3 存储桶中。当我编辑应用程序并推送到 gitlab 时,我的管道工作正常并部署到 S3 存储桶。但在我的浏览器中,它不显示更新的应用程序。它显示了第一个版本。似乎生产构建不起作用。
这是我的 gitlab 的 .gitlab-ci.yml 设置
image: 'node:12'
stages:
- test
- build
- deploy
test:
stage: test
script:
- yarn install
- yarn run test
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_REGION: $AWS_REGION
S3_BUCKET_NAME: $S3_BUCKET_NAME
build:
stage: build
only:
- master
script:
- npm install
- npm run build
deploy:
stage: deploy
only:
- master
image: python:latest
script:
- pip install awscli
- aws s3 cp build/ s3://$S3_BUCKET_NAME/ --recursive --include "*"
【问题讨论】:
标签: amazon-s3 continuous-integration gitlab continuous-deployment