Skip to content

Commit d90ab75

Browse files
authored
Configuration for store caches (#75)
* Prepare for store caches * Prepare for store caches * Fix cache property name * Remove oss plugin center url for snapshots * Log change
1 parent fa0baf4 commit d90ab75

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
### Added
1313
- [#72] Configuration options for resource requirements
1414
- [#72] Defaults for CPU and memory requests
15+
- Configuration options for store caches ([#75](https://github.com/cloudogu/scm/pull/75))
1516
### Removed
1617
- Default Plugins ([#70](https://github.com/cloudogu/scm/pull/70))
1718

dogu.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,18 @@
182182
"Validation": {
183183
"Type": "BINARY_MEASUREMENT"
184184
}
185+
},
186+
{
187+
"Name": "caching/stores/enabled",
188+
"Description": "To enable store caches, set this to 'true'.",
189+
"Optional": true,
190+
"Default": "false"
191+
},
192+
{
193+
"Name": "caching/dataFiles/size",
194+
"Description": "To enable data file caches, set this to an integer value > 0.",
195+
"Optional": true,
196+
"Default": "0"
185197
}
186198
],
187199
"ExposedPorts": [
@@ -238,4 +250,4 @@
238250
"Type": "tcp",
239251
"Port": 8080
240252
}
241-
}
253+
}

resources/etc/default/scm-server

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,11 @@ if [ "$(doguctl config 'caching/workdir/size' -d 'empty')" != "empty" ]; then
2727
SCM_WORKDIR_CACHE=$(doguctl config "caching/workdir/size")
2828
EXTRA_JVM_ARGUMENTS="$EXTRA_JVM_ARGUMENTS -Dscm.workingCopyPoolSize=${SCM_WORKDIR_CACHE} -Dscm.workingCopyPoolStrategy=sonia.scm.repository.work.SimpleCachingWorkingCopyPool"
2929
fi
30+
31+
if [ "$(doguctl config 'caching/stores/enabled' -d 'false')" == "true" ]; then
32+
EXTRA_JVM_ARGUMENTS="$EXTRA_JVM_ARGUMENTS -Dscm.storeCache.enabled=true"
33+
fi
34+
if [ "$(doguctl config 'caching/dataFiles/size' -d '0')" > 0 ]; then
35+
DATA_FILE_CACHE_SIZE=$(doguctl config 'caching/dataFiles/size')
36+
EXTRA_JVM_ARGUMENTS="$EXTRA_JVM_ARGUMENTS -Dscm.cache.dataFile.maximumSize=${DATA_FILE_CACHE_SIZE} -Dscm.cache.dataFileCache.enabled=true"
37+
fi

resources/var/tmp/scm/init.script.d/020-configuration.groovy

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ def context = injector.getInstance(SCMContextProvider.class);
5555
String pluginCenterUrl = getValueFromEtcd("plugin_center_url");
5656
if (pluginCenterUrl != null && !pluginCenterUrl.isEmpty()) {
5757
config.setPluginUrl(pluginCenterUrl);
58-
} else if (context.version.contains("SNAPSHOT")) {
59-
config.setPluginUrl("https://oss.cloudogu.com/jenkins/job/scm-manager-github/job/ci-plugin-snapshot/job/master/lastSuccessfulBuild/artifact/plugins/plugin-center.json");
60-
config.setPluginAuthUrl("");
6158
}
6259

6360
String pluginCenterAuthenticationUrl = getValueFromEtcd("plugin_center_authentication_url");

0 commit comments

Comments
 (0)