Skip to content

Commit

Permalink
Deployment changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Aayush-Agnihotri committed Nov 7, 2024
1 parent d6859cc commit 30737aa
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 94 deletions.
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,8 @@
/*.config

# Sensitive configuration files
.env
.mysql-env
.all-in-env
mysql-init.sql
application-*.yml
application-*.properties
src/main/resources/application.properties
/deployment
application.properties
13 changes: 6 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ repos:
- id: pretty-format-java
args: [--aosp, --autofix]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer

- repo: local
hooks:
- id: maven-tests
Expand All @@ -13,10 +19,3 @@ repos:
language: system
pass_filenames: false
always_run: true

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: detect-private-key
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,20 @@ Before setting up the project, ensure you have the following installed:

### 2. Create application.properties

Manually create an application.properties file in src/main/resources/ with the following content:
Create a new `application.properties` file located in src/main/resources/ by copying the `application.properties.template` file in the same directory. Fill in the values for the fields below with your MySQL credentials:

- spring.datasource.url=jdbc:mysql://localhost:3306/all_in
- spring.datasource.username=your_mysql_username
- spring.datasource.password=your_mysql_password
- spring.jpa.hibernate.ddl-auto=update
- spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
- spring.datasource.username=
- spring.datasource.password=

Change `spring.datasource.url=` if you are not hosting a MySQL instance locally.

### 3. Set up the Database

Ensure you have a running MySQL instance and create a database named all_in:
Enter the MySQL Shell by running:

mysql -u {MYSQL USERNAME} -p

Create the all_in database with:

CREATE DATABASE all_in;

Expand All @@ -39,7 +42,7 @@ Run:

- mvn -N wrapper:wrapper
- pip install pre-commit
- zsh start.sh (on Mac)
- ./mvnw spring-boot:run

### 5. Documentation

Expand Down
65 changes: 0 additions & 65 deletions TODO.txt

This file was deleted.

5 changes: 0 additions & 5 deletions my.cnf

This file was deleted.

15 changes: 15 additions & 0 deletions src/main/resources/application-prod.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
spring.datasource.url=${SPRING_DATASOURCE_URL}
spring.datasource.username=${SPRING_DATASOURCE_USERNAME}
spring.datasource.password=${SPRING_DATASOURCE_PASSWORD}
spring.jpa.hibernate.ddl-auto=${SPRING_JPA_HIBERNATE_DDL_AUTO}

spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.jpa.show-sql=true
spring.jackson.serialization.fail-on-empty-beans=false

spring.datasource.hikari.minimumIdle=5
spring.datasource.hikari.maximumPoolSize=20
spring.datasource.hikari.idleTimeout=300000
spring.datasource.hikari.maxLifetime=600000
spring.datasource.hikari.connectionTimeout=30000
spring.datasource.hikari.leakDetectionThreshold=2000
8 changes: 4 additions & 4 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
spring.datasource.url=${SPRING_DATASOURCE_URL:jdbc:mysql://${MYSQL_HOST:localhost}:3306/all_in}
spring.datasource.username=${SPRING_DATASOURCE_USERNAME:springuser}
spring.datasource.password=${SPRING_DATASOURCE_PASSWORD:password}
spring.jpa.hibernate.ddl-auto=${SPRING_JPA_HIBERNATE_DDL_AUTO:create-drop}
spring.datasource.url=jdbc:mysql://localhost:3306/all_in
spring.datasource.username=springuser
spring.datasource.password=password
spring.jpa.hibernate.ddl-auto=update

spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.jpa.show-sql=true
Expand Down
15 changes: 15 additions & 0 deletions src/main/resources/application.properties.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
spring.datasource.url=jdbc:mysql://localhost:3306/all_in
spring.datasource.username=
spring.datasource.password=
spring.jpa.hibernate.ddl-auto=update

spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.jpa.show-sql=true
spring.jackson.serialization.fail-on-empty-beans=false

spring.datasource.hikari.minimumIdle=5
spring.datasource.hikari.maximumPoolSize=20
spring.datasource.hikari.idleTimeout=300000
spring.datasource.hikari.maxLifetime=600000
spring.datasource.hikari.connectionTimeout=30000
spring.datasource.hikari.leakDetectionThreshold=2000
1 change: 0 additions & 1 deletion start.sh

This file was deleted.

0 comments on commit 30737aa

Please sign in to comment.