forked from cloudfoundry-community/redis-boshrelease
-
Notifications
You must be signed in to change notification settings - Fork 2
/
create-release.sh
executable file
·34 lines (24 loc) · 938 Bytes
/
create-release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
THIS_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
function latest_version {
git describe --tags "$(git rev-list --tags --max-count=1)" || return 1
}
function bump_minor_version {
local version=$1
local major_version
local minor_version
major_version="$(echo "$version" | awk -F '.' '{print $1}')"
minor_version="$(echo "$version" | awk -F '.' '{print $2}')"
echo "$major_version.$(( minor_version + 1 )).0"
}
function main {
local redis_bosh_release_version
local release_dir
local tarball
redis_bosh_release_version="$(bump_minor_version "$(latest_version)")"
release_dir="$THIS_SCRIPT_DIR/releases"
tarball="redis-boshrelease-$redis_bosh_release_version.tgz"
"$THIS_SCRIPT_DIR"/add-blobs.sh
bosh create-release --name=redis --force --version="$redis_bosh_release_version" --final --tarball="$release_dir/$tarball"
}
main