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

    return new ModuleBuild(
        buildState.getGitInfo(), buildState.getModule(), buildState.getPendingBuild().get());
  }
Exemple #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());
  }
Exemple #3
0
 @GET
 @Path("/{id}")
 public Optional<ModuleBuild> get(@PathParam("id") long id) {
   return buildService.get(id);
 }
Exemple #4
0
 @PUT
 public ModuleBuild update(ModuleBuild moduleBuild) {
   buildService.update(moduleBuild.getBuild());
   return moduleBuild;
 }