git:在 Mac 上尝试将存储库推送到 Amazon Elastic Beanstalk 时,“aws.push”不是 git 命令
Posted
技术标签:
【中文标题】git:在 Mac 上尝试将存储库推送到 Amazon Elastic Beanstalk 时,“aws.push”不是 git 命令【英文标题】:git: 'aws.push' is not a git command when trying to push a repository to Amazon Elastic Beanstalk on Mac 【发布时间】:2014-09-02 10:46:43 【问题描述】:我有以下设置:
Mac OS X 10.10 Python 2.7我做了以下步骤
AWS EB 控制台工具已添加到我的路径中
export PATH=$PATH:~/amazon-eb/eb/linux/python2.7/
export AWS_ACCESS_KEY_ID=xxx
export AWS_SECRET_KEY=xxx
export AWS_CREDENTIALS_PATH=~/.aws/credentials
~/.aws/credentials
中的 AWS 凭证
[default]
AWSAccessKeyId=xxx
AWSSecretKey=xxx
使用.elasticbeanstalk/config
文件创建了一个项目
[global]
ApplicationName=Oselot Wordpress Blog
DevToolsEndpoint=git.elasticbeanstalk.us-east-1.amazonaws.com
EnvironmentName=oselotWordpressBlog-env
Region=us-east-1
当我尝试运行 eb status
时,它会询问我的凭据(不知道为什么......)。所以我输入它们。好像有效
Anatoliys-MBP:oselot-blog toli$ eb status
To get your AWS Access Key ID and Secret Access Key,
visit "https://aws-portal.amazon.com/gp/aws/securityCredentials".
Enter your AWS Access Key ID: xxx
Enter your AWS Secret Access Key: xxx
URL : xxx.elasticbeanstalk.com
Status : Ready
Health : Green
RDS Database: AWSEBRDSDatabase | xxx.xxx.us-east-1.rds.amazonaws.com:3306
我运行 git aws.push
并出现错误:
git: 'aws.push' is not a git command. See 'git --help'.
【问题讨论】:
【参考方案1】:我运行了eb init
,它最终问了我很多我已经在 Beanstalk GUI 中设置的问题。我不明白为什么这是必要的......
Anatoliys-MBP:oselot-blog toli$ eb init
To get your AWS Access Key ID and Secret Access Key,
visit "https://aws-portal.amazon.com/gp/aws/securityCredentials".
Enter your AWS Access Key ID: xxx
Enter your AWS Secret Access Key: xxx
Select an AWS Elastic Beanstalk service region (current value is "US East (Virginia)").
Available service regions are:
1) US East (Virginia)
2) US West (Oregon)
3) US West (North California)
4) EU West (Ireland)
5) Asia Pacific (Singapore)
6) Asia Pacific (Tokyo)
7) Asia Pacific (Sydney)
8) South America (Sao Paulo)
Select (1 to 8): 1
Enter an AWS Elastic Beanstalk application name (current value is "Oselot Wordpress Blog"):
Enter an AWS Elastic Beanstalk environment name (current value is "oselotWordpressBlog-env"):
Select an environment tier.
Available environment tiers are:
1) WebServer::Standard::1.0
2) Worker::SQS/HTTP::1.0
Select (1 to 2): 1
Select a solution stack.
Available solution stacks are:
1) 64bit Amazon Linux 2014.03 v1.0.3 running php 5.5
2) 32bit Amazon Linux 2014.03 v1.0.3 running PHP 5.5
3) 64bit Amazon Linux 2014.03 v1.0.3 running PHP 5.4
4) 32bit Amazon Linux 2014.03 v1.0.3 running PHP 5.4
5) 32bit Amazon Linux running PHP 5.3
6) 64bit Amazon Linux running PHP 5.3
7) 64bit Amazon Linux 2014.03 v1.0.3 running Node.js
8) 32bit Amazon Linux 2014.03 v1.0.3 running Node.js
9) 64bit Windows Server 2008 R2 running IIS 7.5
10) 64bit Windows Server 2012 running IIS 8
11) 64bit Amazon Linux 2014.03 v1.0.3 running Tomcat 7 Java 7
12) 32bit Amazon Linux 2014.03 v1.0.3 running Tomcat 7 Java 7
13) 64bit Amazon Linux 2014.03 v1.0.3 running Tomcat 7 Java 6
14) 32bit Amazon Linux 2014.03 v1.0.3 running Tomcat 7 Java 6
15) 32bit Amazon Linux running Tomcat 7
16) 64bit Amazon Linux running Tomcat 7
17) 32bit Amazon Linux running Tomcat 6
18) 64bit Amazon Linux running Tomcat 6
19) 64bit Amazon Linux 2014.03 v1.0.3 running Python 2.7
20) 32bit Amazon Linux 2014.03 v1.0.3 running Python 2.7
21) 32bit Amazon Linux 2014.03 v1.0.3 running Python
22) 64bit Amazon Linux 2014.03 v1.0.3 running Python
23) 32bit Amazon Linux running Python
24) 64bit Amazon Linux running Python
25) 64bit Amazon Linux 2014.03 v1.0.4 running Ruby 2.0 (Puma)
26) 64bit Amazon Linux 2014.03 v1.0.3 running Ruby 2.0 (Passenger Standalone)
27) 64bit Amazon Linux 2014.03 v1.0.3 running Ruby 1.9.3
28) 32bit Amazon Linux 2014.03 v1.0.3 running Ruby 1.9.3
29) 32bit Amazon Linux 2014.02 v1.0.1 running Ruby 1.8.7
30) 64bit Amazon Linux 2014.02 v1.0.1 running Ruby 1.8.7
31) 64bit Amazon Linux 2014.03 v1.0.0 running Docker 1.0.0
32) 64bit Amazon Linux 2014.03 v1.0.4 running Python 2.7
33) 64bit Amazon Linux 2014.03 v1.0.4 running PHP 5.5
34) 64bit Amazon Linux 2014.03 v1.0.4 running Node.js
35) 64bit Amazon Linux 2014.03 v1.0.4 running Ruby 1.9.3
36) 64bit Amazon Linux 2014.03 v1.0.4 running PHP 5.4
37) 64bit Amazon Linux 2014.03 v1.0.4 running Ruby 2.0 (Passenger Standalone)
38) 64bit Amazon Linux 2014.03 v1.0.4 running Tomcat 7 Java 6
39) 64bit Amazon Linux 2014.03 v1.0.4 running Python
40) 64bit Amazon Linux 2014.03 v1.0.1 running Docker 1.0.0
41) 64bit Amazon Linux 2014.03 v1.0.5 running Ruby 2.0 (Puma)
42) 64bit Amazon Linux 2014.03 v1.0.4 running Tomcat 7 Java 7
Select (1 to 42): 1
Select an environment type.
Available environment types are:
1) LoadBalanced
2) SingleInstance
Select (1 to 2): 1
Create an RDS DB Instance? [y/n]: n
Attach an instance profile (current value is "[Create a default instance profile]"):
1) [Create a default instance profile]
2) aws-opsworks-ec2-role.1405096101659
3) aws-opsworks-ec2-role.1405096100907
4) aws-opsworks-ec2-role.1405096100282
5) aws-opsworks-ec2-role.1405096099782
6) aws-opsworks-ec2-role.1405096099019
7) aws-opsworks-ec2-role
8) [Other instance profile]
Select (1 to 8):
Updated AWS Credential file at "/Users/toli/.elasticbeanstalk/aws_credential_file".
收到此错误:
Traceback (most recent call last):
File ".git/AWSDevTools/aws.elasticbeanstalk.push", line 21, in <module>
from aws.dev_tools import *
File "/Users/toli/Sites/oselot-blog/.git/AWSDevTools/aws/dev_tools.py", line 5, in <module>
import boto
ImportError: No module named boto
所以我实际上是通过做博托
curl -O https://bootstrap.pypa.io/get-pip.py
sudo get-pip.py
sudo pip install boto
而且成功了……
【讨论】:
以上是关于git:在 Mac 上尝试将存储库推送到 Amazon Elastic Beanstalk 时,“aws.push”不是 git 命令的主要内容,如果未能解决你的问题,请参考以下文章
如何从本地 Windows 存储库推送到 Windows git 远程服务器
将具有 node_modules 的本地 Node.js 项目 Git 存储库推送到 Heroku 时,本地 node_modules 是不是会覆盖 Heroku 上的那些?