-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
54 additions
and
22 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
java-components/cli/src/main/java/com/redhat/hacbs/cli/driver/CancelPipeline.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.redhat.hacbs.cli.driver; | ||
|
||
import jakarta.enterprise.context.control.ActivateRequestContext; | ||
import jakarta.inject.Inject; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import com.redhat.hacbs.driver.Driver; | ||
import com.redhat.hacbs.driver.dto.CancelRequest; | ||
|
||
import picocli.CommandLine; | ||
|
||
@CommandLine.Command(name = "cancel-pipeline", mixinStandardHelpOptions = true, description = "Creates a pipeline") | ||
public class CancelPipeline implements Runnable { | ||
|
||
private static final Logger logger = LoggerFactory.getLogger(CancelPipeline.class); | ||
|
||
@Inject | ||
Driver driver; | ||
|
||
@CommandLine.Option(names = "-n", description = "Namespace", defaultValue = "pnc-devel-tenant") | ||
String namespace; | ||
|
||
@CommandLine.Option(names = "-p", description = "Pipeline name") | ||
String pipeline; | ||
|
||
@ActivateRequestContext // https://github.com/quarkusio/quarkus/issues/8758 | ||
@Override | ||
public void run() { | ||
var cancel = CancelRequest.builder() | ||
.namespace(namespace) | ||
.pipelineId(pipeline) | ||
.build(); | ||
Check warning on line 34 in java-components/cli/src/main/java/com/redhat/hacbs/cli/driver/CancelPipeline.java Codecov / codecov/patchjava-components/cli/src/main/java/com/redhat/hacbs/cli/driver/CancelPipeline.java#L31-L34
|
||
|
||
driver.cancel(cancel); | ||
} | ||
Check warning on line 37 in java-components/cli/src/main/java/com/redhat/hacbs/cli/driver/CancelPipeline.java Codecov / codecov/patchjava-components/cli/src/main/java/com/redhat/hacbs/cli/driver/CancelPipeline.java#L36-L37
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters