Skip to content

Commit 92314b7

Browse files
committed
Merge branch 'develop'
2 parents 1bab1ce + 5555ed4 commit 92314b7

8 files changed

Lines changed: 66 additions & 32 deletions

File tree

automated_packaging/common_functions.pm

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,13 @@ sub create_release_changelog {
150150
foreach $line (@log_output) {
151151
if ($line =~ /^DESCRIPTION: */) {
152152
$description_part = substr($line, length($&), -1);
153+
153154
if (length($description_part) > 78) {
154-
print("You have to shorten PR message $description_part of $pr_url");
155-
`git reset --hard`;
156-
die "Can not add description longer than 78 charachters";
155+
print("You have to shorten PR message $description_part of $pr_url\n");
156+
print("Description should not be longer than 78 charachters, please manually shorten this description\n");
157+
push(@comment_lines, "TODO: " . "PLEASE SHORTEN THE NEXT LINE MANUALLY, IT SHOULD BE NO LONGER THAN 78 CHARS\n");
157158
}
159+
158160
print("Description $description_part has been added ... \n");
159161
push(@comment_lines, "* " . $description_part . "\n\n");
160162
}

automated_packaging/update_docker.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
$curTime = time();
1919

2020
# Checkout to the release's branch
21-
`git checkout develop`;
21+
`git checkout master`;
2222
`git checkout -b release-$VERSION-$curTime`;
2323

2424
# That means we want to update postgres version

automated_packaging/update_os_package.pl

Lines changed: 44 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,24 @@
99
# Name of the repo is represented differently on logs and repos
1010
my $github_repo_name = "citus";
1111
my $log_repo_name = "Citus";
12+
my $version_suffix = ".citus";
1213
if ( $PROJECT eq "enterprise" ) {
1314
$github_repo_name = "citus-enterprise";
1415
$log_repo_name = "Citus Enterprise";
1516
}
17+
my $package_name = $github_repo_name;
18+
if ( $PROJECT eq "pgautofailover" ) {
19+
$github_repo_name = "pg_auto_failover";
20+
$package_name = "pg-auto-failover";
21+
$log_repo_name = "pg_auto_failover";
22+
$version_suffix = "";
23+
}
24+
if ( $PROJECT eq "pgautofailover-enterprise" ) {
25+
$github_repo_name = "citus-ha";
26+
$package_name = "pg-auto-failover-enterprise";
27+
$log_repo_name = "pg_auto_failover enterprise";
28+
$version_suffix = "";
29+
}
1630

1731
my $github_token = get_and_verify_token();
1832

@@ -56,23 +70,25 @@ sub get_changelog_for_debian {
5670

5771
# Necessary to create unique branch
5872
$curTime = time();
73+
my $main_branch = "$DISTRO_VERSION-$PROJECT";
74+
my $pr_branch = "$DISTRO_VERSION-$PROJECT-$VERSION-push-$curTime";
5975

6076
# Checkout the distro's branch
61-
`git checkout $DISTRO_VERSION-$PROJECT`;
77+
`git checkout $main_branch`;
6278
# Update distro's branch
63-
`git pull origin $DISTRO_VERSION-$PROJECT`;
79+
`git pull origin $main_branch`;
6480

6581
# Create a new branch based on the distro's branch
66-
`git checkout -b $DISTRO_VERSION-$PROJECT-push-$curTime`;
82+
`git checkout -b $pr_branch`;
6783

6884
# Update pkgvars
69-
`sed -i 's/^pkglatest.*/pkglatest=$VERSION.citus-1/g' pkgvars`;
85+
`sed -i 's/^pkglatest.*/pkglatest=$VERSION$version_suffix-1/g' pkgvars`;
7086

7187
# Based on the repo, update the package related variables
7288
if ( $DISTRO_VERSION eq "redhat" || $DISTRO_VERSION eq "microsoft" || $DISTRO_VERSION eq "all") {
73-
`sed -i 's|^Version:.*|Version: $VERSION.citus|g' $github_repo_name.spec`;
74-
`sed -i 's|^Source0:.*|Source0: https:\/\/github.com\/citusdata\/$github_repo_name\/archive\/v$VERSION.tar.gz|g' $github_repo_name.spec`;
75-
`sed -i 's|^%changelog|%changelog\\n* $abbr_day[$wday] $abbr_mon[$mon] $mday $year - $git_name <$microsoft_email> $VERSION.citus-1\\n- Update to $log_repo_name $VERSION\\n|g' $github_repo_name.spec`;
89+
`sed -i 's|^Version:.*|Version: $VERSION$version_suffix|g' $package_name.spec`;
90+
`sed -i 's|^Source0:.*|Source0: https:\/\/github.com\/citusdata\/$package_name\/archive\/v$VERSION.tar.gz|g' $package_name.spec`;
91+
`sed -i 's|^%changelog|%changelog\\n* $abbr_day[$wday] $abbr_mon[$mon] $mday $year - $git_name <$microsoft_email> $VERSION$version_suffix-1\\n- Official $VERSION release of $log_repo_name\\n|g' $package_name.spec`;
7692
}
7793
if ( $DISTRO_VERSION eq "debian" || $DISTRO_VERSION eq "microsoft" || $DISTRO_VERSION eq "all") {
7894
open( DEB_CLOG_FILE, "<./debian/changelog" ) || die "Debian changelog file not found";
@@ -81,18 +97,33 @@ sub get_changelog_for_debian {
8197

8298
# Change hour and get changelog (TODO: may update it !)
8399
$print_hour = $hour - 3;
84-
@changelog_print = get_changelog_for_debian();
100+
if ($PROJECT eq 'citus' || $PROJECT eq 'enterprise') {
101+
@changelog_print = get_changelog_for_debian();
102+
}
103+
85104

86105
# Update the changelog file of the debian branch
87106
open( DEB_CLOG_FILE, ">./debian/changelog" ) || die "Debian changelog file not found";
88-
print DEB_CLOG_FILE "$github_repo_name ($VERSION.citus-1) stable; urgency=low\n";
89-
print DEB_CLOG_FILE @changelog_print;
107+
print DEB_CLOG_FILE "$package_name ($VERSION$version_suffix-1) stable; urgency=low\n";
108+
if ($PROJECT eq 'citus' || $PROJECT eq 'enterprise') {
109+
print DEB_CLOG_FILE @changelog_print;
110+
}
111+
else
112+
{
113+
print DEB_CLOG_FILE "\n * Official $VERSION release of $log_repo_name\n\n";
114+
}
90115
print DEB_CLOG_FILE " -- $git_name <$microsoft_email> $abbr_day[$wday], $mday $abbr_mon[$mon] $year $print_hour:$min:$sec +0000\n\n";
91116
print DEB_CLOG_FILE @lines;
92117
close(DEB_CLOG_FILE);
93118
}
94119

120+
121+
my $commit_message_distro_version = "$DISTRO_VERSION ";
122+
if ($DISTRO_VERSION eq "all") {
123+
$commit_message_distro_version = "";
124+
}
95125
# Commit, push changes and open a pull request
96-
`git commit -a -m "Bump $DISTRO_VERSION $log_repo_name $VERSION"`;
97-
`git push origin $DISTRO_VERSION-$PROJECT-push-$curTime`;
98-
`curl -g -H "Accept: application/vnd.github.v3.full+json" -X POST --user "$github_token:x-oauth-basic" -d '{\"title\":\"Bump $PROJECT $DISTRO_VERSION version to $VERSION\", \"head\":\"$DISTRO_VERSION-$PROJECT-push-$curTime\", \"base\":\"$DISTRO_VERSION-$PROJECT\"}' https://api.github.com/repos/citusdata/packaging/pulls`;
126+
my $commit_message = "Bump $commit_message_distro_version$log_repo_name version to $VERSION";
127+
`git commit -a -m "$commit_message"`;
128+
`git push origin $pr_branch`;
129+
`curl -g -H "Accept: application/vnd.github.v3.full+json" -X POST --user "$github_token:x-oauth-basic" -d '{\"title\":\"$commit_message\", \"head\":\"$pr_branch\", \"base\":\"$main_branch\"}' https://api.github.com/repos/citusdata/packaging/pulls`;

automated_packaging/update_pgxn.pl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,10 @@
2525

2626
# Update META.json file
2727
`sed -i 's/$old_version_escape_dot/$NEW_VERSION/g' META.json`;
28-
`sed -i 's/$old_minor_version-[[:digit:]]/$new_minor_version-$new_point_version/g' META.json`;
2928

3029
# Commit changes to github
31-
`git commit -a -m "Bump Citus to $NEW_VERSION"`;
30+
`git commit -a -m "Bump Citus PGXN to $NEW_VERSION"`;
3231
`git push origin pgxn-citus-push-$curTime`;
3332

3433
# Open a PR to the master
35-
`curl -g -H "Accept: application/vnd.github.v3.full+json" -X POST --user "$github_token:x-oauth-basic" -d '{\"title\":\"Bump Citus to $NEW_VERSION\", \"base\":\"pgxn-citus\", \"head\":\"pgxn-citus-push-$curTime\"}' https://api.github.com/repos/citusdata/packaging/pulls`;
34+
`curl -g -H "Accept: application/vnd.github.v3.full+json" -X POST --user "$github_token:x-oauth-basic" -d '{\"title\":\"Bump Citus PGXN to $NEW_VERSION\", \"base\":\"pgxn-citus\", \"head\":\"pgxn-citus-push-$curTime\"}' https://api.github.com/repos/citusdata/packaging/pulls`;

packaging/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
## Usage
1212

13+
First, please read `man citus_package`, we have a man page for it :)
14+
1315
Ensure your `GITHUB_TOKEN` environment variable is properly set (see the man page if you're not sure how to do that). Make sure Docker is running, then you're off to the races! For example, to build a `citus` community "release" on Debian Jessie and Ubuntu Xenial, first change your directory into "citusdata/packaging" repo directory and then checkout the `all-citus` (would be `all-enterprise` for enterprise) branch as this branch has the specific `pkgvars` for community packages. Then execute the following:
1416

1517
`citus_package -p debian/jessie -p ubuntu/xenial local release`

travis/install_custom_pg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ if [ "$(ls -A postgresql)" ]; then
1717
git -C postgresql pull
1818
else
1919
pgmajornum="${PGVERSION%%.*}"
20-
if [ "${pgmajornum}" -gt '12' ]; then
21-
# twelve is highest stable build; use master for higher
20+
if [ "${pgmajornum}" -gt '13' ]; then
21+
# 13 is highest stable build; use master for higher
2222
gitref="master"
2323
elif [ "${pgmajornum}" -gt '9' ]; then
2424
gitref="REL_${PGVERSION}_STABLE"

travis/setup_apt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7FCC7D46ACCC4CF8
1212
sudo rm -f /etc/apt/sources.list.d/google-chrome*
1313
sudo rm -f /etc/apt/sources.list.d/pgdg.list
1414

15-
# add the PostgreSQL 12 repository
16-
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main 12" >> /etc/apt/sources.list.d/postgresql.list'
15+
# add the PostgreSQL 13 repository
16+
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main 13" >> /etc/apt/sources.list.d/postgresql.list'
1717

18-
# need testing repository after version 12
19-
if [ "${PGVERSION%%.*}" -gt '12' ]; then
18+
# need testing repository after version 13
19+
if [ "${PGVERSION%%.*}" -gt '13' ]; then
2020
# add a PostgreSQL testing repository
2121
sudo sh -Ec 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg-testing main ${PGVERSION}" >> /etc/apt/sources.list.d/postgresql.list'
2222

uncrustify/Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ clean:
1818
rm -f *.1
1919

2020
installdirs:
21-
$(INSTALL) -d $(DESTDIR)$(bindir) $(DESTDIR)$(pkgsysconfdir) $(DESTDIR)$(mandir)/man1
21+
$(INSTALL) -d $(bindir) $(pkgsysconfdir) $(mandir)/man1
2222

2323
install: all installdirs
24-
$(INSTALL_SCRIPT) citus_indent $(DESTDIR)$(bindir)
25-
$(INSTALL_DATA) $(MANPAGES) $(DESTDIR)$(mandir)/man1
26-
$(INSTALL_DATA) citus-style.cfg $(DESTDIR)$(pkgsysconfdir)
24+
$(INSTALL_SCRIPT) citus_indent $(bindir)
25+
$(INSTALL_DATA) $(MANPAGES) $(mandir)/man1
26+
$(INSTALL_DATA) citus-style.cfg $(pkgsysconfdir)
2727
perl -pi -e 's,/usr/local/etc/citustools,$(pkgsysconfdir),g' \
28-
$(DESTDIR)$(bindir)/citus_indent \
29-
$(DESTDIR)$(mandir)/man1/citus_indent.1
28+
$(bindir)/citus_indent \
29+
$(mandir)/man1/citus_indent.1
3030

3131
.PHONY: all man clean installdirs install

0 commit comments

Comments
 (0)