Run parallel steps in same container

Hi there,

How can we run parallel steps in same POD?

I was trying to startup the spring-boot application in one step1 and running integration tests in another step2. So I have same image in both steps.

At the moment I can see application started up in Step1 (localhost:8405) in local host, However in Step2 when I try to hit api endpoint in the running app in Step1, get Failed to connect to localhost port 8405: Connection refused.

I beleive resaon for the above error was due to two steps running in two different PODs

As per the below code, I can see it’s hitting the endpoint after comleting the application strat-up.

intTest:
  titile: IT
  stage: test
  type: parallel
  steps:
    step1:
        title: start App
        stage: test
        type: xxxxl/build-gradle
        fail_fast: false
        working_directory: "${{clone}}"
        arguments:
          RUNNER_IMAGE: xxxxxx/cf-gradle-jdk17-runner:1.0
          BASE_DIR: .
          ARGS: "./gradlew bootRunStartDaemon"
          
      step2:
        title: End point test
        stage: test
        image: 'xxxxxxx/cf-gradle-jdk17-runner:1.0'
        commands:
            ["echo Delay before hit the api endpoint; sleep 500","curl -X GET http://localhost:8405/my-accounts -H 'Content-Type: application/json' -H 'Authorization: Bearer xxxxxxxx'"]

Hello

Pipeline steps are for things that are expected to start, do something and then finish. If you want to launch a running service you need to use service containers. Service containers in pipelines · Codefresh | Docs

Here is an example for Java Spring Boot 2/Maven · Codefresh | Docs

1 Like