techtsubame’s blog

備忘録であり、何が起きても責任は取りません

CodePipeLine to S3

概要

  • CodePipelineを設定し、CodeCommitに変更を加えるとS3と連携しS3上のファイルを変更

参考

pages.awscloud.com

CodePipeLine

作成

1つめの設定

  • ビルドステージはスキップ

S3

アクセス

手元PC

変更

index.html

<!DOCTYPE html>

<html lang="ja">
<head>
  <meta charset="utf-8">
  <title>S3 Static Web Hosting Code Commit CodePipeLine</title>
</head>
<body>
  Hello, AWS World!! CodeCommit S3 CodePipeLine
</body>
</html>
$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   index.html

no changes added to commit (use "git add" and/or "git commit -a")
$ git diff
diff --git a/index.html b/index.html
index 7986b4d..86b19c9 100644
--- a/index.html
+++ b/index.html
@@ -3,10 +3,9 @@
 <html lang="ja">
 <head>
   <meta charset="utf-8">
-  <title>S3 Static Web Hosting Code Commit</title>
+  <title>S3 Static Web Hosting Code Commit CodePipeLine</title>
 </head>
 <body>
-  Hello, AWS World!! CodeCommit
+  Hello, AWS World!! CodeCommit S3 CodePipeLine
 </body>
$ git add index
$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        modified:   index.html
$ git commit -m "Mod: Add codepipelone wording"  
[master efc3aa8] Mod: Add codepipelone wording
 1 file changed, 2 insertions(+), 3 deletions(-)
$ git log --oneline  
efc3aa8 (HEAD -> master) Mod: Add codepipelone wording
1382fb6 (origin/master) Add: index.html
$
$ git push origin master

S3

アクセス

* 変更されたindex.htmlが表示されることを確認

CodePipeLine

確認

パイプライン