$ aws –version
aws-cli/1.22.64 Python/3.8.10 Linux/5.4.0-109-generic botocore/1.24.9
$ git –version
git version 2.25.1
$ git init
$ git add .
$ git commit -m “first commit”
$ git remote add origin https://github.com/hpscript/cicd.git
$ git push -u origin master
### CodeCommit作成
$ GITHUB_ACCOUNT=hogehoge
$ REPO_NAME=fuga
$ GITHUB_REPO_URL=https://github.com/${GITHUB_ACCOUNT}/${REPO_NAME}.git
$ aws codecommit create-repository –repository-name ${REPO_NAME}
### 複製先のRepository情報を定義
$ CODECOMMIT_REGION=ap-northeast-1
$ CODECOMMIT_REPO_URL=https://git-codecommit.${CODECOMMIT_REGION}.amazonaws.com/v1/repos/${REPO_NAME}
### 認証情報ヘルパーの設定
$ git config –global credential.helper ‘!aws codecommit credential-helper $@’
$ git config –global credential.UseHttpPath true
### CodeCommitのRepositoryにpush
$ git push ${CODECOMMIT_REPO_URL} –all
なるほどー