#124 祝日スペシャル CodePipeline + S3 Website ハンズオン¶
ハンズオンの概要¶
動作確認: コンテンツの構築¶
1. サンプルコンテンツの取得¶
コマンド:
cd ~/environment/
コマンド:
git clone https://github.com/jaws-ug-cli/jawsug-cli-sample-web.git \ && cd jawsug-cli-sample-web
コマンド:
cp * ~/environment/handson-cli-repository/
2. コンテンツをブランチに追加¶
コマンド:
cd ~/environment/handson-cli-repository/
コマンド:
git branch \ --set-upstream-to=origin/develop develop
結果(例):
コマンド:
git add .
結果(例):
コマンド:
git commit -m 'First release.'
結果(例):
4. コンテンツ確認¶
変数の設定:
export AWS_DEFAULT_REGION='ap-northeast-1'
変数の設定:
S3_BUCKET_PREFIX='handson-cli-website'
コマンド:
AWS_ID=$( \ aws sts get-caller-identity \ --query 'Account' \ --output text \ ) \ && echo ${AWS_ID}
結果(例):
XXXXXXXXXXXX
変数の設定:
S3_BUCKET_NAME="${S3_BUCKET_PREFIX}-${AWS_ID}" \ && echo ${S3_BUCKET_NAME}
結果(例):
handson-cli-website-XXXXXXXXXXXX
コマンド:
S3_BUCKET_ENDPOINT=" \ ${S3_BUCKET_NAME}.s3-website-$( \ aws s3api get-bucket-location \ --bucket ${S3_BUCKET_NAME} --output text \ ).amazonaws.com" \ && echo ${S3_BUCKET_ENDPOINT}