|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
|
|
|
<modelVersion>4.0.0</modelVersion>
|
|
|
|
|
|
|
|
<groupId>com.englishtown</groupId>
|
|
|
|
<artifactId>stash-hook-mirror</artifactId>
|
|
|
|
<version>3.1.0-SNAPSHOT</version>
|
|
|
|
|
|
|
|
<organization>
|
|
|
|
<name>EF Learning Labs</name>
|
|
|
|
<url>https://www.ef.com</url>
|
|
|
|
</organization>
|
|
|
|
|
|
|
|
<name>Repository Mirror Plugin for Bitbucket Server</name>
|
|
|
|
<description>A Bitbucket Server repository hook for mirroring to one or more remote repositories.</description>
|
|
|
|
<url>https://github.com/ef-labs/stash-hook-mirror</url>
|
|
|
|
<inceptionYear>2013</inceptionYear>
|
|
|
|
<licenses>
|
|
|
|
<license>
|
|
|
|
<name>The MIT License</name>
|
|
|
|
<url>https://ef-labs.mit-license.org</url>
|
|
|
|
</license>
|
|
|
|
</licenses>
|
|
|
|
<packaging>atlassian-plugin</packaging>
|
|
|
|
|
|
|
|
<properties>
|
|
|
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
|
|
|
|
|
|
<maven.compiler.source>1.8</maven.compiler.source>
|
|
|
|
<maven.compiler.target>1.8</maven.compiler.target>
|
|
|
|
|
|
|
|
<bitbucket.version>5.5.0</bitbucket.version>
|
Replace ExecutorService with BucketedExecutor.
Using the ScheduledExecutorService is better than performing the pushes
directly in the hook method, but it still has limitations:
- Busy repositories can result in parallel pushes to the mirror (#23)
- The ScheduledExecutorService being used is a shared resources, which
can result in other callers being starved out
A better approach is to use the BucketedExecutor. It offers several
improvements that are tailor-made for the work being done here:
- Buckets can be used to control what can be done in parallel
- Tasks with the same key are grouped, and at most a single node in
a Data Center cluster can run them
- Tasks with different keys can be run in parallel
- Work can be shared among cluster nodes, in Data Center installations
- Tasks can be scheduled from one cluster node and run on another
- Locking is inherent in the BucketedExecutor's design, which means
the hook doesn't need to do any locking of its own
- This means there aren't any blocked threads.
This fixes issue #23 by ensuring at most a single push happens to any
given mirror, and by allowing the overall concurrency, even in Data
Center installations, to be controlled. (#34)
While I was making changes, because the minimum supported version for
the plugin is already Bitbucket Server 5.5, I switched the code over
to the new PostRepositoryHook SPI. This _could_ be extended to allow
the hook to respond to a wider array of events, so mirroring would be
triggered after pull request merges, branch or tag creation, etc.
However, for the sake of consistency, the current code still only
triggers pushes after other pushes. (Related to #45)
Other things:
- Added the ability to configure a timeout (#39)
- Added the ability to configure the number of retries, and the number
of BucketedExecutor threads _per cluster node_
- Added the ability to pass -Dbitbucket.test.version=5.11.1 (or any
other version) to test against a version of Bitbucket Server other
than the one being compiled against
- Marked the plugin Data Center-compatible
- Simplified wiring for DefaultPasswordEncryptor and removed the init
method from the PasswordEncryptor interface
7 years ago
|
|
|
<bitbucket.test.version>${bitbucket.version}</bitbucket.test.version>
|
|
|
|
<amps.version>6.3.17</amps.version>
|
|
|
|
</properties>
|
|
|
|
|
|
|
|
<dependencyManagement>
|
|
|
|
<dependencies>
|
|
|
|
<dependency>
|
|
|
|
<groupId>com.atlassian.bitbucket.server</groupId>
|
|
|
|
<artifactId>bitbucket-parent</artifactId>
|
|
|
|
<version>${bitbucket.version}</version>
|
|
|
|
<type>pom</type>
|
|
|
|
<scope>import</scope>
|
|
|
|
</dependency>
|
|
|
|
</dependencies>
|
|
|
|
</dependencyManagement>
|
|
|
|
|
|
|
|
<dependencies>
|
|
|
|
<dependency>
|
|
|
|
<groupId>com.atlassian.bitbucket.server</groupId>
|
|
|
|
<artifactId>bitbucket-api</artifactId>
|
|
|
|
<scope>provided</scope>
|
|
|
|
</dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>com.atlassian.bitbucket.server</groupId>
|
|
|
|
<artifactId>bitbucket-spi</artifactId>
|
|
|
|
<scope>provided</scope>
|
|
|
|
</dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>com.atlassian.bitbucket.server</groupId>
|
|
|
|
<artifactId>bitbucket-git-api</artifactId>
|
|
|
|
<scope>provided</scope>
|
|
|
|
</dependency>
|
Replace ExecutorService with BucketedExecutor.
Using the ScheduledExecutorService is better than performing the pushes
directly in the hook method, but it still has limitations:
- Busy repositories can result in parallel pushes to the mirror (#23)
- The ScheduledExecutorService being used is a shared resources, which
can result in other callers being starved out
A better approach is to use the BucketedExecutor. It offers several
improvements that are tailor-made for the work being done here:
- Buckets can be used to control what can be done in parallel
- Tasks with the same key are grouped, and at most a single node in
a Data Center cluster can run them
- Tasks with different keys can be run in parallel
- Work can be shared among cluster nodes, in Data Center installations
- Tasks can be scheduled from one cluster node and run on another
- Locking is inherent in the BucketedExecutor's design, which means
the hook doesn't need to do any locking of its own
- This means there aren't any blocked threads.
This fixes issue #23 by ensuring at most a single push happens to any
given mirror, and by allowing the overall concurrency, even in Data
Center installations, to be controlled. (#34)
While I was making changes, because the minimum supported version for
the plugin is already Bitbucket Server 5.5, I switched the code over
to the new PostRepositoryHook SPI. This _could_ be extended to allow
the hook to respond to a wider array of events, so mirroring would be
triggered after pull request merges, branch or tag creation, etc.
However, for the sake of consistency, the current code still only
triggers pushes after other pushes. (Related to #45)
Other things:
- Added the ability to configure a timeout (#39)
- Added the ability to configure the number of retries, and the number
of BucketedExecutor threads _per cluster node_
- Added the ability to pass -Dbitbucket.test.version=5.11.1 (or any
other version) to test against a version of Bitbucket Server other
than the one being compiled against
- Marked the plugin Data Center-compatible
- Simplified wiring for DefaultPasswordEncryptor and removed the init
method from the PasswordEncryptor interface
7 years ago
|
|
|
<dependency>
|
|
|
|
<groupId>com.atlassian.bitbucket.server</groupId>
|
|
|
|
<artifactId>bitbucket-git-common</artifactId>
|
|
|
|
<scope>provided</scope>
|
|
|
|
</dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>com.atlassian.sal</groupId>
|
|
|
|
<artifactId>sal-api</artifactId>
|
|
|
|
<scope>provided</scope>
|
|
|
|
</dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>com.atlassian.bitbucket.server</groupId>
|
|
|
|
<artifactId>bitbucket-web-common</artifactId>
|
|
|
|
<scope>provided</scope>
|
|
|
|
</dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>com.atlassian.soy</groupId>
|
|
|
|
<artifactId>soy-template-renderer-api</artifactId>
|
|
|
|
<version>4.1.3</version>
|
|
|
|
<scope>provided</scope>
|
|
|
|
</dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>com.atlassian.utils</groupId>
|
|
|
|
<artifactId>atlassian-processutils</artifactId>
|
|
|
|
<version>1.8.3</version>
|
|
|
|
<scope>provided</scope>
|
|
|
|
</dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>com.sun.jersey</groupId>
|
|
|
|
<artifactId>jersey-client</artifactId>
|
|
|
|
<version>1.8</version>
|
|
|
|
<scope>compile</scope>
|
|
|
|
</dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.codehaus.jackson</groupId>
|
|
|
|
<artifactId>jackson-mapper-asl</artifactId>
|
|
|
|
<version>1.9.13-atlassian-2</version>
|
|
|
|
<scope>provided</scope>
|
|
|
|
</dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>javax.servlet</groupId>
|
|
|
|
<artifactId>javax.servlet-api</artifactId>
|
|
|
|
<version>3.0.1</version>
|
|
|
|
<scope>provided</scope>
|
|
|
|
</dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>com.atlassian.soy</groupId>
|
|
|
|
<artifactId>atlassian-soy-spring-mvc-support</artifactId>
|
|
|
|
<version>5.0.0</version>
|
|
|
|
<scope>provided</scope>
|
|
|
|
</dependency>
|
Replace ExecutorService with BucketedExecutor.
Using the ScheduledExecutorService is better than performing the pushes
directly in the hook method, but it still has limitations:
- Busy repositories can result in parallel pushes to the mirror (#23)
- The ScheduledExecutorService being used is a shared resources, which
can result in other callers being starved out
A better approach is to use the BucketedExecutor. It offers several
improvements that are tailor-made for the work being done here:
- Buckets can be used to control what can be done in parallel
- Tasks with the same key are grouped, and at most a single node in
a Data Center cluster can run them
- Tasks with different keys can be run in parallel
- Work can be shared among cluster nodes, in Data Center installations
- Tasks can be scheduled from one cluster node and run on another
- Locking is inherent in the BucketedExecutor's design, which means
the hook doesn't need to do any locking of its own
- This means there aren't any blocked threads.
This fixes issue #23 by ensuring at most a single push happens to any
given mirror, and by allowing the overall concurrency, even in Data
Center installations, to be controlled. (#34)
While I was making changes, because the minimum supported version for
the plugin is already Bitbucket Server 5.5, I switched the code over
to the new PostRepositoryHook SPI. This _could_ be extended to allow
the hook to respond to a wider array of events, so mirroring would be
triggered after pull request merges, branch or tag creation, etc.
However, for the sake of consistency, the current code still only
triggers pushes after other pushes. (Related to #45)
Other things:
- Added the ability to configure a timeout (#39)
- Added the ability to configure the number of retries, and the number
of BucketedExecutor threads _per cluster node_
- Added the ability to pass -Dbitbucket.test.version=5.11.1 (or any
other version) to test against a version of Bitbucket Server other
than the one being compiled against
- Marked the plugin Data Center-compatible
- Simplified wiring for DefaultPasswordEncryptor and removed the init
method from the PasswordEncryptor interface
7 years ago
|
|
|
<dependency>
|
|
|
|
<groupId>com.atlassian.bitbucket.server</groupId>
|
|
|
|
<artifactId>bitbucket-test-util</artifactId>
|
|
|
|
<scope>test</scope>
|
|
|
|
</dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>junit</groupId>
|
|
|
|
<artifactId>junit</artifactId>
|
|
|
|
<scope>test</scope>
|
|
|
|
</dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.mockito</groupId>
|
|
|
|
<artifactId>mockito-core</artifactId>
|
|
|
|
<scope>test</scope>
|
|
|
|
</dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>com.github.tomakehurst</groupId>
|
|
|
|
<artifactId>wiremock-standalone</artifactId>
|
|
|
|
<version>2.25.1</version>
|
|
|
|
<scope>test</scope>
|
|
|
|
</dependency>
|
|
|
|
</dependencies>
|
|
|
|
|
|
|
|
<build>
|
|
|
|
<plugins>
|
|
|
|
<plugin>
|
|
|
|
<groupId>com.atlassian.maven.plugins</groupId>
|
|
|
|
<artifactId>bitbucket-maven-plugin</artifactId>
|
|
|
|
<version>${amps.version}</version>
|
|
|
|
<extensions>true</extensions>
|
|
|
|
<configuration>
|
|
|
|
<products>
|
|
|
|
<product>
|
|
|
|
<id>bitbucket</id>
|
|
|
|
<instanceId>bitbucket</instanceId>
|
Replace ExecutorService with BucketedExecutor.
Using the ScheduledExecutorService is better than performing the pushes
directly in the hook method, but it still has limitations:
- Busy repositories can result in parallel pushes to the mirror (#23)
- The ScheduledExecutorService being used is a shared resources, which
can result in other callers being starved out
A better approach is to use the BucketedExecutor. It offers several
improvements that are tailor-made for the work being done here:
- Buckets can be used to control what can be done in parallel
- Tasks with the same key are grouped, and at most a single node in
a Data Center cluster can run them
- Tasks with different keys can be run in parallel
- Work can be shared among cluster nodes, in Data Center installations
- Tasks can be scheduled from one cluster node and run on another
- Locking is inherent in the BucketedExecutor's design, which means
the hook doesn't need to do any locking of its own
- This means there aren't any blocked threads.
This fixes issue #23 by ensuring at most a single push happens to any
given mirror, and by allowing the overall concurrency, even in Data
Center installations, to be controlled. (#34)
While I was making changes, because the minimum supported version for
the plugin is already Bitbucket Server 5.5, I switched the code over
to the new PostRepositoryHook SPI. This _could_ be extended to allow
the hook to respond to a wider array of events, so mirroring would be
triggered after pull request merges, branch or tag creation, etc.
However, for the sake of consistency, the current code still only
triggers pushes after other pushes. (Related to #45)
Other things:
- Added the ability to configure a timeout (#39)
- Added the ability to configure the number of retries, and the number
of BucketedExecutor threads _per cluster node_
- Added the ability to pass -Dbitbucket.test.version=5.11.1 (or any
other version) to test against a version of Bitbucket Server other
than the one being compiled against
- Marked the plugin Data Center-compatible
- Simplified wiring for DefaultPasswordEncryptor and removed the init
method from the PasswordEncryptor interface
7 years ago
|
|
|
<version>${bitbucket.test.version}</version>
|
|
|
|
<dataVersion>${bitbucket.test.version}</dataVersion>
|
|
|
|
</product>
|
|
|
|
</products>
|
|
|
|
</configuration>
|
|
|
|
</plugin>
|
|
|
|
</plugins>
|
|
|
|
</build>
|
|
|
|
|
|
|
|
<repositories>
|
|
|
|
<repository>
|
|
|
|
<id>atlassian-public</id>
|
|
|
|
<url>https://maven.atlassian.com/content/groups/public</url>
|
|
|
|
<releases>
|
|
|
|
<enabled>true</enabled>
|
|
|
|
<checksumPolicy>warn</checksumPolicy>
|
|
|
|
</releases>
|
|
|
|
</repository>
|
|
|
|
</repositories>
|
|
|
|
|
|
|
|
<pluginRepositories>
|
|
|
|
<pluginRepository>
|
|
|
|
<id>atlassian-public</id>
|
|
|
|
<url>https://maven.atlassian.com/content/groups/public</url>
|
|
|
|
<releases>
|
|
|
|
<enabled>true</enabled>
|
|
|
|
<checksumPolicy>warn</checksumPolicy>
|
|
|
|
</releases>
|
|
|
|
</pluginRepository>
|
|
|
|
</pluginRepositories>
|
|
|
|
|
|
|
|
<scm>
|
|
|
|
<connection>scm:git:git@github.com:ef-labs/stash-hook-mirror.git</connection>
|
|
|
|
<developerConnection>scm:git:git@github.com:ef-labs/stash-hook-mirror.git</developerConnection>
|
|
|
|
<url>https://github.com/ef-labs/stash-hook-mirror</url>
|
|
|
|
<tag>HEAD</tag>
|
|
|
|
</scm>
|
|
|
|
|
|
|
|
<distributionManagement>
|
|
|
|
<snapshotRepository>
|
|
|
|
<id>etown-nexus-snapshots</id>
|
|
|
|
<url>https://nexus-bos.englishtown.com/content/repositories/snapshots</url>
|
|
|
|
</snapshotRepository>
|
|
|
|
<repository>
|
|
|
|
<id>etown-nexus-releases</id>
|
|
|
|
<url>https://nexus-bos.englishtown.com/content/repositories/releases</url>
|
|
|
|
</repository>
|
|
|
|
</distributionManagement>
|
|
|
|
|
|
|
|
<issueManagement>
|
|
|
|
<system>Github Issues</system>
|
|
|
|
<url>https://github.com/ef-labs/stash-hook-mirror/issues</url>
|
|
|
|
</issueManagement>
|
|
|
|
|
|
|
|
</project>
|