jrl-umi3218 / jrl-travis

Travis build scripts
Other
7 stars 10 forks source link

Error with Travis on forks #2

Closed bchretien closed 11 years ago

bchretien commented 11 years ago

Being able to use Travis on forks makes pull requests much (much!) easier to check and handle. Sadly, I just found the following bug:

$ ./.travis/run before_install
sed: -e expression #3, char 0: no previous regular expression

It seems to be caused by the anonymization process that fails if one of these variables is not found:

./.travis/$1 2>&1 | sed                                          \
    -e "s|${COVERITY_TOKEN}|\#EDITED\#|g"       \
    -e "s|${GNUPG_PASSPHRASE}|\#EDITED\#|g" \
    -e "s|${GH_USERNAME}|\#EDITED\#|g"            \
    -e "s|${GH_TOKEN}|\#EDITED\#|g"                   \
    -e "s|${GH_PUSH_URI}|\#EDITED\#|g"

There may be some more errors that will shound discovered during the investigation.

thomas-moulard commented 11 years ago

I think this expression should be built at runtime depending on what is defined, that should do the trick.

bchretien commented 11 years ago

I prepared a patch that you may want to double-check (https://github.com/bchretien/jrl-travis/commit/51eeb00dd3049e910c9023e5d6a34b69983df999).

thomas-moulard commented 11 years ago

cc @gergondet Actually I got a better idea:

COVERITY_TOKEN?="\#EDITED\#"
GNUPG_PASSPHRASE?="\#EDITED\#"
etc.

This will fix the sed command without needing to generate the command which is error-prone. Also it is more portable IMHO.

Sorry for telling this late ^^''

bchretien commented 11 years ago

I tried @thomas-moulard's idea without success, but this similar solution did the trick:

COVERITY_TOKEN=${COVERITY_TOKEN:-"\#EDITED\#"}
GNUPG_PASSPHRASE=${GNUPG_PASSPHRASE:-"\#EDITED\#"}
etc.