Skip to content

Commit

Permalink
CI/travis/lib.sh: localize all variables in upload_file_to_swdownloads()
Browse files Browse the repository at this point in the history
Shell variables need to be localized to make sure that they stop existing
once a shell script exits.
Otherwise, weird stuff can happen.

This change also removes the shorthand variables for the Travis-CI env
vars.

Signed-off-by: Alexandru Ardelean <[email protected]>
  • Loading branch information
commodo committed Dec 11, 2018
1 parent ae08593 commit c41077b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ env:
- secure: "bYHqhcYYuSbciQa5mBqMxs3CbJkrxxD7/G4zDW2war1IcMh8AC/KPeoYIuhd/L2Mg9+tP++xCznKUJzX85Hu+8EyrMGkC/6zWpGYgyO27DH7wl+9AJjR191WJKkg+S6OqZmb/5v0rdJMDnGOZHrRVB3Vec9dBT+jDTQbyxrckxE="
# DEPLOY_TO directory
- secure: "PMp93w9HAYd0pR4aw2LT1sMIVmA06f01Xq2jaGW2iy74n3GrqBYe7H9aMR0WD1S6KH9sFydqFI11bCpwUQXPopl+8MPA34AS7V2gaxDUdE+UZnKKXpKV6KRPRp/txlryuEGspjFJM0bo5g1H5lPBSBFj8PB1Bf6BiloGl8TTuiY="
- BRANCH_PULL=$TRAVIS_PULL_REQUEST_BRANCH
- PULL=$TRAVIS_PULL_REQUEST
- BRANCH=$TRAVIS_BRANCH

services:
- docker
Expand Down
14 changes: 7 additions & 7 deletions CI/travis/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -157,16 +157,16 @@ upload_file_to_swdownloads() {
return
fi

if [ $BRANCH_PULL ] ; then
branch=$BRANCH_PULL
if [ -n "$TRAVIS_PULL_REQUEST_BRANCH" ] ; then
local branch="$TRAVIS_PULL_REQUEST_BRANCH"
else
branch=$BRANCH
local branch="$TRAVIS_BRANCH"
fi

FROM=$1
TO=${branch}_$2
LATE=${branch}_latest_libiio${LDIST}$3
GLOB=${DEPLOY_TO}/${branch}_libiio-*
local FROM=$1
local TO=${branch}_$2
local LATE=${branch}_latest_libiio${LDIST}$3
local GLOB=${DEPLOY_TO}/${branch}_libiio-*

echo attemting to deploy $FROM to $TO
echo and ${branch}_libiio${LDIST}$3
Expand Down

0 comments on commit c41077b

Please sign in to comment.