JaciBrunning / EmbeddedTools

Additions to the model-based DSL for deploying Java and Native projects to remote targets
MIT License
11 stars 2 forks source link

createBinariesTasks fails for deploy script #29

Closed andycate closed 5 years ago

andycate commented 5 years ago

I am having an issue writing a custom deploy script for my RoboRIO. I am trying to write a deploy script for a smart dashboard that I am creating. This involves moving a directory of files into /home/lvuser and then running some commands. However, when I run gradle deploy, I get the following error:

The following model rules could not be applied due to unbound inputs and/or subjects:

    DeployPlugin.DeployRules#createBinariesTasks(ModelMap<Task>, ExtensionContainer, BinaryContainer)
      subject:
        - tasks ModelMap<Task> (parameter 1)
      inputs:
        - extensionContainer ExtensionContainer (parameter 2)
        - <no path> BinaryContainer (parameter 3) [*]

  [*] - indicates that a model item could not be found for the path or type.

My deploy script is as follows:

plugins {
    id "com.jetbrains.python.envs" version "0.0.25"
    id "jaci.gradle.EmbeddedTools" version "2018.09.21"
}

repositories {
}

dependencies {
}

deploy {
    targets {
        target("roborio") {
            directory = "/home/lvuser"
            maxChannels = 1
            timeout = 3
            failOnMissing = true

            locations {
                ssh {
                    address = "roborio-5499-frc.local"
                    user = "admin"
                    password = ""
                    ipv6 = false
                }
                ssh {
                    address = "10.54.99.2"
                    user = "admin"
                    password = ""
                    ipv6 = false
                }
            }
        }
    }

    artifacts {
        // COMMON PROPERTIES FOR ALL ARTIFACTS //
        all {
            directory = "dashboard/"
            targets << "roborio"

            onlyIf = { execute("echo Hi").result == "Hi\n" }

            predeploy << { execute "echo Pre" }
            postdeploy << { execute "echo Post" }

            disabled = true
        }
        // END COMMON //

        // FileTreeArtifact - the directory structure is preserved
        fileTreeArtifact("dashboard") {
            files = fileTree(dir: "dashboard")
        }

        commandArtifact("restartDashboard") {
            command = "echo Hello"
            dependsOn("dashboard")
            disabled = false
        }
    }
}

envs {
    bootstrapDirectory = file(".")
    python "virtualenv_run", "3.6.4", ["pre-commit", "requirements-tools", "tox"]
}

task install_hooks {
    dependsOn "build_envs"

    doLast {
        exec {
            executable file("./virtualenv_run/bin/pre-commit")
            args "install", "-f", "--install-hooks"
        }
    }
}

Any help is appreciated!

JaciBrunning commented 5 years ago

Try updating to 2018.11.14

Your build.gradle will also need some modification: dependsOn takes a task name, not an artifact name (you can do the commands in postDeploy << { execute "echo Hello" } in the file artifact)

andycate commented 5 years ago

Ok, that worked. Thanks!