pressly / sup

Super simple deployment tool - think of it like 'make' for a network of servers
https://pressly.github.io/sup
MIT License
2.48k stars 178 forks source link

Supfile: Multiple runs in a single command? #71

Open pyrossh opened 8 years ago

pyrossh commented 8 years ago

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

VojtechVitek commented 8 years ago

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.

pkieltyka commented 8 years ago

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 notifications@github.com 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

VojtechVitek commented 8 years ago

btw: You can also

setup-go:
  run: go get -u github.com/alecthomas/gometalinter; gometalinter --install --update
eduardonunesp commented 8 years ago

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
pyrossh commented 8 years ago

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

pkieltyka commented 8 years ago

Majority consensus rules :)

VojtechVitek commented 8 years ago

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).

runeimp commented 7 years ago

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