Skip to content

Commit 4e52985

Browse files
committed
Merge branch 'develop'
2 parents ddb2eb4 + f536917 commit 4e52985

3 files changed

Lines changed: 20 additions & 41 deletions

File tree

automated_packaging/prepare_release.pl

Lines changed: 14 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ sub cherry_pick_commits {
7575
# Update the version on the configuration file
7676
`sed -i 's/$current_version_escape_dot/$UPCOMING_VERSION/g' configure.in`;
7777

78+
# Update the version on the config.py file (for upgrade tests)
79+
`sed -i 's/$minor_version_escape_dot/$upcoming_minor_version/g' ./src/test/regress/upgrade/config.py`;
80+
7881
# Run autoconf to generate new configure file
7982
`autoconf -f`;
8083

@@ -84,54 +87,26 @@ sub cherry_pick_commits {
8487
# We also need to update two different lines on the multi_extension.out
8588
`sed -i 's/Loaded library requires $minor_version/Loaded library requires $upcoming_minor_version/g' ./src/test/regress/expected/multi_extension.out`;
8689

87-
# Update the Makefile
88-
open(MAKEFILE, "<./src/backend/distributed/Makefile" ) || die "Makefile not found";
89-
my @makefile_lines = <MAKEFILE>;
90-
close(MAKEFILE);
91-
92-
my @newlines;
93-
$last_version = "";
94-
foreach $line (@makefile_lines) {
95-
$line_copy = $line;
96-
97-
$line_copy =~ s/^\s+//;
98-
if ( $line_copy =~ /^$minor_version.*/ ) {
99-
$line_copy =~ s/\R\z//;
100-
@line_parts = split( / /, $line_copy );
101-
$last_version = @line_parts[-1];
102-
$line_copy = " " . $line_copy . " \\" . "\n $upcoming_minor_version-1\n";
103-
$line = $line_copy;
104-
}
105-
106-
if ( $line_copy =~ /NO_PGXS/ ) {
107-
pop(@newlines);
108-
$new_extension_line = "\$(EXTENSION)--$upcoming_minor_version-1.sql: \$(EXTENSION)--$last_version.sql \$(EXTENSION)--$last_version--$upcoming_minor_version-1.sql\n";
109-
push(@newlines, $new_extension_line);
110-
$cat_line = " cat \$^ > \$\@\n";
111-
push(@newlines, $cat_line);
112-
$empty_line = "\n";
113-
push(@newlines, $empty_line);
114-
}
115-
116-
push( @newlines, $line );
117-
}
90+
my $current_schema_version = `awk -F' += +' -v property=default_version '\$1 ~ property {print \$2}' "./src/backend/distributed/citus.control"`;
91+
# trim output of awk (remove quotes and newline)
92+
$current_schema_version = substr($current_schema_version, 1, -2);
11893

119-
open(MAKEFILE, ">./src/backend/distributed/Makefile" ) || die "Makefile not found";
120-
print MAKEFILE @newlines;
121-
close(MAKEFILE);
94+
# We need to append new lines to test files for migrating to new schema version
95+
`sed -i "/^ALTER EXTENSION citus UPDATE TO '$current_schema_version';/a ALTER EXTENSION citus UPDATE TO '$upcoming_minor_version-1';" ./src/test/regress/sql/multi_extension.sql`;
96+
`sed -i "/^ALTER EXTENSION citus UPDATE TO '$current_schema_version';/a ALTER EXTENSION citus UPDATE TO '$upcoming_minor_version-1';" ./src/test/regress/expected/multi_extension.out`;
12297

12398
# Add a new sql file
124-
open( NEW_SQL_FILE, ">./src/backend/distributed/citus--$last_version--$upcoming_minor_version-1.sql") || die "New SQL file couldn't created";
125-
print NEW_SQL_FILE "/* citus--$last_version--$upcoming_minor_version-1 */"
99+
open( NEW_SQL_FILE, ">./src/backend/distributed/citus--$current_schema_version--$upcoming_minor_version-1.sql") || die "New SQL file couldn't created";
100+
print NEW_SQL_FILE "/* citus--$current_schema_version--$upcoming_minor_version-1 */"
126101
. "\n\n"
127-
. "/* bump version to $upcoming_minor_version-1 */" . "\n\n";
102+
. "-- bump version to $upcoming_minor_version-1" . "\n\n";
128103
close(NEW_SQL_FILE);
129104

130105
# Update citus.control file
131-
`sed -i 's/$last_version/$upcoming_minor_version-1/g' ./src/backend/distributed/citus.control`;
106+
`sed -i 's/$current_schema_version/$upcoming_minor_version-1/g' ./src/backend/distributed/citus.control`;
132107

133108
# Push the changes to the master branch
134-
`git add ./src/backend/distributed/citus--$last_version--$upcoming_minor_version-1.sql`;
109+
`git add ./src/backend/distributed/citus--$current_schema_version--$upcoming_minor_version-1.sql`;
135110
`git commit -a -m "Bump $PROJECT version to $UPCOMING_VERSION"`;
136111
`git push origin master-update-version-$curTime`;
137112
`curl -g -H "Accept: application/vnd.github.v3.full+json" -X POST --user "$github_token:x-oauth-basic" -d '{\"title\":\"Bump Citus to $UPCOMING_VERSION\", \"base\":\"master\", \"head\":\"master-update-version-$curTime"}' https://api.github.com/repos/citusdata/$PROJECT/pulls`;

packaging/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
## Usage
1212

13-
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, build a `citus` nightly on CentOS 7, Debian Jessie and Ubuntu Xenial like so: `citus_package -p el/7 -p debian/jessie -p ubuntu/xenial citus nightly`
13+
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:
14+
15+
`citus_package -p debian/jessie -p ubuntu/xenial local release`
1416

1517
[1]: https://www.docker.com

packaging/citus_package

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ my %supported_platforms = (
2929
el => [ "8", "7", "6" ],
3030
fedora => [ "28", "27", "26"],
3131
ol => [ "8", "7", "6" ],
32-
ubuntu => [ "bionic", "xenial", "trusty" ],
32+
ubuntu => [ "focal", "bionic", "xenial", "trusty" ],
3333
pgxn => [""]
3434
);
3535

@@ -524,6 +524,8 @@ to sign packages.
524524
525525
=item I<ol/6> Oracle Linux 6.0
526526
527+
=item I<ubuntu/focal> Ubuntu 20.04 LTS (Focal Fossa)
528+
527529
=item I<ubuntu/bionic> Ubuntu 18.04 LTS (Bionic Beaver)
528530
529531
=item I<ubuntu/xenial> Ubuntu 16.04 LTS (Xenial Xerus)

0 commit comments

Comments
 (0)