Skip to content

Commit

Permalink
clone with fresh git repository
Browse files Browse the repository at this point in the history
  • Loading branch information
Hermsi1337 committed Mar 19, 2020
1 parent b95f996 commit f112720
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions scripts/bump-app-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ CHART_YAML="./deploy/helm-chart/kubernetes-replicator/Chart.yaml"
TRAVIS_TAG="${TRAVIS_TAG:-v0.0.0}"
GITHUB_TOKEN="${GITHUB_TOKEN:-dummy}"

## temp working vars
TIMESTAMP="$(date +%s )"
TMP_DIR="/tmp/${TIMESTAMP}"

## set up Git-User
git config --global user.name "Mittwald Machine"
git config --global user.email "[email protected]"

## temporary clone git repository
git clone "https://${GIT_REPOSITORY}" "${TMP_DIR}"
cd "${TMP_DIR}"

## replace appVersion
sed -i "s#appVersion:.*#appVersion: ${TRAVIS_TAG}#g" "${CHART_YAML}"

Expand All @@ -24,15 +36,11 @@ sed -i "s#version:.*#version: ${TRAVIS_TAG/v/}#g" "${CHART_YAML}"
## useful for debugging purposes
git status

## set up Git-User
git config --global user.name "Mittwald Machine"
git config --global user.email "[email protected]"

## Add new remote with credentials baked in url
git remote add publisher "https://mittwald-machine:${GITHUB_TOKEN}@${GIT_REPOSITORY}"

## add and commit changed file
git add "${CHART_YAML}"
git add -A

## useful for debugging purposes
git status
Expand Down

0 comments on commit f112720

Please sign in to comment.