Deployments: start in one automation - finish in an other one

Hey!
My current process needs to be like:

  1. Automation of code-repository builds and pushes some docker-image into registry - which "starts" the deployment in that project
  2. The CD system fetches the freshly built image, rolls it out and pushes the rolled out version back into an OTHER repository (completely asynchronous process!)
  3. Automation of secondary repository kicks in and marks the deployment as "finished"

For now the primary automation does all - it starts the deployment (as desired) but after it dockerBuildPush'ed the image it sets the deployment directly to "finished" (not desired).

Snippet primary automation:

job("Create application release")
{
  startOn {
    gitPush {
      branchFilter {
        +"refs/heads/master"
      }
      tagFilter {
        +"release/*" // only run on tagged releases
      }
    }
  }

  container("Run deploy script", image = "gradle:7.1-jre11")
  {
    kotlinScript { api ->
      api.space().projects.automation.deployments.start(
        project = api.projectIdentifier(),
        targetIdentifier = TargetIdentifier.Key("deploy-to-staging"),
        version = api.gitBranch().split("/")[3],
        syncWithAutomationJob = false)
      }
  }
... (here goes the build-push and stuff)

The secondary automation also works fine (it is a "shellScript" utilizing curl-call to api on 

${'$'}JB_SPACE_API_URL/api/http/projects/key:${'$'}JB_SPACE_PROJECT_KEY/automation/deployments/finish

which successfully re-sets the finish/complete state.
Both repos are in the very same project - just said.

Any further ideas/tipps/hints how to prevent the "finish"-state in primary automation?

 

Thanks and regards,
Ingo

 
 
 
0
2 comments

Must have been some... asynchrounous problem. It actually works. :D

0
Hello Ingo,

If the issue repeats, could you please generate a log file and share it with the Space Support team? In case you would like to avoid sharing the data publicly, feel free to use a ticketing form: https://space-support.jetbrains.com/hc/en-us/requests/new

Thanks!
0

Please sign in to leave a comment.