예제 #1
0
  @POST
  public ModuleBuild trigger(BuildDefinition buildDefinition) {
    BuildState buildState = buildService.enqueue(buildDefinition);

    return new ModuleBuild(
        buildState.getGitInfo(), buildState.getModule(), buildState.getPendingBuild().get());
  }
예제 #2
0
  @POST
  @Path("/{id}/cancel")
  public void cancel(@PathParam("id") long id) {
    Optional<ModuleBuild> build = get(id);
    if (!build.isPresent()) {
      throw new NotFoundException("No build found for ID " + id);
    }

    buildService.cancel(build.get().getBuild());
  }
예제 #3
0
 @GET
 @Path("/{id}")
 public Optional<ModuleBuild> get(@PathParam("id") long id) {
   return buildService.get(id);
 }
예제 #4
0
 @PUT
 public ModuleBuild update(ModuleBuild moduleBuild) {
   buildService.update(moduleBuild.getBuild());
   return moduleBuild;
 }