Automation docs don't match the quick start examples
I'm trying to set up a job to build and push a container from my current project.
However I found that the Quick Start examples available in the Space Job creation window are not the same as in the JetBrains Space docs.
1.
job("Build and push Docker") { docker { build { context = "docker" file = "./docker/Dockerfile" labels["vendor"] = "mycompany" args["HTTP_PROXY"] = "http://10.20.30.1:123" } push("mycompany.registry.jetbrains.space/p/mp/mydocker/myimage") { tags("version1.0") } } }
2.
job("Publish to Docker Hub") { kaniko("Docker build and push") { // assign project secrets to environment variables env["HUB_USER"] = Secrets("dockerhub_user") env["HUB_TOKEN"] = Secrets("dockerhub_token") // put auth data to Docker config beforeBuildScript { content = """ B64_AUTH=${'$'}(echo -n ${'$'}HUB_USER:${'$'}HUB_TOKEN | base64 -w 0) echo "{\"auths\":{\"https://index.docker.io/v1/\":{\"auth\":\"${'$'}B64_AUTH\"}}}" > ${'$'}DOCKER_CONFIG/config.json """ } build { labels["vendor"] = "mycompany" } //in push, specify repo_name/image_name push("myrepo/hello-from-space") { tags{ +"1.0.\$JB_SPACE_EXECUTION_NUMBER" } } } }
Please sign in to leave a comment.
Hi Ilya Levin, could you please be more specific about where the first example comes from? I just checked the scripts provided in Space UI, and they show the new version with kaniko and host blocks as expected. Thanks!