-
Notifications
You must be signed in to change notification settings - Fork 2
/
create-release.sh
executable file
·34 lines (24 loc) · 968 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 metricbeat_bosh_release_version
local release_dir
local tarball
metricbeat_bosh_release_version="$(bump_minor_version "$(latest_version)")"
release_dir="$THIS_SCRIPT_DIR/releases"
tarball="metricbeat-boshrelease-$metricbeat_bosh_release_version.tgz"
"$THIS_SCRIPT_DIR"/add-blobs.sh
bosh create-release --name=metricbeat --force --version="$metricbeat_bosh_release_version" --final --tarball="$release_dir/$tarball"
}
main