Skip to content

Commit

Permalink
Add force update of index
Browse files Browse the repository at this point in the history
  • Loading branch information
frankmalin committed Sep 5, 2018
1 parent 635a8e8 commit e07000b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
13 changes: 6 additions & 7 deletions .build/bin/diffIndex.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function findnew() {
local list="GUARD"
local chartlist=`grep -v -f $old $new | cut -f1 -d':'`
[[ -z "$chartlist" ]] && { pushd `dirname $new`; ls -1 | egrep tgz | xargs -i rm {} ; popd ; end "No charts NEW found" ; return 0 ; } # there were no charts found
[[ -z "$chartlist" ]] && { pushd `dirname $new`; ls -1 | egrep tgz | xargs -I {} rm {} ; popd ; end "No charts NEW found" ; return 0 ; } # there were no charts found
set $chartlist # These are the new files
while test $# -gt 0
do
Expand All @@ -71,7 +71,7 @@ function findnew() {
done
# we have a list of new charts, now remove all the other chart
pushd `dirname $new`
ls -1 | egrep tgz | egrep -v "$list" | xargs -i -r rm {} || true
ls -1 | egrep tgz | egrep -v "$list" | xargs -I {} -r rm {} || true
popd
end
}
Expand Down Expand Up @@ -110,7 +110,7 @@ function removechart()
range=`egrep -n "^ [[:alnum:]]" $index | egrep -A1 ": $chartname:" | cut -f1 -d':' | xargs echo` || return 0 # We may have removed the chart already
start=`cut -f1 -d' ' <<< $range`
let end=`cut -f2 -d' ' <<< $range`-1
sed -i "${start},${end}d" $index
sed -i.bak "${start},${end}d" $index
end
}
Expand Down Expand Up @@ -142,19 +142,19 @@ function setup()
info "Build a helm repo to see if there are changes"
helm repo index . --url $URL
popd
cp $1 $1.master # save a copy of the master index for later comparison
cp $1 $1.master || touch $1.master # save a copy of the master index for later comparison
end
}
function commitchange()
{
begin "Commit the changes"
sed -i "s#https://github.com/IBM/charts#https://$PAT@github.com/IBM/charts#g" .git/config
sed -i.bak "s#https://github.com/IBM/charts#https://$PAT@github.com/IBM/charts#g" .git/config
git branch
git checkout $MASTER_BRANCH
git fetch
git stage repo/$repodir/
git stage -f repo/$repodir/index.yaml
git commit -m"[skip ci] - Master branch update with index" && git push origin $MASTER_BRANCH || info "No changes to push" # TODO, no changes will also appear if push fails, need to fix
end
}
Expand Down Expand Up @@ -185,4 +185,3 @@ finddeleted $oldindex $newindex
helmpackage `dirname $newindex` `dirname $oldindex`
commitchange
end "#########################################################################"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
repo/community/index.yaml
.travis.yml
.DS_Store
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ env:

before_install:
- echo "before install"
- cat .git/config


install:
Expand Down

0 comments on commit e07000b

Please sign in to comment.