Know How Guide and Hands on Guide for AWS
Create a CodeCommit Repository: SampleWebsite
ssh://git-codecommit.ap-southeast-1.amazonaws.com/v1/repos/SampleWebsite
cd SampleWebsite
wget https://docs.aws.amazon.com/codepipeline/latest/userguide/samples/sample-website.zip
unzip sample-website.zip -d SampleWebsite
mv sample-website/* SampleWebsite/
rm -r sample-website
Modify the index.html
zip -r SampleAp
Here I use the ray-webhosting-demo
as bucket with Endpoint : http://ray-webhosting-demo.s3-website-ap-southeast-1.amazonaws.com
git add -A
git commit -m "Added static website files"
git push
MyS3DeployPipeline
SampleWebsite
, branch: masterray-webhosting-demo
aws s3 ls s3://ray-webhosting-demo --region ap-southeast-1 --profile global
2020-08-13 06:43:27 3963 error.html
2020-08-13 06:43:27 25628 graphic.jpg
2020-08-13 06:43:27 313 index.html
2020-08-13 06:43:27 264 main.css
phases: install: commands: - npm install -g typescript build: commands: - tsc index.ts artifacts: files: - index.js secondary-artifacts: artifact1: files: - index.js name: secondary_artifact_ts_files
Reference [build-spec-ref](https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html)
2. create the index.ts
```ts
interface Greeting {
message: string;
}
class HelloGreeting implements Greeting {
message = "Hello!";
}
function greet(greeting: Greeting) {
console.log(greeting.message);
}
let greeting = new HelloGreeting();
greet(greeting);
MyS3DeployPipeline
pipeline to add build stage
MyCodeBuildRole
with AWSCodeBuildAdminAccess, AmazonS3ReadOnlyAccess, and IAMFullAccessChoose Continue to CodePipeline. A message is displayed if the project was created successfully.
git add .
git commit -m "add index.ts and buildspec.yml"
aws s3 ls s3://ray-webhosting-demo --recursive --region ap-southeast-1 --profile global
2020-08-13 09:50:12 268 S3WebHosting/index.js
2020-08-13 09:50:17 269 buildspec.yml
2020-08-13 09:50:17 3963 error.html
2020-08-13 09:50:17 25628 graphic.jpg
2020-08-13 09:50:17 732 index.html
2020-08-13 09:50:17 242 index.ts
2020-08-13 09:50:17 264 main.css