Compare commits
2 Commits
1998.v3e50
...
master
| Author | SHA1 | Date |
|---|---|---|
|
|
9ea946218b | |
|
|
4cb0061076 |
|
|
@ -0,0 +1,30 @@
|
||||||
|
# Configure ThinBackup
|
||||||
|
|
||||||
|
Requires `thin-backup` >= 2.0
|
||||||
|
Basic configuration of [ThinBackup](https://plugins.jenkins.io/thinBackup/) plugin.
|
||||||
|
|
||||||
|
## Sample configuration
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
unclassified:
|
||||||
|
thinBackup:
|
||||||
|
backupAdditionalFiles: false
|
||||||
|
backupAdditionalFilesRegex: "^.*\\.(txt)$"
|
||||||
|
backupBuildArchive: false
|
||||||
|
backupBuildResults: true
|
||||||
|
backupBuildsToKeepOnly: false
|
||||||
|
backupConfigHistory: false
|
||||||
|
backupNextBuildNumber: false
|
||||||
|
backupPath: "c:\\temp\\thin-backup"
|
||||||
|
backupPluginArchives: false
|
||||||
|
backupUserContents: false
|
||||||
|
cleanupDiff: false
|
||||||
|
diffBackupSchedule: "0 12 * * 1-5"
|
||||||
|
excludedFilesRegex: "^.*\\.(log)$"
|
||||||
|
failFast: true
|
||||||
|
forceQuietModeTimeout: 120
|
||||||
|
fullBackupSchedule: "0 12 * * 1"
|
||||||
|
moveOldBackupsToZipFile: false
|
||||||
|
nrMaxStoredFull: -1
|
||||||
|
waitForIdle: true
|
||||||
|
```
|
||||||
|
|
@ -315,6 +315,11 @@
|
||||||
<version>2.0.3</version>
|
<version>2.0.3</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jvnet.hudson.plugins</groupId>
|
||||||
|
<artifactId>thinBackup</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
package io.jenkins.plugins.casc;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertFalse;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
|
import io.jenkins.plugins.casc.misc.ConfiguredWithReadme;
|
||||||
|
import io.jenkins.plugins.casc.misc.JenkinsConfiguredWithReadmeRule;
|
||||||
|
import org.junit.Rule;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.jvnet.hudson.plugins.thinbackup.ThinBackupPluginImpl;
|
||||||
|
|
||||||
|
public class ThinBackupTest {
|
||||||
|
|
||||||
|
@Rule
|
||||||
|
public JenkinsConfiguredWithReadmeRule j = new JenkinsConfiguredWithReadmeRule();
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@ConfiguredWithReadme("thin-backup/README.md")
|
||||||
|
public void configure_thinbackup() {
|
||||||
|
ThinBackupPluginImpl thinBackupPluginConfig = ThinBackupPluginImpl.get();
|
||||||
|
final String backupPath = thinBackupPluginConfig.getBackupPath();
|
||||||
|
// test strings
|
||||||
|
assertEquals("c:\\temp\\thin-backup", backupPath);
|
||||||
|
assertEquals("0 12 * * 1-5", thinBackupPluginConfig.getDiffBackupSchedule());
|
||||||
|
assertEquals("0 12 * * 1", thinBackupPluginConfig.getFullBackupSchedule());
|
||||||
|
assertEquals("^.*\\.(log)$", thinBackupPluginConfig.getExcludedFilesRegex());
|
||||||
|
assertEquals("^.*\\.(txt)$", thinBackupPluginConfig.getBackupAdditionalFilesRegex());
|
||||||
|
// test numbers
|
||||||
|
assertEquals(120, thinBackupPluginConfig.getForceQuietModeTimeout());
|
||||||
|
assertEquals(-1, thinBackupPluginConfig.getNrMaxStoredFull());
|
||||||
|
// test booleans
|
||||||
|
assertTrue(thinBackupPluginConfig.isWaitForIdle());
|
||||||
|
assertTrue(thinBackupPluginConfig.isBackupBuildResults());
|
||||||
|
assertTrue(thinBackupPluginConfig.isFailFast());
|
||||||
|
|
||||||
|
assertFalse(thinBackupPluginConfig.isCleanupDiff());
|
||||||
|
assertFalse(thinBackupPluginConfig.isMoveOldBackupsToZipFile());
|
||||||
|
assertFalse(thinBackupPluginConfig.isBackupBuildArchive());
|
||||||
|
assertFalse(thinBackupPluginConfig.isBackupPluginArchives());
|
||||||
|
assertFalse(thinBackupPluginConfig.isBackupUserContents());
|
||||||
|
assertFalse(thinBackupPluginConfig.isBackupConfigHistory());
|
||||||
|
assertFalse(thinBackupPluginConfig.isBackupAdditionalFiles());
|
||||||
|
assertFalse(thinBackupPluginConfig.isBackupNextBuildNumber());
|
||||||
|
assertFalse(thinBackupPluginConfig.isBackupBuildsToKeepOnly());
|
||||||
|
}
|
||||||
|
}
|
||||||
2
pom.xml
2
pom.xml
|
|
@ -4,7 +4,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.jenkins-ci.plugins</groupId>
|
<groupId>org.jenkins-ci.plugins</groupId>
|
||||||
<artifactId>plugin</artifactId>
|
<artifactId>plugin</artifactId>
|
||||||
<version>5.24</version>
|
<version>5.26</version>
|
||||||
<relativePath />
|
<relativePath />
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue