我是这些东西的新手。我在 AWS CodeCommit 中创建了存储库。我想在其中创建一个文件夹并使用 CodeCommit Console 上传文件。是否可以?那我该怎么办呢?
我正在尝试编写一个 lambda 函数,该函数通过 Web 表单接受图像文件,并使用代码提交将其作为新提交写入存储库。出于某种原因,我的 lambda 函数似乎在调用 createCommit 之前退出,即使我使用 await 的方式与我之前在函数中调用的方式类似。
我尝试重写包装 createCommit 的函数以仅使用承诺,但这似乎也不起作用。我想知道是否有一些我不知道的 lambda 怪癖,或者我是否错误地使用了 async/await(我最近才学会了如何使用它们)
这是我的主要 lambda 事件处理程序:
exports.handler = async (event) => {
const [file, lastCommitId] = await Promise.all([getFile(event), getLastCommitId()]);
return await createCommit(file, lastCommitId)
.then(result => returnResponse(result, 200))
.catch(err => returnResponse(err, 500));
};
Run Code Online (Sandbox Code Playgroud)
这是我的 createCommit 包装函数
async function createCommit(file, parentCommitId) {
const fileContent = await file.content.toString('base64');
const params = {
"authorName": "admin",
branchName,
"commitMessage": "add image",
"email": "n/a",
"parentCommitId": parentCommitId,
"putFiles": [
{
fileContent,
"fileMode": "NORMAL",
"filePath": …Run Code Online (Sandbox Code Playgroud) 我在 CodeCommmit 中有一个非常简单的 Hello World Java 项目,具有以下结构
\n\nThis is a sample template for sam-app - Below is a brief explanation of what we have generated for you:\n\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 README.md <-- This instructions file \n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 HelloWorldFunction <-- Source for HelloWorldFunction Lambda Function \n\xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 pom.xml <-- Java dependencies \n\xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 src \n\xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 main \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 java \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 helloworld \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 App.java <-- Lambda function code \n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 GatewayResponse.java <-- POJO for API Gateway Responses object …Run Code Online (Sandbox Code Playgroud) 尝试在连接到 AWS CodeCommit 存储库(维护 html 代码版本历史记录)的 AWS Amplify 上使用无服务器方法托管 Web 应用程序 (html)。在 Amplify 上保存和部署应用程序在“构建”步骤中失败并返回以下错误:
2020-08-17T01:32:37.631Z [信息]:克隆到“测试”...
2020-08-17T01:32:42.406Z [INFO]:致命:无法访问“https://git-codecommit.us-east-1.amazonaws.com/v1/repos/Test/”:请求的 URL 返回错误:403
2020-08-17T01:32:42.409Z [错误]:!!!无法克隆存储库
步骤如下:https : //aws.amazon.com/getting-started/hands-on/build-serverless-web-app-lambda-apigateway-s3-dynamodb-cognito/module-1/ Step-1(主持一个静态网站,在上面的链接中)仅当我将 repo 名称准确地指定为“wildrydes-site”时才有效。如果我只是将所有相同文件的名称更改为其他名称,则它不起作用。我在这里错过了什么吗?
amazon-s3 amazon-web-services aws-codecommit aws-amplify aws-serverless
我正在尝试将Jenkins与AWS CodeCommit集成.Jenkins使用Ubuntu 14.04在AWS EC2实例上运行.
我关注了这篇博文:http://blogs.aws.amazon.com/application-management/post/Tx1C8B98XN0AF2E/Integrating-AWS-CodeCommit-with-Jenkins
问题是,没有执行sudo -u jenkins aws configure,因为jenkins用户没有权限.
你会怎么做?
以下命令也不起作用:
sudo -u jenkins git config --global credential.helper '!aws codecommit credential-helper $@'
sudo -u jenkins git config --global credential.useHttpPath true
sudo -u jenkins git config --global user.email "me@mycompany.com"
sudo -u jenkins git config --global user.name "MyJenkinsServer"
Run Code Online (Sandbox Code Playgroud)
jenkins用户需要什么权利?
提前致谢.
ubuntu amazon-ec2 amazon-web-services jenkins aws-codecommit
有没有办法可以将BitBucket上的项目移动到AWS CodeCommit并保留所有提交历史记录?
从CloudFormation模板中,您可以部署CodeCommit和CodePipeline。根据此公告,
现在,您可以在使用AWS CodePipeline构建的发布工作流中选择AWS CloudFormation作为部署操作。
我已经完成了Cloudformation模板的大部分工作,但是我无法弄清楚各个阶段。
Resources:
PipelineRepo:
Type: AWS::CodeCommit::Repository
Properties:
RepositoryName: pipeline
RepositoryDescription: Pipeline setup repo
PipelineArtifacts:
Type: AWS::S3::Bucket
PipelineRole:
Type: AWS::IAM::Role
Pipeline:
Type: AWS::CodePipeline::Pipeline
Properties:
Name: pipeline-pipeline
ArtifactStore:
Type: S3
Location:
Ref: PipelineArtifacts
RoleArn:
Ref: PipelineRole
Stages:
... STAGES ...
Run Code Online (Sandbox Code Playgroud)
您如何设置阶段来跟踪CodeCommit,然后从存储库中的文件部署CloudFormation模板?
我已经在AWS Codecommit中设置了2个存储库,并且在使用Windows的SourceTree之前使用了存储库,通过HTTP协议设置了访问权限,并且一切正常。
是的,不是,我正在已安装ubuntu且选择使用gitkraken的计算机上迁移项目的开发。
我能够在用户通过终端读写访问权限的文件夹中进行git clone,因此与Ubuntu中的权限无关,在git clone“ aws repo url”之后,我被提示要求输入用户名IAM和密码(在AWS IAM控制台上创建的一个)。
我当然可以从gitkraken打开该repo文件夹,甚至可以查看所有远程分支和所有历史记录,但是例如一旦我从gitkraken中拉出,它就因为“访问”被拒绝而失败了。我也无法从Gitkraken复制相同或另一个仓库。所以似乎我必须在gitkraken中配置我的凭据,但不确定应该在哪里进行。这个官方文档并没有说太多。
我在克隆 AWS CodeCommit 存储库时(错误地)输入了无效的代码提交凭证,现在 git clone https://git-codecommit.us-east... 给出 443 错误并且不提示输入用户名。
看起来提示在一次失败的尝试后已被禁用,请帮助我如何再次启用它。
我试过:
git clone https://usenmae@git-codecommit.........
Run Code Online (Sandbox Code Playgroud)
也一样,但即使这样也行不通
我使用以下命令设置了用户名:
git config --local user.name <myuser>
Run Code Online (Sandbox Code Playgroud)
但即使这样也行不通
使用 ssh 连接到 CodeCommit 时遇到问题。
看来我需要的都做了。生成 key ,给予他访问权限,为具有代码提交角色的用户放入 AWS IAM 公钥。在本地计算机上创建配置文件。答案始终是:
$ ssh git-codecommit.us-east-2.amazonaws.com
APKA5S53BOD356YJBIJT@git-codecommit.us-east-2.amazonaws.com: Permission denied (publickey).
Run Code Online (Sandbox Code Playgroud)
这是详细的 ssh:
ssh -v git-codecommit.us-east-2.amazonaws.com
OpenSSH_8.5p1, OpenSSL 1.1.1k FIPS 25 Mar 2021
debug1: Reading configuration data /home/edopc/.ssh/config
debug1: /home/edopc/.ssh/config line 1: Applying options for git-codecommit.*.amazonaws.com
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Reading configuration data /etc/ssh/ssh_config.d/50-redhat.conf
debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config
debug1: configuration requests final Match pass
debug1: re-parsing configuration
debug1: Reading configuration data /home/edopc/.ssh/config
debug1: /home/edopc/.ssh/config line 1: Applying options for git-codecommit.*.amazonaws.com …Run Code Online (Sandbox Code Playgroud) 我在AWS账户1111中有一个CodeCommit REPO1.我需要在EC2实例中克隆REPO1,这些实例将在AWS账户2222中定期启动和终止.启动EC2以在短时间内(分钟)执行一些批处理作业,然后以自动方式终止.
在不生成静态凭证的情况下,如何在2222中使用角色启动EC2实例,从1111克隆REPO1.必须使用bash/CLI自动完成该过程.
我一直在我的桌子上撞了几天,现在无济于事.
如何防止每次部署中特定文件夹被替换?考虑下面的目录结构:
-- /.ebextensions
-- /app
-- /database
-- /public
---- /css
---- /js
---- /images
Run Code Online (Sandbox Code Playgroud)
我正在为我的 PHP 应用程序使用 AWS CodeCommit 和 EB CLI,每次运行时eb deploy这些文件和目录都会被替换,因此我想排除该/public/images目录,以便以前上传的图像在更新版本后仍然存在已部署。
我整个星期都在研究他们的文档,但找不到任何可能的解决方案。Elastic Beanstalk 可以做到这一点吗?或者任何关于在 AWS 中部署的替代建议将非常感激。提前致谢!
aws-codecommit ×12
git ×4
amazon-ec2 ×2
aws-lambda ×2
amazon-iam ×1
amazon-s3 ×1
async-await ×1
aws-amplify ×1
aws-cli ×1
bitbucket ×1
ebcli ×1
es6-promise ×1
git-clone ×1
gitkraken ×1
jenkins ×1
laravel ×1
node.js ×1
php ×1
repository ×1
ssh ×1
ubuntu ×1