diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fa3331b..91993f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,14 +14,14 @@ permissions: contents: read jobs: -# build: -# name: CI -# runs-on: ubuntu-latest -# environment: production -# -# steps: -# - name: Checkout -# uses: actions/checkout@v4 + build: + name: CI + runs-on: ubuntu-latest + environment: production + + steps: + - name: Checkout + uses: actions/checkout@v4 # # - name: Make application-secret.yml and set secrets # run: | @@ -64,16 +64,16 @@ jobs: # docker build -t $ECR_REGISTRY/$ECR_REPOSITORY . # docker push $ECR_REGISTRY/$ECR_REPOSITORY # -# - name: Zip deployment files -# run: | -# zip -r ${{ env.ZIP_FILE_NAME }} ./aws/ -# -# - name: Upload AppSpec and scripts to S3 -# run: | -# aws s3 cp ${{ env.ZIP_FILE_NAME }} s3://${{ secrets.S3_BUCKET }}/${{ env.ZIP_FILE_NAME }} + - name: Zip deployment files + run: | + zip -r ${{ env.ZIP_FILE_NAME }} ./aws/ + + - name: Upload AppSpec and scripts to S3 + run: | + aws s3 cp ${{ env.ZIP_FILE_NAME }} s3://${{ secrets.S3_BUCKET }}/${{ env.ZIP_FILE_NAME }} deploy: -# needs: build + needs: build name: Trigger CD (CodeDeploy) runs-on: ubuntu-latest diff --git a/aws/kill_process.sh b/aws/kill_process.sh index f48bf8e..011cdcb 100644 --- a/aws/kill_process.sh +++ b/aws/kill_process.sh @@ -1,3 +1,11 @@ #!/bin/bash -sudo docker rm -f $(docker ps -qa) \ No newline at end of file +# 실행 중이거나 중지된 컨테이너 목록을 가져옴 +containers=$(docker ps -qa) + +# 컨테이너가 존재하면 삭제 +if [ -n "$containers" ]; then + sudo docker rm -f $containers +else + echo "No containers to remove." +fi