diff --git a/.gitignore b/.gitignore index fbd2fffe..7c93a963 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ /target -/.settings -/.classpath -/.project +/.settings +/.classpath +/.project /work *~ +/.idea/ diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 00000000..26d33521 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 00000000..ed8ee1ab --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 00000000..aa00ffab --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 00000000..f91ffff7 --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..24399c46 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,12 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml new file mode 100644 index 00000000..797acea5 --- /dev/null +++ b/.idea/runConfigurations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..35eb1ddf --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index cd8128d2..8f8cc32b 100644 --- a/pom.xml +++ b/pom.xml @@ -1,10 +1,11 @@ + 4.0.0 - org.jenkins-ci.plugins - plugin - 3.43 - + org.jenkins-ci.plugins + plugin + 3.43 + org.jvnet.hudson.plugins thinBackup @@ -17,27 +18,27 @@ GPLv3 repo - Copyright (C) 2011 Matthias Steinkogler, Thomas Fürer + Copyright (C) 2011 Matthias Steinkogler, Thomas Fürer - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see http://www.gnu.org/licenses. + You should have received a copy of the GNU General Public License + along with this program. If not, see http://www.gnu.org/licenses. - Backs up the most important global and job specific configuration files. + Backs up the most important global and job specific configuration files. https://github.com/jenkinsci/thin-backup-plugin @@ -106,13 +107,18 @@ 3.3.0 test + + org.jenkins-ci.plugins.pipeline-stage-view + pipeline-rest-api + 2.10 + UTF-8 1.651.3 8 - + @@ -165,4 +171,4 @@ - + \ No newline at end of file diff --git a/src/main/java/org/jvnet/hudson/plugins/thinbackup/ThinBackupMgmtLink.java b/src/main/java/org/jvnet/hudson/plugins/thinbackup/ThinBackupMgmtLink.java index 433f45eb..523ba6ba 100644 --- a/src/main/java/org/jvnet/hudson/plugins/thinbackup/ThinBackupMgmtLink.java +++ b/src/main/java/org/jvnet/hudson/plugins/thinbackup/ThinBackupMgmtLink.java @@ -16,6 +16,18 @@ */ package org.jvnet.hudson.plugins.thinbackup; +import com.cloudbees.workflow.util.ServeJson; +import hudson.Extension; +import hudson.model.ManagementLink; +import hudson.model.TaskListener; +import jenkins.model.Jenkins; +import jenkins.util.Timer; +import org.jvnet.hudson.plugins.thinbackup.restore.HudsonRestore; +import org.jvnet.hudson.plugins.thinbackup.utils.Utils; +import org.kohsuke.stapler.QueryParameter; +import org.kohsuke.stapler.StaplerRequest; +import org.kohsuke.stapler.StaplerResponse; + import java.io.File; import java.io.IOException; import java.text.ParseException; @@ -25,18 +37,6 @@ import java.util.concurrent.TimeUnit; import java.util.logging.Logger; -import org.jvnet.hudson.plugins.thinbackup.restore.HudsonRestore; -import org.jvnet.hudson.plugins.thinbackup.utils.Utils; -import org.kohsuke.stapler.QueryParameter; -import org.kohsuke.stapler.StaplerRequest; -import org.kohsuke.stapler.StaplerResponse; - -import hudson.Extension; -import hudson.model.ManagementLink; -import hudson.model.TaskListener; -import jenkins.model.Jenkins; -import jenkins.util.Timer; - /** * A backup solution for Hudson. Backs up configuration files from Hudson and its jobs. * @@ -174,9 +174,14 @@ public ThinBackupPluginImpl getConfiguration() { return ThinBackupPluginImpl.getInstance(); } + @ServeJson public List getAvailableBackups() { final ThinBackupPluginImpl plugin = ThinBackupPluginImpl.getInstance(); return Utils.getBackupsAsDates(new File(plugin.getExpandedBackupPath())); } + @ServeJson + public List doAvailableBackups(){ + return getAvailableBackups(); + } }