[英]gitlab pipeline fail to use aws service
This error show "An HTTP Client raised an unhandled exception: Invalid header value b'AWS4-HMAC-SHA256 Credential=********************************************" in gitlab ci pipeline此错误显示“HTTP 客户端引发了未处理的异常:无效的 header 值 b'AWS4-HMAC-SHA256 凭证=*************************** ******************”在 gitlab ci 管道
I am already create AWS varible in gitlab ci and created s3 bucket in aws console.我已经在 gitlab ci 中创建了 AWS 变量,并在 aws 控制台中创建了 s3 存储桶。 my gitlab ci config is我的 gitlab ci 配置是
upload to s3: image: name: banst/awscli entrypoint: [""] script: - aws configure set region us-east-1 - aws s3 ls上传到 s3:图片:名称:banst/awscli 入口点:[""] 脚本:-aws configure set region us-east-1 - aws s3 ls
please answer me!请回答我!
How are you doing?你好吗?
Next I will present the step by step to list the buckets through gitlab-ci.接下来我将逐步介绍通过gitlab-ci列出buckets。
1- Create a repository in gitlab. 1-在 gitlab 中创建一个存储库。
2- In your GitLab project, go to Settings > CI/CD . 2-在您的 GitLab 项目中,go 到Settings > CI/CD 。 Set the following CI/CD variables : AWS_ACCESS_KEY_ID: Your Access key ID.设置以下CI/CD 变量: AWS_ACCESS_KEY_ID:您的访问密钥 ID。
AWS_SECRET_ACCESS_KEY: Your secret access key. AWS_SECRET_ACCESS_KEY:您的秘密访问密钥。
AWS_DEFAULT_REGION: Your region code. AWS_DEFAULT_REGION:您的区域代码。 Variables of Aws' credentials Aws 凭据的变量
3- Create a file called .gitlab-ci.yml in your repository. 3-在您的存储库中创建一个名为.gitlab-ci.yml的文件。 I left attached an example of the pipeline with listing and creating buckets in S3.我留下了一个在 S3 中列出和创建存储桶的管道示例。 Aws has as a rule that the name of the bucket is unique in all accounts, so be creative or specific in the name. Aws 的规则是存储桶的名称在所有帐户中都是唯一的,因此名称要有创意或具体。 File of gitlab.ci - Pipeline S3文件 gitlab.ci - 管道 S3
4- When you commit to the repository, it will open a pipeline. 4-当您提交到存储库时,它将打开一个管道。 I left the steps manually , so I need to press to perform the step.我手动离开了步骤,所以我需要按 来执行该步骤。 Steps of the Pipeline流水线的步骤
I hope I have helped, if you have any questions I am at your disposal.我希望我有所帮助,如果您有任何问题,我随时为您服务。
- build_s3 - create_s3 create-s3: stage: create_s3 image: registry.gitlab.com/gitlab-org/cloud-deploy/aws-base:latest when: manual script: - aws s3api create-bucket --bucket my-bucket-stackoverflow-mms --region us-east-1 build-s3: stage: build_s3 image: registry.gitlab.com/gitlab-org/cloud-deploy/aws-base:latest when: manual script: - aws s3 ls
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.