-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: move slack uri from system environment to properties * feat: update .gitignore to include terraform file exclusions * feat: add terraform infrastructure and configuration updates for dev * test: fix broken tests * feat: upgrade gradle version from 6.8.3 to 8.10 * feat: upgrade spring to 3.4.1 and java to 21 - remove dependencies related to elasticsearch - delete code implemented using elasticsearch - eliminate static keyword in entity initialization - migrate from javax to jakarta - fix minor problematic code issues - apply code formatting * feat: configure application settings using aws secretsmanager * feat: add secrets manager access role to ec2 * feat: upgrade java version from 1.8 to 21 * feat: update gitHub actions deploy scripts * feat: update secret name * feat: update logback configuration to new syntax * feat: upgrade flyway version from 6.4.2 to 9.x * feat: add environment variables for build and deploy * fix: apply spring expression language syntax * feat: add health check controller * fix: remove duplicate health check controller * fix: resolve minor deploy issue * fix: remove unexpected character from flyway script * fix: add command to pkill with sudo * fix: add tf api token * refactor: remove elastic search dependencies * fix: change terraform name * feat: update java version from 11 to 21 --------- Co-authored-by: woowahan-neo <[email protected]>
- Loading branch information
1 parent
b8433e5
commit 95d8c1b
Showing
413 changed files
with
3,719 additions
and
2,860 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: back deploy | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
environment: | ||
description: 'Target environment (dev, prod)' | ||
required: true | ||
default: 'dev' | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
environment: ${{ github.event.inputs.environment }} | ||
services: | ||
mysql: | ||
image: mysql:8.0.28 | ||
env: | ||
MYSQL_USER: user | ||
MYSQL_PASSWORD: password | ||
MYSQL_ROOT_PASSWORD: root | ||
MYSQL_DATABASE: prolog | ||
ports: | ||
- 13306:3306 | ||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | ||
|
||
steps: | ||
- name: Checkout Source Code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up JDK 21 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'corretto' | ||
java-version: 21 | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x ./gradlew | ||
shell: bash | ||
working-directory: backend | ||
|
||
- name: Build with Gradle | ||
run: ./gradlew flywayClean flywayBaseline flywayMigrate bootJar -Dflyway.baselineVersion=0 | ||
shell: bash | ||
working-directory: backend | ||
|
||
- name: Generate deployment package | ||
working-directory: backend | ||
run: | | ||
mkdir -p deploy | ||
cp build/libs/*.jar deploy/app.jar | ||
cp appspec.yml deploy/appspec.yml | ||
cp -r scripts deploy/scripts | ||
cd deploy && zip -r app.zip . | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ secrets.AWS_REGION }} | ||
|
||
- name: Upload to S3 | ||
run: | | ||
aws s3 cp backend/deploy/app.zip s3://${{ secrets.BUCKET_NAME }}/app.zip | ||
- name: Trigger AWS CodeDeploy | ||
run: | | ||
aws deploy create-deployment \ | ||
--application-name ${{ secrets.APPLICATION_NAME }} \ | ||
--deployment-group-name ${{ secrets.DEPLOYMENT_GROUP_NAME }} \ | ||
--s3-location bucket=${{ secrets.BUCKET_NAME }},key=app.zip,bundleType=zip \ | ||
--deployment-config-name CodeDeployDefault.AllAtOnce \ | ||
--auto-rollback-configuration enabled=true,events=DEPLOYMENT_FAILURE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: terraform deploy | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
environment: | ||
description: 'Target environment (dev, prod)' | ||
required: true | ||
default: 'dev' | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
env: | ||
TF_API_TOKEN: ${{ secrets.TF_API_TOKEN }} | ||
|
||
steps: | ||
- name: Checkout Source Code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Terraform | ||
uses: hashicorp/setup-terraform@v2 | ||
with: | ||
terraform_version: 1.5.3 | ||
|
||
- name: Select workspace | ||
run: | | ||
ENVIRONMENT=${{ github.event.inputs.environment }} | ||
terraform workspace select "$ENVIRONMENT" || terraform workspace new "$ENVIRONMENT" | ||
- name: Terraform Init and Apply | ||
run: | | ||
terraform init | ||
terraform plan -out=tfplan | ||
terraform apply tfplan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
version: 0.0 | ||
os: linux | ||
|
||
files: | ||
- source: /app.jar | ||
destination: /home/ec2-user/ | ||
|
||
hooks: | ||
ApplicationStop: | ||
- location: scripts/stop-app.sh | ||
timeout: 300 | ||
runas: ec2-user | ||
|
||
BeforeInstall: | ||
- location: scripts/before-install.sh | ||
timeout: 300 | ||
runas: ec2-user | ||
|
||
AfterInstall: | ||
- location: scripts/after-install.sh | ||
timeout: 300 | ||
runas: ec2-user | ||
|
||
ApplicationStart: | ||
- location: scripts/start-app.sh | ||
timeout: 300 | ||
runas: ec2-user |
Oops, something went wrong.