1
0

#18 Add profiles

This commit is contained in:
2022-05-09 22:18:20 +02:00
parent f89ebaa44e
commit 1b9ce54933
7 changed files with 21 additions and 7 deletions

View File

@@ -7,6 +7,7 @@ import org.springframework.context.annotation.PropertySource;
@Configuration
@ConfigurationProperties(prefix = "nbs-cloud.files")
@PropertySource("classpath:/config/files-application.properties")
@PropertySource(value = "classpath:/config/files-application-${spring.profiles.active}.properties", ignoreResourceNotFound = true)
public class FilesConfig {
private String baseDir;
private boolean filterHidden;

View File

@@ -0,0 +1 @@
nbs-cloud.files.baseDir=/opt/nextcloud_data/marius/files

View File

@@ -5,7 +5,7 @@ info.app.description=A simple web file admin app
# Knob to configure the base dir where files stores and reads files
# Make sure the permissions match
nbs-cloud.files.baseDir=/opt/nextcloud_data/marius/files
nbs-cloud.files.baseDir=/home/marius/nbstest
# Knob to configure whether hidden files (e.g. starting with '.' on *NIX)
# will be filtered in the file view

10
pom.xml
View File

@@ -32,6 +32,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>18</java.version>
<scmDeveloperConnectionProp />
<deploymentProfile></deploymentProfile>
</properties>
<distributionManagement>
@@ -194,4 +195,13 @@
</plugins>
</build>
<profiles>
<profile>
<id>release</id>
<properties>
<activeProfiles>${deploymentProfile}</activeProfiles>
</properties>
</profile>
</profiles>
</project>

View File

@@ -3,13 +3,16 @@
workspace_loc=$1
echo "$workspace_loc"
profile=$2
echo "$profile"
pwd
deploy_tmp="deploy_tmp"
target_loc="/opt/nbscloud"
app_props_loc="$workspace_loc/web-container/target/classes/config/application.properties"
files_prop_loc="$workspace_loc/files/target/classes/config/files-application.properties"
app_props_loc="$workspace_loc/web-container/target/classes/config/application-$profile.properties"
files_prop_loc="$workspace_loc/files/target/classes/config/files-application-$profile.properties"
echo "$app_props_loc"
echo "$files_prop_loc"

View File

@@ -0,0 +1,2 @@
nbscloud.deploy.service.user=marius
nbscloud.deploy.path=/opt/nbscloud

View File

@@ -19,7 +19,4 @@ logging.level.de.nbscloud=DEBUG
# (e.g. systemd -> journald)
server.servlet.context-path=/nbscloud
server.port=9966
nbscloud.deploy.service.user=marius
nbscloud.deploy.path=/opt/nbscloud
server.port=9966