Skip to content

Commit

Permalink
Update config deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
fpapon committed Apr 3, 2024
1 parent d73c223 commit 7c81df4
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 2 deletions.
17 changes: 15 additions & 2 deletions app-backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>${h2.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

Expand Down Expand Up @@ -197,7 +196,6 @@
<java.net.preferIPv4Stack>true</java.net.preferIPv4Stack>
<fusion.http-server.port>0</fusion.http-server.port>
<fusion.observability.server.port>0</fusion.observability.server.port>
<fusion.persistence.contextLess>true</fusion.persistence.contextLess>
<fusion.persistence.datasource.url>jdbc:h2:mem:fusion;mode=PostgreSQL;INIT=runscript from '../src/database/fusion-dump.sql'</fusion.persistence.datasource.url>
<fusion.persistence.datasource.username>sa</fusion.persistence.datasource.username>
<fusion.persistence.datasource.driver>org.h2.Driver</fusion.persistence.datasource.driver>
Expand Down Expand Up @@ -248,6 +246,21 @@
<com.meecrogate.cmd>docker run ${image.name} &lt;args&gt;</com.meecrogate.cmd>
</labels>
</container>
<extraDirectories>
<paths>
<path>
<from>${project.parent.basedir}/src/database</from>
<into>/opt/yupiik/fusion/database</into>
<includes>fusion-dump.sql</includes>
</path>
</paths>
<permissions>
<permission>
<file>/opt/yupiik/fusion/database/fusion-dump.sql</file>
<mode>644</mode>
</permission>
</permissions>
</extraDirectories>
</configuration>
</plugin>
</plugins>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (c) 2022-present - Yupiik SAS - https://www.yupiik.com
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package io.yupiik.fusion.examples.backend.configuration;

import io.yupiik.fusion.framework.api.configuration.ConfigurationSource;
import io.yupiik.fusion.framework.api.scope.DefaultScoped;

import java.util.Objects;

@DefaultScoped
public class ImplicitConfig implements ConfigurationSource {

@Override
public String get(String key) {
return Objects.equals(key, "fusion.persistence.contextLess") ? "true" : null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
"_JAVA_OPTIONS": "-XX:+ExitOnOutOfMemoryError -XX:MaxRAMPercentage=75 -Djdk.httpclient.keepalive.timeout=30 -Dsun.net.inetaddr.ttl=30 -Dio.yupiik.logging.jul.handler.StandardHandler.formatter=json",

"APPLICATION_ENVIRONMENT":"{{app.environment:-development}}",
"FUSION_PERSISTENCE_DATASOURCE_URL": "jdbc:h2:mem:fusion;mode=PostgreSQL;INIT=runscript from '/opt/yupiik/fusion/database/fusion-dump.sql'",
"FUSION_PERSISTENCE_DATASOURCE_USERNAME": "sa",
"FUSION_PERSISTENCE_DATASOURCE_DRIVER": "org.h2.Driver",

"BACKEND_ZIPKIN": "http://zipkin.observability.svc.cluster.local:9411/api/v2/spans"
}
Expand Down

0 comments on commit 7c81df4

Please sign in to comment.