Commits

Martijn Verburg committed c81fcfc Merge

Merged in mwl/betterrev/improvement/43-multiple-projects (pull request #59)

Collect pull requests from multiple projects

Comments (0)

Files changed (3)

betterrev/app/update/bitbucket/BitbucketPoller.java

 
             Configuration configuration = Play.application().configuration();
             String owner = configuration.getString("owner");
-            String project = configuration.getString("project");
-            Logger.info(String.format("Polling bitbucket with owner '%s' and project '%s'", owner, project));
+            for (String projectToken : configuration.getString("projects").split(" ")) {
+                String project = projectToken.trim();
+                Logger.info(String.format("Polling bitbucket with owner '%s' and project '%s'", owner, project));
 
-            Response response = WS.url(String.format(API_URL, owner, project)).get().get();
-            if ((response.getStatus() != Http.Status.OK) || response.asJson() == null) {
-                Logger.error("Bitbucket did not return a valid response on the current execution of run()...");
-            } else {
-                eventStream().publish(new ImportPullRequestsEvent(response.asJson(), project));
+                Response response = WS.url(String.format(API_URL, owner, project)).get().get();
+                if ((response.getStatus() != Http.Status.OK) || response.asJson() == null) {
+                    Logger.error("Bitbucket did not return a valid response on the current execution of run()...");
+                } else {
+                    eventStream().publish(new ImportPullRequestsEvent(response.asJson(), project));
+                }
             }
         }
     }

betterrev/conf/application.conf

 # Application
 
 owner=AdoptOpenJDK
-project=better-test-repo
+projects=better-test-repo betterrev

betterrev/conf/prod.conf

 db.default.partitionCount=1
 db.default.maxConnectionsPerPartition=5
 db.default.minConnectionsPerPartition=5
+
+# Application
+
+projects=adopt jdk8 jdk8-jdk jdk8-jaxws jdk8-jaxp jdk8-corba jdk8-langtools jdk8-hotspot jdk8-nashorn