Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[Github Action] AWS CodeDeploy Succeeded but in EC2 created modified file

Abierto
#96 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
aws, github-actions, linux, nodejs, shell
Área
ci-cd, cloud, devops

Línea de trabajo

Comienza revisando cicd.yml y appspec.yml; después, compara el registro de despliegue de CodeDeploy con los archivos presentes en /var/www/MyProject. Determina por qué el archivo modificado permanece después del despliegue y documenta la configuración o el comportamiento del despliegue que explica el resultado.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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
image

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

Group 3

=> 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.

Lenguaje dominante
Shell
Estrellas
639
Forks
775
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de aws-samples/aws-codedeploy-samples

Todos los issues de aws-samples/aws-codedeploy-samples

Issues similares

Más issues de Shell/Bash

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.