Skip to content

Use current build to find SCM values #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 9 additions & 48 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,19 @@
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<!-- Baseline Jenkins version you use to build and test the plugin. Users must have this version or newer to run. -->
<version>1.609.1</version>
<version>3.54</version>
<relativePath />
</parent>

<artifactId>bitbucket-build-status-notifier</artifactId>
<version>1.4.3-SNAPSHOT</version>
<packaging>hpi</packaging>

<properties>
<maven-release-plugin.version>2.5.1</maven-release-plugin.version>
<maven-hpi-plugin.version>1.112</maven-hpi-plugin.version>
<maven-deploy-plugin.version>2.6</maven-deploy-plugin.version>
<!-- Baseline Jenkins version you use to build the plugin. Users must have this version or newer to run. -->
<jenkins.version>2.176.2</jenkins.version>
<!-- Java Level to use. Java 7 required when using core >= 1.612 -->
<java.level>8</java.level>
<wagon-http.version>2.10</wagon-http.version>
<workflow.version>1.11</workflow.version>
</properties>
Expand Down Expand Up @@ -88,17 +89,17 @@
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-step-api</artifactId>
<version>${workflow.version}</version>
<version>2.22</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-cps</artifactId>
<version>${workflow.version}</version>
<version>2.80</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-job</artifactId>
<version>${workflow.version}</version>
<version>2.36</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
Expand Down Expand Up @@ -153,46 +154,6 @@
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.jenkins-ci.tools</groupId>
<artifactId>maven-hpi-plugin</artifactId>
<version>${maven-hpi-plugin.version}</version>
<extensions>true</extensions>
<executions>
<execution>
<goals>
<goal>generate-taglib-interface</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>${maven-release-plugin.version}</version>
<configuration>
<goals>deploy</goals>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>${maven-deploy-plugin.version}</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-http</artifactId>
<version>${wagon-http.version}</version>
<type>jar</type>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>

<distributionManagement>
<repository>
<id>repo.jenkins-ci.org</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
import org.jenkinsci.plugins.bitbucket.validator.BitbucketHostValidator;
import org.jenkinsci.plugins.displayurlapi.DisplayURLProvider;
import org.jenkinsci.plugins.multiplescms.MultiSCM;
import org.jenkinsci.plugins.workflow.job.WorkflowJob;
import org.jenkinsci.plugins.workflow.job.WorkflowRun;
import org.scribe.model.*;

class BitbucketBuildStatusHelper {
Expand Down Expand Up @@ -138,10 +138,9 @@ public static List<BitbucketBuildStatusResource> createBuildStatusResources(fina
Job<?, ?> project = build.getParent();
List<BitbucketBuildStatusResource> buildStatusResources = new ArrayList<BitbucketBuildStatusResource>();

if (project instanceof WorkflowJob) {
Collection<? extends SCM> scms = ((WorkflowJob)project).getSCMs();

for (SCM scm : scms) {
if (build instanceof WorkflowRun) {
WorkflowRun workflowRun = (WorkflowRun)build;
for (SCM scm : workflowRun.getSCMs()) {
buildStatusResources.addAll(createBuildStatusResources(scm, build));
}
} else if (project instanceof AbstractProject) {
Expand Down