Skip to content

Commit

Permalink
#6 #7 fix: 노트 첨부 사진 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
g16rim committed Nov 14, 2023
1 parent dab7e26 commit 8aab4ec
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
15 changes: 1 addition & 14 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,4 @@ jobs:
docker stop $(docker ps -a -q)
docker run -d --log-driver=syslog -p 8080:8080 -e SPRING_PROFILES_ACTIVE=prod ${{ secrets.DOCKER_USERNAME }}/yourwriting:latest
docker rm $(docker ps --filter 'status=exited' -a -q)
docker image prune -a -f
# - name: AWS credential 설정
# uses: aws-actions/configure-aws-credentials@v1
# with:
# aws-region: ${{ env.AWS_REGION }}
# aws-access-key-id: ${{ secrets.CICD_ACCESS_KEY_ID }}
# aws-secret-access-key: ${{ secrets.CICD_SECRET_ACCESS_KEY }}
#
# - name: S3로 upload
# run: aws deploy push --application-name ${{ env.AWS_CODE_DEPLOY_APPLICATION }} --ignore-hidden-files --s3-location s3://$AWS_S3_BUCKET/yw-cicd/$GITHUB_SHA.zip --source .
#
# - name: EC2에 배포
# run: aws deploy create-deployment --application-name ${{ env.AWS_CODE_DEPLOY_APPLICATION }} --deployment-config-name CodeDeployDefault.AllAtOnce --deployment-group-name ${{ env.AWS_CODE_DEPLOY_GROUP }} --s3-location bucket=$AWS_S3_BUCKET,key=yw-cicd/$GITHUB_SHA.zip,bundleType=zip
docker image prune -a -f
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,11 @@ public void deleteNoteFileList(Long noteId) {
@Override
public void deleteFile(String storedName, String path) {
String objectKey = path + "/" + storedName;
if (!amazonS3.doesObjectExist(bucketName, objectKey)) {
if (amazonS3.doesObjectExist(bucketName, objectKey)) {
amazonS3.deleteObject(bucketName, objectKey);
}
else {
throw new FileException(ErrorCode.FILE_NOT_FOUND);
}
amazonS3.deleteObject(bucketName, objectKey);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public NoteRes.ContentRes updateNote(Long id, NoteReq.ContentReq req) {
.update(req.getTitle(), req.getContent());

if (req.getFiles() != null) {
deleteNote(id);
uploadFiles(updatedNote, req.getFiles());
}

Expand Down

0 comments on commit 8aab4ec

Please sign in to comment.