sup
sup copied to clipboard
Supfile: Multiple runs in a single command?
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
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 run
s 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.
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
btw: You can also
setup-go:
run: go get -u github.com/alecthomas/gometalinter; gometalinter --install --update
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
I guess the second way is better and I think thats how they do it in ansible also. >_
Majority consensus rules :)
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).
I think the flags should be sub items of run for that run only and the normal flags being "global"