containers / build

another build tool for container images (archived, see https://github.com/rkt/rkt/issues/4024)
Apache License 2.0
342 stars 80 forks source link

script: ending the build results in "no build in progress" #288

Closed lucab closed 7 years ago

lucab commented 7 years ago

I'm using an simple acbuild-script to copy a bunch of files and write an ACI for a small experiment of mine.

Script source is here on github. It works generally fine, except that ending the build errors out:

Writing ACI to target/stage1-volo.aci
Ending the build
script: no build in progress in this working dir - try "acbuild begin"
exit status 1

The resulting aci file however is completely fine. Not a big deal, mostly a cosmetic annoyance.

cgonyeo commented 7 years ago

Script mode in acbuild will handle calling end for you. What I believe happens here is that your end gets called and completes successfully, and then acbuild calls end because the script is over, and the second one fails.

I'll make acbuild emit some warning explaining this when you use end in a script.

lucab commented 7 years ago

You seems to be right in that, the "end" at the bottom is superfluous.

cgonyeo commented 7 years ago

The reason I had acbuild do end for you in this instance is to remove this boilerplate from pretty much every acbuild bash script:

acbuildEnd() {
    export EXIT=$?
    acbuild --debug end && exit $EXIT 
}
trap acbuildEnd EXIT