Search in sources :

Example 1 with BuildFinishedEvent

use of io.fabric8.kubernetes.api.builds.BuildFinishedEvent in project fabric8 by fabric8io.

the class WatchBuilds method main.

public static void main(String... args) {
    String namespace = null;
    if (args.length > 0) {
        namespace = args[0];
    }
    String consoleLink = Links.getFabric8ConsoleLink();
    OpenShiftClient client = new DefaultOpenShiftClient();
    BuildListener buildListener = new BuildListener() {

        @Override
        public void onBuildFinished(BuildFinishedEvent event) {
            System.out.println("Build: " + event.getUid() + " for config: " + event.getConfigName() + " finished. Status: " + event.getStatus() + " link: " + event.getBuildLink());
        }
    };
    BuildWatcher watcher = new BuildWatcher(client, buildListener, namespace, consoleLink);
    long pollTime = 3000;
    watcher.schedule(pollTime);
    watcher.join();
}
Also used : BuildListener(io.fabric8.kubernetes.api.builds.BuildListener) BuildWatcher(io.fabric8.kubernetes.api.builds.BuildWatcher) DefaultOpenShiftClient(io.fabric8.openshift.client.DefaultOpenShiftClient) OpenShiftClient(io.fabric8.openshift.client.OpenShiftClient) BuildFinishedEvent(io.fabric8.kubernetes.api.builds.BuildFinishedEvent) DefaultOpenShiftClient(io.fabric8.openshift.client.DefaultOpenShiftClient)

Aggregations

BuildFinishedEvent (io.fabric8.kubernetes.api.builds.BuildFinishedEvent)1 BuildListener (io.fabric8.kubernetes.api.builds.BuildListener)1 BuildWatcher (io.fabric8.kubernetes.api.builds.BuildWatcher)1 DefaultOpenShiftClient (io.fabric8.openshift.client.DefaultOpenShiftClient)1 OpenShiftClient (io.fabric8.openshift.client.OpenShiftClient)1