/*
 * Copyright (c) 2019 Red Hat, Inc.
 * This program and the accompanying materials are made
 * available under the terms of the Eclipse Public License 2.0
 * which is available at:
 *
 *     https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *   Red Hat, Inc. - initial API and implementation
 */
plugins {
    id 'org.eclipse.jkube.kubernetes' version "${jKubeVersion}"
    id 'org.eclipse.jkube.openshift' version "${jKubeVersion}"
    id 'java'
}

group = 'org.eclipse.jkube.integration.tests.gradle'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'

repositories {
    mavenCentral()
}

kubernetes {
    offline = true
    images {
        image {
            name = 'repository/service:latest'
            build {
                from = 'quay.io/jkube/jkube-java-11'
            }
        }
    }
    resources {
        services = [
            {
                name = 'svc1'
                headless = false
                type = 'LoadBalancer'
                normalizePort = false
                expose = true
                ports = [
                        {
                            port = 8080
                            protocol = 'tcp'
                            targetPort = 8080
                            nodePort = 301243
                            name = 'port1'
                        }
                ]
            },
            {
                name = 'svc2'
                headless = true
                ports = [
                        {
                            port = 8081
                            protocol = 'tcp'
                            name = 'port2'
                        }
                ]
            }
        ]
    }
}

openshift {
    offline = true
    images {
        image {
            name = 'repository/service:latest'
            build {
                from = 'quay.io/jkube/jkube-java-11'
            }
        }
    }
    resources {
        services = [
                {
                    name = 'svc1'
                    headless = false
                    type = 'LoadBalancer'
                    normalizePort = false
                    expose = true
                    ports = [
                            {
                                port = 8080
                                protocol = 'tcp'
                                targetPort = 8080
                                nodePort = 301243
                                name = 'port1'
                            }
                    ]
                },
                {
                    name = 'svc2'
                    headless = true
                    ports = [
                            {
                                port = 8081
                                protocol = 'tcp'
                                name = 'port2'
                            }
                    ]
                }
        ]
    }
}