delete tool directory since it has no tools in it and add release.sh script

This commit is contained in:
Seif Lotfy
2016-10-17 23:53:08 +02:00
committed by Travis Reeder
parent cdf4ba1f96
commit 3433f1756c
2 changed files with 30 additions and 13 deletions

30
release.sh Normal file
View File

@@ -0,0 +1,30 @@
#!/bin/bash
set -ex
user="iron"
service="functions"
version_file="api/server/version.go"
tag="latest"
if [ -z $(grep -m1 -Eo "[0-9]+\.[0-9]+\.[0-9]+" $version_file) ]; then
echo "did not find semantic version in $version_file"
exit 1
fi
perl -i -pe 's/\d+\.\d+\.\K(\d+)/$1+1/e' $version_file
version=$(grep -m1 -Eo "[0-9]+\.[0-9]+\.[0-9]+" $version_file)
echo "Version: $version"
./scripts/build-docker.sh
git add -u
git commit -m "$service: $version release"
git tag -a "$version" -m "version $version"
git push
git push --tags
# Finally tag and push docker images
docker tag $user/$service:$tag $user/$service:$version
docker push $user/$service:$version
docker push $user/$service:$tag