version: 0.2
phases:
install:
runtime-versions:
nodejs: latest
commands:
# install yarn
- npm install yarn
# install dependencies
- yarn
# so that build commands work
- yarn add eslint-config-react-app
build:
commands:
# run build script
- yarn build
artifacts:
# include all files required to run application
# we include only the static build files
files:
- '**/*'
base-directory: 'build'
amplify init
để khởi tạo một dự án Amplify mới. Chọn câu trả lời như dưới đây:FCJServerlessDMS
)Yes
)amplify import auth
để import tài nguyên Amazon Cognito mà chúng ta đã tạo vào project. Chọn câu trả lời như dưới đây:amplify import storage
để import bucket chúng ta đã tạo vào project. Chọn câu trả lời như dưới đây:amplify push
để cập nhật các resource trên cloud.aws_exports.js
aws codecommit create-repository --repository-name fcjdms-frontend
Bạn sẽ thấy đầu ra tương tự như sau
{
"repositoryMetadata": {
"accountId": "111111111111",
"repositoryId": "925fa242-d110-47b4-9ef0-b62815120358",
"repositoryName": "fcjdms-frontend",
"lastModifiedDate": "2023-04-10T09:54:38.755000+07:00",
"creationDate": "2023-04-10T09:54:38.755000+07:00",
"cloneUrlHttp": "https://git-codecommit.ap-southeast-1.amazonaws.com/v1/r epos/fcjdms-frontend",
"cloneUrlSsh": "ssh://git-codecommit.ap-southeast-1.amazonaws.com/v1/repos/fcjdms-frontend",
"Arn": "arn:aws:codecommit:ap-southeast-1:111111111111:fcjdms-frontend"
}
}
git checkout main
git add .
git commit -m "Initial commit"
git remote add origin codecommit://fcjdms-frontend
Nếu origin đã tồn tại hoặc url bị sai, có thể xoá bằng cách chạy: git remote rm origin
git push -u origin main