'JetBrains Space automation script

I try to solve the following issue:

job("Docker | deploy") {
    docker {
        build {
            context = "docker"
            file = "./docker/Dockerfile"
            labels["vendor"] = "mycompany"
            args["HTTP_PROXY"] = "http://10.20.30.1:123"
        }

        push("registry.com") {
            versionOne = Params("version-one")
            versionTwo = Params("version-two")
            
            tag = "${'$'}versionOne-${'$'}versionTwo"
        }
    }
}

Within the push step, the tag should be combined of versionOne and versionTwo dynamically, but I don't figured it out how to achieve this.

Does someone know how to use variables dynamically in a space automation script?



Solution 1:[1]

The correct way to do it below:

job("Docker | deploy") {
    env["VERSION_ONE"] = Params("version-one")
    env["VERSION_TWO"] = Params("version-two")

    docker {
        build {
            context = "docker"
            file = "./docker/Dockerfile"
            labels["vendor"] = "mycompany"
            args["HTTP_PROXY"] = "http://10.20.30.1:123"
        }

        push("registry.com") {
            tags("${'$'}VERSION_ONE-${'$'}VERSION_TWO")
        }
    }
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mikhail Kadysev