#18 Add profiles
This commit is contained in:
@@ -7,6 +7,7 @@ import org.springframework.context.annotation.PropertySource;
|
|||||||
@Configuration
|
@Configuration
|
||||||
@ConfigurationProperties(prefix = "nbs-cloud.files")
|
@ConfigurationProperties(prefix = "nbs-cloud.files")
|
||||||
@PropertySource("classpath:/config/files-application.properties")
|
@PropertySource("classpath:/config/files-application.properties")
|
||||||
|
@PropertySource(value = "classpath:/config/files-application-${spring.profiles.active}.properties", ignoreResourceNotFound = true)
|
||||||
public class FilesConfig {
|
public class FilesConfig {
|
||||||
private String baseDir;
|
private String baseDir;
|
||||||
private boolean filterHidden;
|
private boolean filterHidden;
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
nbs-cloud.files.baseDir=/opt/nextcloud_data/marius/files
|
||||||
@@ -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
|
# Knob to configure the base dir where files stores and reads files
|
||||||
# Make sure the permissions match
|
# 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)
|
# Knob to configure whether hidden files (e.g. starting with '.' on *NIX)
|
||||||
# will be filtered in the file view
|
# will be filtered in the file view
|
||||||
|
|||||||
10
pom.xml
10
pom.xml
@@ -32,6 +32,7 @@
|
|||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<java.version>18</java.version>
|
<java.version>18</java.version>
|
||||||
<scmDeveloperConnectionProp />
|
<scmDeveloperConnectionProp />
|
||||||
|
<deploymentProfile></deploymentProfile>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
@@ -194,4 +195,13 @@
|
|||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
<profiles>
|
||||||
|
<profile>
|
||||||
|
<id>release</id>
|
||||||
|
<properties>
|
||||||
|
<activeProfiles>${deploymentProfile}</activeProfiles>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -3,13 +3,16 @@
|
|||||||
workspace_loc=$1
|
workspace_loc=$1
|
||||||
echo "$workspace_loc"
|
echo "$workspace_loc"
|
||||||
|
|
||||||
|
profile=$2
|
||||||
|
echo "$profile"
|
||||||
|
|
||||||
pwd
|
pwd
|
||||||
|
|
||||||
deploy_tmp="deploy_tmp"
|
deploy_tmp="deploy_tmp"
|
||||||
target_loc="/opt/nbscloud"
|
target_loc="/opt/nbscloud"
|
||||||
|
|
||||||
app_props_loc="$workspace_loc/web-container/target/classes/config/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.properties"
|
files_prop_loc="$workspace_loc/files/target/classes/config/files-application-$profile.properties"
|
||||||
|
|
||||||
echo "$app_props_loc"
|
echo "$app_props_loc"
|
||||||
echo "$files_prop_loc"
|
echo "$files_prop_loc"
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
nbscloud.deploy.service.user=marius
|
||||||
|
nbscloud.deploy.path=/opt/nbscloud
|
||||||
@@ -20,6 +20,3 @@ logging.level.de.nbscloud=DEBUG
|
|||||||
|
|
||||||
server.servlet.context-path=/nbscloud
|
server.servlet.context-path=/nbscloud
|
||||||
server.port=9966
|
server.port=9966
|
||||||
|
|
||||||
nbscloud.deploy.service.user=marius
|
|
||||||
nbscloud.deploy.path=/opt/nbscloud
|
|
||||||
Reference in New Issue
Block a user