sup icon indicating copy to clipboard operation
sup copied to clipboard

Supfile: Multiple runs in a single command?

Open pyrossh opened this issue 8 years ago • 8 comments

I know this might deviate from your current plan but having this might really be good since I'm trying to port somethings from a makefile to supfile

commands:
  setup-go:
    desc: Setup tools used for go
    run: go get -u github.com/alecthomas/gometalinter
      - go get -u github.com/alecthomas/gometalinter
      - gometalinter --install --update
      - go get -u github.com/Masterminds/glide
      - go get -u github.com/pyros2097/go-embed

Maybe I could do it with multiple commands but it might get messy

pyrossh avatar Apr 30 '16 16:04 pyrossh

Right now, you can simply do:

commands:
  setup-go:
    desc: Setup tools used for go
    run: >
      go get -u github.com/alecthomas/gometalinter && \
        go get -u github.com/alecthomas/gometalinter && \
        gometalinter --install --update && \
        go get -u github.com/Masterminds/glide && \
        go get -u github.com/pyros2097/go-embed

But I'm actually thinking of allowing multiple runs like this:

commands:
  setup-go:
    desc: Setup tools used for go
    run: go get -u github.com/alecthomas/gometalinter
    run: go get -u github.com/alecthomas/gometalinter
    run: gometalinter --install --update
    run: go get -u github.com/Masterminds/glide
    run: go get -u github.com/pyros2097/go-embed

It's not on my TODO list, though. I can prioritize if there's a bigger demand for this feature.

VojtechVitek avatar Apr 30 '16 16:04 VojtechVitek

I think run: > is just fine IMO.. Just needs to be documented as an example

On Apr 30, 2016, at 12:51 PM, Vojtech Vitek [email protected] wrote:

Right now, you can simply do:

commands: setup-go: desc: Setup tools used for go run: > go get -u github.com/alecthomas/gometalinter &&
go get -u github.com/alecthomas/gometalinter &&
gometalinter --install --update &&
go get -u github.com/Masterminds/glide &&
go get -u github.com/pyros2097/go-embed But I'm actually thinking of allowing multiple runs like this:

commands: setup-go: desc: Setup tools used for go run: go get -u github.com/alecthomas/gometalinter run: go get -u github.com/alecthomas/gometalinter run: gometalinter --install --update run: go get -u github.com/Masterminds/glide run: go get -u github.com/pyros2097/go-embed It's not on my TODO list, though. I can prioritize if there's a bigger demand for this feature.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub

pkieltyka avatar Apr 30 '16 17:04 pkieltyka

btw: You can also

setup-go:
  run: go get -u github.com/alecthomas/gometalinter; gometalinter --install --update

VojtechVitek avatar Apr 30 '16 17:04 VojtechVitek

I like the idea of run, run, run

commands:
  setup-go:
    desc: Setup tools used for go
    run: go get -u github.com/alecthomas/gometalinter
    run: go get -u github.com/alecthomas/gometalinter
    run: gometalinter --install --update
    run: go get -u github.com/Masterminds/glide
    run: go get -u github.com/pyros2097/go-embed

eduardonunesp avatar Apr 30 '16 19:04 eduardonunesp

I guess the second way is better and I think thats how they do it in ansible also. >_

pyrossh avatar May 01 '16 13:05 pyrossh

Majority consensus rules :)

pkieltyka avatar May 01 '16 15:05 pkieltyka

It's not only about the syntax sugar, multiple runs might have interesting side effects, when combining with other commands too.

commands:
  build:
    local: npm install
    upload:
       src: ./npm_modules
       dest: $WORKDIR/
    run: cd $WORKDIR && docker build -t image:$VERSION .
    run: docker push image:$VERSION
    local: curl #....webhook for Slack

The only problem is ... what about run flags (ie. once: true, serial: 2)? Do they apply to all run commands? Do they apply to the previously declared run command only? Same thing to consider for onerror rollbacks (#42).

VojtechVitek avatar May 01 '16 19:05 VojtechVitek

I think the flags should be sub items of run for that run only and the normal flags being "global"

runeimp avatar Sep 14 '17 02:09 runeimp