LoginSignup
0
0

More than 3 years have passed since last update.

AWS CodeCommit (自分用メモ1)

Last updated at Posted at 2020-02-23
1 IAMでCodeCommitの権限を全て持っているユーザーを作成

・ユーザー名はaws_cli_user
・リージョンはus-east-1
で作成

2 Access Key、Secret Access Keyを保存
3 CodeCommit でリポジトリを作成
4 自分のパソコンに(ローカルに)Gitを入れていること
ターミナル
# ローカルにaws cliを入れる
katoatsushi$ pip install awscli --upgrade --user

# 設定
katoatsushi$ aws configure --profile CodeCommitUser
AWS Access Key ID [None]: ASDFGHJKIUYTRFGHJKUYTGFGH
AWS Secret Access Key [None]: sdfgtyujkj/+tgh/mjyRestdH&^FGHJ
Default region name [None]: us-east-1
Default output format [None]: json

katoatsushi$ git config --global credential.helper '!aws --region us-east-1 --profile aws_cli_user codecommit credential-helper $@'
katoatsushi$ git config --global credential.UseHttpPath true

次にgit clone でローカルに落とす
そしてpush

ターミナル
katoatsushi$ git clone https://git-codecommit.us-east-1.amazonaws.com/v1/repos/go-sample-master
Cloning into 'go-sample-master'...
warning: You appear to have cloned an empty repository.

katoatsushi$ cd ~/sample-repo && touch main.go
katoatsushi$ git add .
katoatsushi$ git commit -m"first commit"
katoatsushi$ git push origin master

確認してみると、、、
スクリーンショット 2020-02-23 15.14.30.png

上手くpush できてました。

次はCodeDeploy、CodePipeline、CodeCommitを使った自動デプロイです

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0