Skip to content

Commit

Permalink
Pull request 2150: AG-28455 rc versions
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit 9b80bf2
Merge: 2c18415 fede297
Author: Eugene Burkov <[email protected]>
Date:   Fri Feb 16 15:49:23 2024 +0300

    Merge branch 'master' into AG-28455-rc-versions

commit 2c18415
Author: Eugene Burkov <[email protected]>
Date:   Wed Feb 14 13:01:30 2024 +0300

    scripts: imp code

commit f096505
Author: Eugene Burkov <[email protected]>
Date:   Tue Feb 13 14:52:10 2024 +0300

    scripts: imp code

commit a5bed23
Author: Eugene Burkov <[email protected]>
Date:   Mon Feb 12 18:35:52 2024 +0300

    scripts: fix typo

commit 36e9ea1
Author: Eugene Burkov <[email protected]>
Date:   Mon Feb 12 15:41:57 2024 +0300

    scripts: revert changes, imp docs

commit d74c85d
Author: Eugene Burkov <[email protected]>
Date:   Mon Feb 5 18:12:38 2024 +0300

    all: mark rc versions separately
  • Loading branch information
EugeneOne1 committed Feb 16, 2024
1 parent fede297 commit bd99e3e
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 6 deletions.
16 changes: 15 additions & 1 deletion bamboo-specs/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
'name': 'AdGuard Home - Build and run tests'
'variables':
'dockerGo': 'adguard/golang-ubuntu:8.0'
'channel': 'development'

'stages':
- 'Tests':
Expand Down Expand Up @@ -73,7 +74,7 @@
make\
ARCH="amd64"\
OS="windows darwin linux"\
CHANNEL="development"\
CHANNEL=${bamboo.channel}\
SIGN=0\
PARALLELISM=1\
VERBOSE=2\
Expand Down Expand Up @@ -115,3 +116,16 @@
'labels': []
'other':
'concurrent-build-plugin': 'system-default'

'branch-overrides':
# rc-vX.Y.Z branches are the release candidate branches. They are created
# from the release branch and are used to build the release candidate
# images.
- '^rc-v[0-9]+\.[0-9]+\.[0-9]+':
# Build betas on release branches manually.
'triggers': []
# Set the default release channel on the release branch to beta, as we
# may need to build a few of these.
'variables':
'dockerGo': 'adguard/golang-ubuntu:8.0'
'channel': 'candidate'
4 changes: 2 additions & 2 deletions scripts/make/go-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ readonly channel

case "$channel"
in
('development'|'edge'|'beta'|'release')
('development'|'edge'|'beta'|'release'|'candidate')
# All is well, go on.
;;
(*)
echo "invalid channel '$channel', supported values are\
'development', 'edge', 'beta', and 'release'" 1>&2
'development', 'edge', 'beta', 'release', and 'candidate'" 1>&2
exit 1
;;
esac
Expand Down
31 changes: 28 additions & 3 deletions scripts/make/version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ bump_minor='/^v[0-9]+\.[0-9]+\.0$/ {
}
{
printf("invalid release version: \"%s\"\n", $0);
printf("invalid minor release version: \"%s\"\n", $0);
exit 1;
}'
Expand Down Expand Up @@ -128,15 +128,40 @@ in

version="$last_tag"
;;
('candidate')
# This pseudo-channel is used to set a proper versions into release
# candidate builds.

# last_tag is expected to be the latest release tag.
last_tag="$( git describe --abbrev=0 )"
readonly last_tag

# current_branch is the name of the branch currently checked out.
current_branch="$( git rev-parse --abbrev-ref HEAD )"
readonly current_branch

# The branch should be named like:
#
# rc-v12.34.56
#
if ! echo "$current_branch" | grep -E -e '^rc-v[0-9]+\.[0-9]+\.[0-9]+$' -q
then
echo "invalid release candidate branch name '$current_branch'" 1>&2

exit 1
fi

version="${current_branch#rc-}-rc.$( git rev-list --count "$last_tag"..HEAD )"
;;
(*)
echo "invalid channel '$channel', supported values are\
'development', 'edge', 'beta', and 'release'" 1>&2
'development', 'edge', 'beta', 'release' and 'candidate'" 1>&2
exit 1
;;
esac

# Finally, make sure that we don't output invalid versions.
if ! echo "$version" | grep -E -e '^v[0-9]+\.[0-9]+\.[0-9]+(-(a|b|dev)\.[0-9]+)?(\+[[:xdigit:]]+)?$' -q
if ! echo "$version" | grep -E -e '^v[0-9]+\.[0-9]+\.[0-9]+(-(a|b|dev|rc)\.[0-9]+)?(\+[[:xdigit:]]+)?$' -q
then
echo "generated an invalid version '$version'" 1>&2

Expand Down

0 comments on commit bd99e3e

Please sign in to comment.