Skip to content

Commit

Permalink
Change logic of release script
Browse files Browse the repository at this point in the history
  • Loading branch information
sileht committed Sep 14, 2017
1 parent b68c1a3 commit f54ecee
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ if [ "$1" ] ; then
version="$1"
if [ "$(get_version plugin.json)" != "$version" ]; then
sed -i 's/"version": "[^"]*"/"version": "'$version'"/' plugin.json package.json
./run-tests.sh
git commit -m "Bump version $version" plugin.json package.json
git push
fi
else
version=$(git tag | tail -1)
Expand All @@ -23,35 +25,32 @@ fi
[ ! "$GITHUB_TOKEN" ] && error "GITHUB_TOKEN is missing"
[ "$(get_version plugin.json)" != "$version" ] && error "plugin.json incorrect version"
[ "$(get_version package.json)" != "$version" ] && error "package.json incorrect version"
status=$(git status -sz)
[ -z "$status" ] || error "Repo is not clean"

echo "Building version $version"

./run-tests.sh

status=$(git status -sz)
[ -z "$status" ] || error "Repo is not clean after dist generation"

echo
echo "release: ${version} ? "
echo

read

git add -f dist/*
git commit -m "Release version $version" dist/

cp -a dist gnocchixyz-gnocchi-datasource
tar -czf gnocchixyz-gnocchi-datasource-${version}.tar.gz gnocchixyz-gnocchi-datasource

git tag $version -m "Release version $version"
git push
git push --tags

github-release release -u gnocchixyz -r grafana-gnocchi-datasource --tag $version --description "Release $version for Grafana 3 and 4"
github-release upload -u gnocchixyz -r grafana-gnocchi-datasource --tag $version --name gnocchixyz-gnocchi-datasource-${version}.tar.gz --file gnocchixyz-gnocchi-datasource-${version}.tar.gz

nextversion=$(inc_version $version)
sed -i 's/"version": "'$version'"/"version": "'$nextversion'"/' plugin.json package.json
git commit -m "Bump version $nextversion" plugin.json package.json
git commit -m "Bump version $nextversion" plugin.json package.json
git push

github-release release -u gnocchixyz -r grafana-gnocchi-datasource --tag $version --description "Release $version for Grafana 3 and 4"
github-release upload -u gnocchixyz -r grafana-gnocchi-datasource --tag $version --name gnocchixyz-gnocchi-datasource-${version}.tar.gz --file gnocchixyz-gnocchi-datasource-${version}.tar.gz

rm -rf gnocchixyz-gnocchi-datasource*

0 comments on commit f54ecee

Please sign in to comment.