Skip to content

Commit

Permalink
Merge pull request #3 from res0nance/JENKINS-64312
Browse files Browse the repository at this point in the history
[JENKINS-64312] Table to div compatibility + Update the minimum Jenkins core requirement to 2.204.6 + Update Parent POM to a recent version + Migrate docs to github
  • Loading branch information
oleg-nenashev committed Mar 11, 2021
2 parents f60f3b6 + f6f8e91 commit a6f6d9c
Show file tree
Hide file tree
Showing 10 changed files with 262 additions and 23 deletions.
154 changes: 152 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,161 @@ There are 3 options:
2. Clone the sources and update the Config.java with your personal client id and client secret.
3. Run the "mvn hpi:hpi" on the project source code
4. Install the generated publish-over-dropbox.hpi on the advanced section of the plugin manager of your Jenkins installation.

# News

### Pipeline support

Version 1.2.0 of the Dropbox plugin is out. It is now possible to use
the new Jenkins pipeline DSL to configure the Publish over Dropbox
plugin.

More info on: [Build pipelines](https://jenkins.io/doc/book/pipeline/)

### EOL version 1.0.0 - 1.0.5

The versions of the plugin before 1.1 use the Dropbox V1 API. These are
[deprecated by
Dropbox](https://blogs.dropbox.com/developers/2016/06/api-v1-deprecated/)
will stop working from June 28, 2017.

- Update your plugin to at least 1.1.2

### Deprecated 1.0.0 - 1.0.5 OAuth API token

The versions before 1.1 use a API token coupled to a business account.
That account might not exist in the future, which can block all derived
Tokens. Uploads will fail after that.

1. Update your plugin to at least 1.1.2
2. Generate a new Token. You can by retaking the first configuration
step: Link an account. (as described below)

# Configuration

Plugin documentation is hosted as a page on the Jenkins page:
### Link an account

The highest level is connecting a Dropbox account to Jenkins. Dropbox
account connections can be created in the \***Jenkins \>
Credentials**\*.

![](resources/documentation/01-credentials.png)

### Create a location

The second level is to create a location for a previously linked
account. Locations can be created in \***Jenkins \> Manage Jenkins \>
Configure System**\*.

![](resources/documentation/02-location.png)

### Publish files - classic style

The last level is to actual publish files to a Dropbox location.
Publishing can be done as \***Post-build Actions**\* in your build job
configuration.

![](resources/documentation/03-postbuild.png)

### Publish files - pipeline style

The last level is to actual publish files to a Dropbox location. Since
version 1.2.0 publishing can be configured with **Pipeline DSL** in your
build job configuration.

Using the Snippet Generator you can create code for the DSL publishing.
A simple step only provides the required parameters: `configName`,
`sourceFiles` and `remoteDirectory`,

![](resources/documentation/simple_example.png)

All the options available in the classic mode are also available in the
DSL syntax.

![](resources/documentation/complex_example.png)

A description of all the parameters are:

#### sourceFiles (required)

Files to upload to the Dropbox location.

The string is a comma separated list of includes for an Ant fileset eg.
'\*\*/\*.zip' (see
[patterns](http://ant.apache.org/manual/dirtasks.html#patterns) in the
Ant manual). The base directory for this fileset is the workspace.

#### configName (required)

Select an Dropbox location from the list configured in the global
configuration of this Jenkins. The configuration defines the account
properties and base directory of the Dropbox location.

#### remoteDirectory (required)

Destination folder.

This folder will be below the one in the global configuration. The
folder will be created if does not exist.

#### flatten (optional)

Only create files on the server, do not create directories (except for
the remote directory).

All files that have been selected to transfer must have unique
filenames. Publishing will stop and fail as soon as a duplicate filename
is found when using the flatten option.

#### remoteDirectorySDF (optional)

Select this to include the timestamp in the remote directory.

The timestamp is the date of build. This setting turns the remote
directory option into a java SimpleDateFormat. The SimpleDateFormat(SDF)
uses letters to represent components of the date, like the month, year,
or day of the week.
The [SimpleDateFormat](http://download.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html)
page has more information about the date patterns. As the SDF reserves
all of the letters \[A-Z\]\[a-z\], any that you want to appear literally
in the directory that is created will need to be quoted.

#### cleanRemote (optional)

Select to delete all files and directories within the remote directory
before transferring files.

#### pruneRoot (optional)

Directories older then the max days will be deleted.

A date format directory format can lead to a long list of directories.
Removing old directories in the remote root will allow you to prune that
list.

#### pruneDays (required only with pruneRoot enabled)

Directory created more then this number of days ago are considered old
for pruning of root.

#### removePrefix (optional)

First part of the file path that should not be created on the remote
server.

Directory structures are created relative to the base directory, which
is usually the workspace.You normally do not want the full path to these
files to be created on the server. For example if Source files were
`target/deployment/images/**/` then you may want Remove prefix to be
`target/deployment` This would create the images folder under the remote
directory, and not target/deployment

If you use remove prefix, then ALL source file paths MUST start with the
prefix.

# Changelog

https://wiki.jenkins.io/display/JENKINS/Publish+over+Dropbox+Plugin
Link to changelog [here](resources/documentation/changelog.md)

# Credits

Expand Down
29 changes: 17 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,16 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>3.2</version>
<version>4.13</version>
<relativePath />
</parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>publish-over-dropbox</artifactId>
<version>1.2.6-SNAPSHOT</version>
<packaging>hpi</packaging>

<name>Publish Over Dropbox</name>
<description>Send build artifacts to Dropbox account</description>
<url>https://wiki.jenkins.io/display/JENKINS/Publish+over+Dropbox+Plugin</url>
<url>https://github.com/jenkinsci/publish-over-dropbox-plugin</url>
<licenses>
<license>
<name>MIT License</name>
Expand All @@ -44,8 +43,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
</developers>

<properties>
<jenkins.version>2.98</jenkins.version>
<java.level>7</java.level>
<jenkins.version>2.204.6</jenkins.version>
<java.level>8</java.level>
</properties>

<!-- Assuming you want to host on @jenkinsci: -->
Expand All @@ -61,10 +60,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
<id>repo.jenkins-ci.org</id>
<url>https://repo.jenkins-ci.org/public/</url>
</repository>
<repository>
<id>uk.maven.org</id>
<url>http://uk.maven.org/maven2</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
Expand All @@ -77,12 +72,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>publish-over</artifactId>
<version>0.21</version>
<version>0.22</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>credentials</artifactId>
<version>1.21</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
Expand All @@ -92,8 +86,19 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-step-api</artifactId>
<version>1.14</version>
</dependency>
</dependencies>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.204.x</artifactId>
<version>18</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>

</project>
68 changes: 68 additions & 0 deletions resources/documentation/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Changelog

### 1.2.4 (June 2018)

- Fix proxy config related crash on remote instances
Fixes [JENKINS-52039](https://issues.jenkins-ci.org/browse/JENKINS-52039)
- Upgraded minimal required Jenkins version to 2.98

### 1.2.3 (June 2018)

- Supports using the Jenkins proxy configuration
Fixes [JENKINS-51478](https://issues.jenkins-ci.org/browse/JENKINS-51478)

### 1.2.2 (Januari 2018)

- The underlying "Publish Over" library has been updated in 0.21
Fixes [JENKINS-48926](https://issues.jenkins-ci.org/browse/JENKINS-48926)

### 1.2.1 (September 2017)

- Fix not overwritting large files
Fixes [JENKINS-46533](https://issues.jenkins-ci.org/browse/JENKINS-46533?src=confmacro)
- Add field description to the step Snippet Generator

### 1.2.0 (July 2017)

- Add build pipeline DSL support
Fixes JENKINS-43230
- Fixed an encoding issue with directory creation
Fixes JENKINS-45309
- Autorename attribute typo fixed
Fixes [JENKINS-40196](https://github.com/jenkinsci/publish-over-dropbox-plugin/commit/1cffda729f60f82cd52e1e60443b1b1f00580f73 "Request field typo, fixes JENKINS-40196")
- Improved some error messages

### 1.1.2 (Dec 2016)

- Fix malformed chunk upload request
Fixes [JENKINS-40196](https://issues.jenkins-ci.org/browse/JENKINS-40196)

### 1.1.1 (Nov 2016)

- Large uploads are chunked in uploads of 4 MB each
Fixes [JENKINS-39093](https://issues.jenkins-ci.org/browse/JENKINS-39093)
- The plugin uses Dropbox V2 API
Fixes [JENKINS-36407](https://issues.jenkins-ci.org/browse/JENKINS-36407)
- Switch to a more future-proof Dropbox Client ID
- Update parent plugin to version 2.6
Addresses [INFRA-588](https://issues.jenkins-ci.org/browse/INFRA-588)

### 1.0.5 (Nov 8 2015)

- Fixes [JENKINS-31112](https://issues.jenkins-ci.org/browse/JENKINS-31112)

### 1.0.3 (Sep 21 2015)

First function release

### 1.0.2 (Sep 21 2015)

Failed non-functioning release

### 1.0.1 (Sep 20 2015)

Failed non-functioning release

### 1.0.0 (Sep 19 2015)

Failed non-functioning release
Binary file added resources/documentation/complex_example.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/documentation/simple_example.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions src/main/resources/lib/publishoverdropbox/blockWrapper.jelly
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:d="jelly:define">
<!-- TODO remove and switch to div after baseline is 2.264 or newer -->
<j:choose>
<j:when test="${divBasedFormLayout}">
<div>
<d:invokeBody/>
</div>
</j:when>
<j:otherwise>
<table style="width:100%">
<d:invokeBody/>
</table>
</j:otherwise>
</j:choose>
</j:jelly>
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
~ THE SOFTWARE.
-->

<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:f="/lib/form" xmlns:poj="/pojelly">
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:f="/lib/form" xmlns:poj="/pojelly" xmlns:pod="/lib/publishoverdropbox">

<poj:defaultMessages/>
<br/>
Expand Down Expand Up @@ -69,14 +69,14 @@
<j:set var="descriptor" value="${descriptor.transferDescriptor}"/>
<f:repeatable items="${instance.transfers}" var="instance" name="transfers" minimum="1"
header="${m.transfers_dragAndDropLabel()}" add="${m.addTransfer()}">
<table width="100%" padding="0">
<pod:blockWrapper>
<st:include page="config.jelly" class="${descriptor.clazz}"/>
<f:entry title="">
<div align="right" class="show-if-not-only">
<f:repeatableDeleteButton value="${m.deleteTransfer()}"/>
</div>
</f:entry>
</table>
</pod:blockWrapper>
</f:repeatable>
</j:scope>
</f:entry>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
~ THE SOFTWARE.
-->

<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:f="/lib/form" xmlns:poj="/pojelly">
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:f="/lib/form" xmlns:poj="/pojelly" xmlns:pod="/lib/publishoverdropbox">

<j:set var="defaults" value="${descriptor.defaults}"/>

Expand All @@ -36,14 +36,14 @@
<j:set var="descriptor" value="${descriptor.publisherDescriptor}"/>
<f:repeatable items="${instance.publishers}" var="instance" name="publishers" minimum="1"
header="${%publisher.dragAndDropLabel}" add="${%publisher.addDropboxAccount}">
<table width="100%" padding="0">
<pod:blockWrapper>
<st:include page="config.jelly" class="${descriptor.clazz}"/>
<f:entry title="">
<div align="right" class="show-if-not-only">
<f:repeatableDeleteButton value="${%publisher.deletePublisher}"/>
</div>
</f:entry>
</table>
</pod:blockWrapper>
</f:repeatable>
</j:scope>

Expand Down

0 comments on commit a6f6d9c

Please sign in to comment.