forked from kubesphere/helm-charts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
38 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,19 +120,42 @@ injectGithubToken() { | |
|
||
pushUpdates() { | ||
ensureVars GITHUB_USER GITHUB_TOKEN | ||
git fetch | ||
git checkout --track origin/gh-pages | ||
local repo | ||
for repo in $(ls $buildDir); do | ||
mkdir -p $repo && mv $buildDir/$repo/* $repo/ && git add $repo | ||
done | ||
git commit -m "Update Charts" --author="KubeSphere CI Bot <[email protected]>" | ||
git commit -m "Update" --author="KubeSphere CI Bot <[email protected]>" | ||
injectGithubToken | ||
echo "Pushing updates to GitHub ..." | ||
git push origin HEAD:gh-pages | ||
} | ||
|
||
prepareHelm | ||
updateRepos | ||
[ -z "$updatedRepos" ] || [ "$1" != "deploy" ] || pushUpdates | ||
verify() { | ||
prepareHelm | ||
updateRepos | ||
} | ||
|
||
deploy() { | ||
verify | ||
|
||
[ -z "$updatedRepos" ] || { | ||
git fetch | ||
git checkout --track origin/gh-pages | ||
local repo | ||
for repo in $(ls $buildDir); do | ||
mkdir -p $repo && mv $buildDir/$repo/* $repo/ && git add $repo | ||
done | ||
pushUpdates | ||
} | ||
} | ||
|
||
mirror() { | ||
local original=https://kubernetes-charts.storage.googleapis.com | ||
local mirrored=https://helm-chart-repo.pek3a.qingstor.com/kubernetes-charts | ||
git fetch | ||
git checkout --track origin/gh-pages | ||
mkdir -p mirror | ||
cd mirror | ||
curl -L $original/index.yaml -o index.yaml | ||
sed -i "s#$original#$mirrored#g" index.yaml | ||
|
||
pushUpdates | ||
} | ||
|
||
$@ |