/*
 * Copyright 2012 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import org.opencord.gradle.rules.*
import org.yaml.snakeyaml.Yaml
import org.yaml.snakeyaml.DumperOptions

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "gradle.plugin.com.dorongold.plugins:task-tree:1.2.1"
  }
}

apply plugin: "com.dorongold.task-tree"

evaluationDependsOn(':maas')
evaluationDependsOn(':onos-apps')

allprojects {
    apply plugin: 'base'
    apply plugin: 'de.gesellix.docker'
    //apply plugin: 'com.tmiyamon.config'

    docker {
        // dockerHost = System.env.DOCKER_HOST ?: 'unix:///var/run/docker.sock'
        // dockerHost = System.env.DOCKER_HOST ?: 'https://192.168.99.100:2376'
        // certPath = System.getProperty('docker.cert.path') ?: "${System.getProperty('user.home')}/.docker/machine/machines/default"
        // authConfigPlain = [
        //   "username"       : "joe",
        //   "password"       : "some-pw-as-needed",
        //   "email"          : "joe@acme.com",
        //   "serveraddress"  : "https://index.docker.io/v1/"
        //  ]
    }
}

ext {

    // Deployment target config file (yaml format); this can be overwritten from the command line
    // using the -PdeployConfig=<file-path> syntax.
    deployConfig = project.hasProperty('deployConfig') ? project.getProperty('deployConfig') : './config/default.yml'

    println "Using deployment config: $deployConfig"
    File configFile = new File(deployConfig)
    def yaml = new Yaml()
    config = yaml.load(configFile.newReader())

    // Upstream registry to simplify filling out the comps table below
    upstreamReg = project.hasProperty('upstreamReg') ? project.getProperty('upstreamReg') : 'docker.io'

    // Target registry to be used to publish docker images needed for deployment
    targetReg = project.hasProperty('targetReg')
        ? project.getProperty('targetReg')
        : config.docker && config.docker.registry
            ? config.docker.registry
            : config.seedServer.ip
                ? config.seedServer.ip + ":5000"
                : 'localhost:5000'

    // The tag used to tag the docker images push to the target registry
    targetTag = project.hasProperty('targetTag')
        ? project.getProperty('targetTag')
        : config.docker && config.docker.imageVersion
            ? config.docker.imageVersion
            : 'candidate'

    // Component table
    comps = [
            // ONOS 1.8.2 from the opencord Dockerhub
            'opencord/onos': [
                    'type':     'image',
                    'upstream': upstreamReg,
                    'name':     'opencord/onos',
                    'digest':   'sha256:935da663c381393316e0c658d49dde10d90a7383e3d7c53271b1223cec31d44c'
            ],
            'nginx': [
                    'type':     'image',
                    'upstream': upstreamReg,
                    'name':     'nginx',
                    'digest':   'sha256:b555f8c64ab4e85405e0d8b03f759b73ce88deb802892a3b155ef55e3e832806'
            ],
            'swarm': [
                    'type':     'image',
                    'upstream': upstreamReg,
                    'name':     'swarm',
                    'digest':   'sha256:6ca9b40980e2fcdcd229900ec8933f3e92c14ead22c9404cb09736cb4f3a9248'
            ],
            'xosproject/vsg': [
                    'type':     'image',
                    'upstream': upstreamReg,
                    'name':     'xosproject/vsg',
                    'digest':   'sha256:18d1c6ef9767d8a41c9b51948776052d024d4e3294e5d1d6dde1a49112175d91'
            ],
            'xosproject/xos-postgres': [
                    'type':     'image',
                    'upstream': upstreamReg,
                    'name':     'xosproject/xos-postgres',
                    'digest':   'sha256:f2d31a50b8af7434ab07b1e54e99c1ff1e10d77d16a46e5d6933d3c0528f4820'
            ],
            'xosproject/cord-app-build': [
                    'type':     'image',
                    'upstream': upstreamReg,
                    'name':     'xosproject/cord-app-build',
                    'digest':   'sha256:528c6ac3a87609779035857a7b1cf9fab8e046e7ac259d72cf275f1c46d7416e'
            ],
            'xosproject/xos-base': [
                    'type':     'image',
                    'upstream': upstreamReg,
                    'name':     'xosproject/xos-base',
                    'digest':   'sha256:daecc5fb7d95942c5092d480fa22a41a1588896df87829fc371caa5df2a013a7'
            ],
            'redis': [
                    'type':     'image',
                    'upstream': upstreamReg,
                    'name':     'redis',
                    'digest':   'sha256:0fe5a7afa2c2154f37c8ab56a9a6c5023cb0405cc0e85b34d8dcc1de6c3f143e'
            ],
            'node': [
                    'type':     'image',
                    'upstream': upstreamReg,
                    'name':     'node',
                    'digest':   'sha256:5757581a8ff7e08041512a54aa3f573d33fecdce81d603e48a759956cd99bdd3'
            ],
    ]
}

// ---------------- Useful tasks ----------------

task copyAnsibleInventory(type: Copy) {
  from 'platform-install/inventory/templates/single-prod'
    into 'platform-install/inventory'
    expand([
        prod: config.seedServer.ip,
    ])
}

task writeYamlConfig {
  def outvar = config.seedServer
  def outfilename = "genconfig/config.yml"

  DumperOptions options = new DumperOptions()

  options.setExplicitStart(true);
  options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK)
  options.setPrettyFlow(true);
  options.setIndent(2);

  def yaml = new Yaml(options)
  Writer outfile = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outfilename), "utf-8"))

  yaml.dump(outvar, outfile)
  outfile.close()
}

task writeProdInventory(type: Copy) {
  from 'ansible/prod-inv'
    into 'genconfig'
    expand([
        prod: config.seedServer.ip,
    ])
}

task fetchUpstreamImages {
    comps.each { name, spec -> if (spec.type == 'image') { dependsOn "fetch" + name } }
}

task fetch  {
    dependsOn fetchUpstreamImages
}

task buildImages  {
    logger.info "Root project has nothing to build"
}

task publishImages {
    comps.each { name, spec -> if (spec.type == 'image') { 
            dependsOn "publish" + name 
          } 
    }
}

task publish {
    dependsOn publishImages
}

tasks.addRule(new DockerFetchRule(project))
tasks.addRule(new DockerPublishRule(project, project(':maas').prime))
tasks.addRule(new DockerTagRule(project))

task CopyCord(type: Exec) {
  dependsOn writeYamlConfig
  dependsOn writeProdInventory

  executable = "ansible"
  args = [ "-i", "genconfig/prod-inv", "-b", "-m", "synchronize", "-a", "src='../../' dest='/opt/cord'", "head" ]
}

task ChownCord(type: Exec) {
  dependsOn CopyCord

  executable = "ansible"
  args = [ "-i", "genconfig/prod-inv", "-b", "-m", "file", "-a", "state='directory' dest='/opt/cord' recurse='yes' owner='$config.seedServer.ansible_user'", "head" ]
}

task PIprepPlatform(type: Exec) {
  dependsOn CopyCord
  dependsOn ChownCord

  def ansible_cmd = "cd /opt/cord/build/platform-install; ansible-playbook -i inventory/head-localhost --extra-vars @/opt/cord/build/genconfig/config.yml cord-prep-platform.yml"

  executable = "ssh"
  args = ["$config.seedServer.ansible_user@$config.seedServer.ip", ansible_cmd ]
}

task PIdeployOpenStack (type: Exec) {
  def ansible_cmd = "cd /opt/cord/build/platform-install; ansible-playbook -i inventory/head-localhost --extra-vars @/opt/cord/build/genconfig/config.yml cord-deploy-openstack.yml"

  executable = "ssh"
  args = ["$config.seedServer.ansible_user@$config.seedServer.ip", ansible_cmd ]
}

task PIdeployONOS (type: Exec) {
  def ansible_cmd = "cd /opt/cord/build/platform-install; ansible-playbook -i inventory/head-localhost --extra-vars @/opt/cord/build/genconfig/config.yml cord-deploy-onos.yml"

  executable = "ssh"
  args = ["$config.seedServer.ansible_user@$config.seedServer.ip", ansible_cmd ]
}

task PIdeployXOS (type: Exec) {
  def ansible_cmd = "cd /opt/cord/build/platform-install; ansible-playbook -i inventory/head-localhost --extra-vars @/opt/cord/build/genconfig/config.yml cord-deploy-xos.yml"

  executable = "ssh"
  args = ["$config.seedServer.ansible_user@$config.seedServer.ip", ansible_cmd ]
}

task PIsetupAutomation (type: Exec) {
  def ansible_cmd = "cd /opt/cord/build/platform-install; ansible-playbook -i inventory/head-localhost --extra-vars @/opt/cord/build/genconfig/config.yml cord-automation.yml"

  executable = "ssh"
  args = ["$config.seedServer.ansible_user@$config.seedServer.ip", ansible_cmd ]
}

task postDeployTests (type: Exec) {

  def ansible_cmd = "cd /opt/cord/build/platform-install; ansible-playbook -i inventory/head-localhost --extra-vars @/opt/cord/build/genconfig/config.yml cord-post-deploy-playbook.yml"

  executable = "ssh"
  args = ["$config.seedServer.ansible_user@$config.seedServer.ip", ansible_cmd ]
}

project('onos-apps').publishMavenRepoImage.dependsOn project(':maas').prime
project(':onos-apps').deploy.dependsOn project(':maas').deployBase

project('onos-apps').publishMavenRepoImage.dependsOn project(':maas').prime
project(':onos-apps').deploy.dependsOn project(':maas').deployBase

task PIdeployPlatform {
     dependsOn CopyCord
     dependsOn ChownCord
     dependsOn project(':onos-apps').deploy
     dependsOn project(':maas').deployBase
     dependsOn PIprepPlatform
     dependsOn PIdeployOpenStack
     dependsOn PIdeployONOS
     dependsOn PIdeployXOS
     dependsOn PIsetupAutomation
}

ChownCord.mustRunAfter CopyCord
PIprepPlatform.mustRunAfter ChownCord
PIdeployOpenStack.mustRunAfter PIprepPlatform
PIdeployONOS.mustRunAfter PIdeployOpenStack
PIdeployXOS.mustRunAfter PIdeployONOS
PIsetupAutomation.mustRunAfter PIdeployXOS
PIdeployPlatform.mustRunAfter project(':onos-apps').deploy
PIdeployPlatform.mustRunAfter project(':maas').deployBase

task deploy  {
    dependsOn PIdeployPlatform
}

