[Github Action] AWS CodeDeploy Succeeded but in EC2 created modified file
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 25/100
研究方向
先檢查 cicd.yml 和 appspec.yml,然後將 CodeDeploy 部署日誌與 /var/www/MyProject 下的檔案進行比較。判斷修改後的檔案為何在部署後仍然存在,並記錄能夠解釋此結果的設定或部署行為。
由索引模型根據 Issue 內容生成。
描述
Hi everyone, i'm setting up the Github Action, AWS EC2, CodeDeploy. All the configuration seems working well. But excepts one thing. I can not understand and how can i solve it. If someone have experiences about this please help me.
I'm using:
- EC2 Rhel 8
- Node project (VueJs framework)
This is my cicd.yml file
on:
push:
branches:
- paymentV2
name: Deploy VueJS to Amazon ECS
#on: [push]
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['12.x']
appname: ['staging-aws-codedeploy']
deploy-group: ['staging']
repo: ['project/MyProject']
steps:
- uses: actions/checkout@v2
# Configure AWS credentials
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-southeast-1
# Deploy to AWS
- name: Deploy to AWS
run: |
aws deploy create-deployment \
--application-name ${{ matrix.appname }} \
--deployment-config-name CodeDeployDefault.OneAtATime \
--deployment-group-name ${{ matrix.deploy-group }} \
--file-exists-behavior OVERWRITE \
--description "GitHub Deployment for the ${{ matrix.appname }}-${{ github.sha }}" \
--github-location repository=${{ matrix.repo }},commitId=${{ github.sha }}
This is my appspec.yml
version: 0.0
os: linux
files:
- source: /
destination: /var/www/MyProject
hooks:
ApplicationStart:
- location: scripts/application_start.sh
timeout: 300
runas: root
#scripts/application_start.sh
#cd /var/www/MyProject
#npm run build
This is the log from Github action & CodeDeploy AWS

I've tried editing the Vision.vue file and created the pull request on Github. Everything was working well. But one thing i'm confusing is why the modified file is existed. Please refer the image below

=> What am i expected is the modified file shouldn't have existed. I thought that Github should be automatically run git pull to get all new source code.
I've some more researched and found --file-exists-behavior with OVERWRITE but it seems not working as i want.
https://docs.aws.amazon.com/cli/latest/reference/deploy/create-deployment.html
==> Once again, i have no experience about CD by Github action & CodeDeploy. Everyone please help me and advice me the right thing. Thank you so much.
- 主要語言
- Shell
- 星號
- 639
- 分支
- 775
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
aws-samples/aws-codedeploy-samples 的其他 Issue
-
common_functions.sh does not use IMDSv2可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 2/5 1-3 小時 新手友好度 62/100
-
難度 5/5 一週以上 新手友好度 20/100
-
難度 5/5 一週以上 新手友好度 15/100
-
難度 5/5 一週以上 新手友好度 20/100
aws-samples/aws-codedeploy-samples#98 · 1 則留言 ·
-
難度 4/5 3-5 天 新手友好度 25/100
查看 aws-samples/aws-codedeploy-samples 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 78/100
rossoctl/automation#130 ·
維護者通常 3 天內回覆
-
難度 2/5 1-3 小時 新手友好度 75/100
-
難度 2/5 1-3 小時 新手友好度 72/100
fairagro/m4.2_infrastructure#68 · 3 則留言 ·
維護者通常 1 天內回覆
-
security
難度 2/5 1-3 小時 新手友好度 72/100
Eyevinn/python-runner#38 ·
-
lesson-submission pending-review
難度 2/5 1-3 小時 新手友好度 85/100
Ikalus1988/MisakaNet#4446 ·
維護者通常 1 天內回覆