Coder Social home page Coder Social logo

Comments (5)

liuhao92 avatar liuhao92 commented on September 21, 2024
 project.afterEvaluate {
    yourTask.dependsOn DockerPush<tag>
 }

maybe this can work, i have the same problem before

from gradle-docker.

artefactop avatar artefactop commented on September 21, 2024

Now I get a different error

project.afterEvaluate {
    testingDockerPushLatest.dependsOn DockerPushlatest
}
task testingDockerPushLatest(){
    print "testingDockerPushLatest"
}

Error:

Could not get unknown property 'DockerPushlatest' for root project 'myproject' of type org.gradle.api.Project.

from gradle-docker.

liuhao92 avatar liuhao92 commented on September 21, 2024

Im sorry , DockerPush should be dockerPush, and the first letter of tag should be uppercase, before you add the script above , you can run 'gradle tasks' to get all tasks,get the task name. and then add the script above.

from gradle-docker.

uschi2000 avatar uschi2000 commented on September 21, 2024

The tasks are defined here: https://github.com/palantir/gradle-docker/blob/develop/src/main/groovy/com/palantir/gradle/docker/PalantirDockerPlugin.groovy#L127 . As you can see, that whole block is in afterEvaluate. And yes, dockerPushLatest should be a valid task name if you have a "latest" tag configured like this:

docker {
  // <snip>
  tags 'latest', 'snapshot'
}

from gradle-docker.

artefactop avatar artefactop commented on September 21, 2024

That works, thank you, final tasks:

docker {
  // <snip>
  tags 'latest'
}

project.afterEvaluate {
    generateDocker.dependsOn dockerPushLatest
}

task generateDocker(){
    dependsOn tasks.dockerPush
}

task release(){
    dependsOn tasks.generateDocker
}

from gradle-docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.