agola icon indicating copy to clipboard operation
agola copied to clipboard

Allow more then on runStep container

Open kvaster opened this issue 2 years ago • 3 comments

Currently agola can run command only in one container - the first one. Other containers are always treated as 'service container'. This is not comfortable even for clone operation - git binary may be absent in 'build' container.

This PR allow containers to have names and allow to specify container for runStep. First container and named containers are always treated as 'non-service'. If no container is specified for clone step then 'clone' container will be used. 'clone' container will default to alpine-git if unspecified.

Example:

  tasks:
  - name: build
    runtime:
      type: pod
      containers:
      - image: golang:latest
        name: golang
      - image: node:latest
        name: node
    steps:
    - clone
    - run:
      name: build frontend
        command: npm install && npm run build
        container: node
    - run:
        name: build backend
        command: go build .
        container: golang

kvaster avatar Sep 19 '22 17:09 kvaster

Any chances to discuss PR ?

kvaster avatar Sep 28 '22 10:09 kvaster

@kvaster I took a look at the PR but there're many changes I can't follow.

Before the code changes I'd like to understand and discuss the use case/cases you're proposing and then understand how these should be expressed in the config specification and then implement them. Can you open a new issue to discuss this?

sgotti avatar Sep 28 '22 11:09 sgotti

I've created issue.

kvaster avatar Sep 28 '22 12:09 kvaster