Search in sources :

Example 1 with WebHookTrigger

use of io.fabric8.openshift.api.model.WebHookTrigger in project fabric8 by fabric8io.

the class TriggerBuild method main.

public static void main(String... args) {
    if (args.length < 1) {
        System.out.println("Usage: buildConfigName namespace secret type");
        return;
    }
    String name = args[0];
    String namespace = "default";
    if (args.length > 1) {
        namespace = args[1];
    }
    OpenShiftClient client = new DefaultOpenShiftClient();
    try {
        client.buildConfigs().inNamespace(namespace).withName(name).trigger(new WebHookTrigger(true, null));
    } catch (Exception e) {
        System.out.println("FAILED: " + e);
        e.printStackTrace();
    }
}
Also used : WebHookTrigger(io.fabric8.openshift.api.model.WebHookTrigger) DefaultOpenShiftClient(io.fabric8.openshift.client.DefaultOpenShiftClient) OpenShiftClient(io.fabric8.openshift.client.OpenShiftClient) DefaultOpenShiftClient(io.fabric8.openshift.client.DefaultOpenShiftClient)

Aggregations

WebHookTrigger (io.fabric8.openshift.api.model.WebHookTrigger)1 DefaultOpenShiftClient (io.fabric8.openshift.client.DefaultOpenShiftClient)1 OpenShiftClient (io.fabric8.openshift.client.OpenShiftClient)1