LoginSignup
0
0

More than 5 years have passed since last update.

[JAWS-UG CLI] CodeCommit #2 サンプルコードの追加

Last updated at Posted at 2016-10-10

CodeCommitのリポジトリにコードを追加してみます。

前提条件

CodeCommitリポジトリへのSSHアクセス権限

CodeCommit上のリポジトリにSSHでアクセスする権限があること。

unixコマンド

  • curlコマンドが利用できること。
  • unzipコマンドが利用できること。

0. 準備

ローカルリポジトリへの移動

コマンド
cd ~/tmp/${CODEC_REPOSITORY_NAME} \
  && pwd

1. 事前作業

サンプルコードの取得

変数の設定
FILE_SAMPLE='SampleApp_Linux.zip'
URL_SAMPLE="https://s3.amazonaws.com/aws-codedeploy-us-east-1/samples/latest/${FILE_SAMPLE}"
コマンド
curl ${URL_SAMPLE} > ${FILE_SAMPLE} \
        && unzip ${FILE_SAMPLE} \
        && rm ${FILE_SAMPLE}

2. リポジトリへの登録

コマンド
git add -A

結果:

  (戻り値なし)

```bash:コマンド:
git commit -m "Added sample application files"
結果(例)
      [master (root-commit) fce7ec3] Added sample application files
       7 files changed, 266 insertions(+)
       create mode 100644 LICENSE.txt
       create mode 100644 SampleApp_Linux.zip
       create mode 100644 appspec.yml
       create mode 100644 index.html
       create mode 100644 scripts/install_dependencies
       create mode 100644 scripts/start_server
       create mode 100644 scripts/stop_server
コマンド
git push
結果(例)
      ounting objects: 10, done.
      Delta compression using up to 4 threads.
      Compressing objects: 100% (8/8), done.
      Writing objects: 100% (10/10), 9.95 KiB | 0 bytes/s, done.
      Total 10 (delta 0), reused 0 (delta 0)
      remote:
      To ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos/handson-20161010 * [new branch]      master -> master

3. 事後作業

コマンド
git log
結果(例)
      commit xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
      Author: taro <taro@example.com>
      Date:   Sun Oct 10 13:40:00 2016 +0900

          Added sample application files

完了

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