diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 86758cd..79c2a56 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -14,12 +14,23 @@ jobs: steps: - uses: actions/checkout@v4 + + - name: Update db url + run: sed -i 's//${{ secrets.DB_URL }}/' src/main/resources/application.properties + + - name: Update db username + run: sed -i 's//${{ secrets.DB_USERNAME }}/' src/main/resources/application.properties + + - name: Update db password + run: sed -i 's//${{ 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 @@ -37,4 +48,4 @@ jobs: password: ${{ secrets.VPS_PASSWORD }} script: | cd /srv/Server-Monitoring-Tool && - sudo ./update.sh \ No newline at end of file + sudo ./update.sh diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index fbd4070..6122404 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -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= +spring.datasource.username= +spring.datasource.password= # Swagger springfox.documentation.swagger-ui.enabled=true springfox.documentation.swagger-ui.operations-sorter=method -springdoc.swagger-ui.path=/swagger-ui.html \ No newline at end of file +springdoc.swagger-ui.path=/swagger-ui.html + +# App +spring.application.name=DockerMonitor +server.port=8052 \ No newline at end of file diff --git a/update.sh b/update.sh index 656e466..b47d394 100755 --- a/update.sh +++ b/update.sh @@ -1,2 +1 @@ -sudo docker system prune && sudo git pull -f && sudo docker compose down && sudo docker compose up -d --build