Search in sources :

Example 1 with Opm

use of io.syndesis.qe.marketplace.manifests.Opm in project syndesis-qe by syndesisio.

the class Syndesis method deployViaBundle.

private void deployViaBundle() {
    if (subscriptionExists()) {
        return;
    }
    Index index;
    Bundle foBundle = null;
    OpenShiftService ocpSvc;
    if (TestConfiguration.getBundleImage() != null) {
        ocpSvc = TestConfiguration.getOpenShiftService("fuse-online-index");
    } else {
        String[] parts = TestConfiguration.getIndexImage().split("/");
        String quayProject = parts[parts.length - 1].split(":")[0];
        ocpSvc = TestConfiguration.getOpenShiftService(quayProject);
    }
    Opm opm = new Opm(ocpSvc);
    QuayUser quayUser = TestConfiguration.getQuayUser();
    if (TestConfiguration.getBundleImage() != null) {
        // Deploy from bundle
        index = opm.createIndex("quay.io/marketplace/fuse-online-index:" + TestConfiguration.syndesisVersion());
        foBundle = index.addBundle(TestConfiguration.getBundleImage());
    } else {
        // deploy from existing index image
        index = opm.pullIndex(TestConfiguration.getIndexImage(), quayUser);
    }
    index.push(quayUser);
    try {
        // OCP stuff - add index
        ocpSvc.patchGlobalSecrets(TestConfiguration.getQuayPullSecret());
        index.addIndexToCluster(ocpSvc, "fuse-online-test-catalog");
        if (foBundle != null) {
            foBundle.createSubscription(ocpSvc);
        } else {
            Bundle.createSubscription(ocpSvc, "fuse-online", "fuse-online-7.9.x", "''", "fuse-online-test-catalog");
        }
        OpenShiftWaitUtils.waitFor(OpenShiftWaitUtils.areExactlyNPodsRunning("name", "syndesis-operator", 1));
    } catch (IOException | TimeoutException | InterruptedException e) {
        e.printStackTrace();
    }
    createPullSecret();
    if (TestConfiguration.enableTestSupport()) {
        TestUtils.withRetry(this::enableTestSupport, 5, 10, "Failed to patch CSV");
    }
    deployCrAndRoutes();
    CommonSteps.waitForSyndesis();
}
Also used : OpenShiftService(io.syndesis.qe.marketplace.openshift.OpenShiftService) Bundle(io.syndesis.qe.marketplace.manifests.Bundle) QuayUser(io.syndesis.qe.marketplace.quay.QuayUser) Index(io.syndesis.qe.marketplace.manifests.Index) IOException(java.io.IOException) Opm(io.syndesis.qe.marketplace.manifests.Opm) TimeoutException(java.util.concurrent.TimeoutException)

Aggregations

Bundle (io.syndesis.qe.marketplace.manifests.Bundle)1 Index (io.syndesis.qe.marketplace.manifests.Index)1 Opm (io.syndesis.qe.marketplace.manifests.Opm)1 OpenShiftService (io.syndesis.qe.marketplace.openshift.OpenShiftService)1 QuayUser (io.syndesis.qe.marketplace.quay.QuayUser)1 IOException (java.io.IOException)1 TimeoutException (java.util.concurrent.TimeoutException)1