Skip to content

Commit

Permalink
Fix target repo. Changed commit message. Revert changes of release_utils
Browse files Browse the repository at this point in the history
  • Loading branch information
Andres committed Aug 29, 2018
1 parent 2013cb7 commit 0e7a4e1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
13 changes: 6 additions & 7 deletions script/chart_sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@

set -e

CHARTS_REPO="andresmgot/charts-1"
CHARTS_REPO="bitnami/charts"
CHART_REPO_PATH="bitnami/kubeapps"
PROJECT_DIR=`cd "$( dirname "${BASH_SOURCE[0]}" )/.." >/dev/null && pwd`
KUBEAPPS_CHART_DIR="${PROJECT_DIR}/chart/kubeapps"

source $PROJECT_DIR/script/release_utils.sh

changedVersion() {
local currentVersion=$(cat "${KUBEAPPS_CHART_DIR}/Chart.yaml" | grep "version:")
local externalVersion=$(curl -s https://raw.githubusercontent.com/${CHARTS_REPO}/master/${CHART_REPO_PATH}/Chart.yaml | grep "version:")
Expand Down Expand Up @@ -55,8 +53,8 @@ updateRepo() {

commitAndPushChanges() {
local targetRepo=${1:?}
local token=${2:?}
local targetBranch=${2:-"master"}
local targetVersion=${3:?}
if [ ! -f "${targetRepo}/${CHART_REPO_PATH}/Chart.yaml" ]; then
echo "Wrong repo path. You should provide the root of the repository" > /dev/stderr
return 1
Expand All @@ -68,7 +66,7 @@ commitAndPushChanges() {
return 1
fi
git add --all .
git commit -m "Update Kubeapps chart"
git commit -m "kubeapps: bump chart version to $targetVersion"
# NOTE: This expects to have a loaded SSH key
git push origin $targetBranch
cd -
Expand All @@ -81,9 +79,10 @@ if changedVersion; then
mkdir -p $tempDir
git clone https://github.com/${CHARTS_REPO} $tempDir
configUser $tempDir $user $email
latestVersion=$(getLatestTag)
git fetch --tags
latestVersion=$(git describe --tags $(git rev-list --tags --max-count=1))
updateRepo $tempDir $latestVersion
commitAndPushChanges $tempDir master
commitAndPushChanges $tempDir master $latestVersion
else
echo "Skipping Chart sync. The version has not changed"
fi
8 changes: 2 additions & 6 deletions script/release_utils.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
#!/bin/bash
set -e

function getLatestTag {
git fetch --tags
git describe --tags $(git rev-list --tags --max-count=1)
}

function commit_list {
local tag=${1:?}
local repo_domain=${2:?}
local repo_name=${3:?}
local previous_tag=$(getLatestTag)
git fetch --tags
local previous_tag=`git describe --tags $(git rev-list --tags --max-count=1)`
local commit_list=`git log $previous_tag..$tag --pretty=format:"- %s %H (%an)"`
echo "$commit_list"
}
Expand Down

0 comments on commit 0e7a4e1

Please sign in to comment.