Skip to content

Commit

Permalink
Merge pull request #3 from JacekKaczmarek10/feat/update-update.sh
Browse files Browse the repository at this point in the history
feat: improve variables security
  • Loading branch information
JacekKaczmarek10 authored Jun 8, 2024
2 parents 685d6c7 + e17e14f commit 80f6409
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,23 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: Update db url
run: sed -i 's/<db_url>/${{ secrets.DB_URL }}/' src/main/resources/application.properties

- name: Update db username
run: sed -i 's/<db_username>/${{ secrets.DB_USERNAME }}/' src/main/resources/application.properties

- name: Update db password
run: sed -i 's/<db_password>/${{ secrets.DB_PASSWORD }}/' src/main/resources/application.properties

- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
cache: maven

- name: Build with Maven
run: mvn clean install --batch-mode

Expand All @@ -37,4 +48,4 @@ jobs:
password: ${{ secrets.VPS_PASSWORD }}
script: |
cd /srv/Server-Monitoring-Tool &&
sudo ./update.sh
sudo ./update.sh
15 changes: 9 additions & 6 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
spring.datasource.url=jdbc:h2:mem:DockerMonitor
# Database
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=password
spring.application.name=DockerMonitor
server.port=8052
spring.datasource.url=<db_url>
spring.datasource.username=<db_username>
spring.datasource.password=<db_password>

# Swagger
springfox.documentation.swagger-ui.enabled=true
springfox.documentation.swagger-ui.operations-sorter=method
springdoc.swagger-ui.path=/swagger-ui.html
springdoc.swagger-ui.path=/swagger-ui.html

# App
spring.application.name=DockerMonitor
server.port=8052
1 change: 0 additions & 1 deletion update.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
sudo docker system prune &&
sudo git pull -f && sudo docker compose down && sudo docker compose up -d --build

0 comments on commit 80f6409

Please sign in to comment.