Skip to content

Commit f5a1dd0

Browse files
authored
feat(server): add prepare release script (#1678)
1 parent ae4e3a6 commit f5a1dd0

File tree

4 files changed

+119
-2
lines changed

4 files changed

+119
-2
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ bench_*
88
/rust-clippy-results.sarif
99
/performance_results*
1010
.env
11+
/iggy_release
12+
/iggy_release_tmp

scripts/prepare-release.sh

+115
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
#!/bin/bash
2+
3+
#!/usr/bin/env bash
4+
5+
# Licensed to the Apache Software Foundation (ASF) under one
6+
# or more contributor license agreements. See the NOTICE file
7+
# distributed with this work for additional information
8+
# regarding copyright ownership. The ASF licenses this file
9+
# to you under the Apache License, Version 2.0 (the
10+
# "License"); you may not use this file except in compliance
11+
# with the License. You may obtain a copy of the License at
12+
#
13+
# http://www.apache.org/licenses/LICENSE-2.0
14+
#
15+
# Unless required by applicable law or agreed to in writing,
16+
# software distributed under the License is distributed on an
17+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18+
# KIND, either express or implied. See the License for the
19+
# specific language governing permissions and limitations
20+
# under the License.
21+
22+
# This script is used to generate Cross.toml file for user which executes
23+
# this script. This is needed since Cross.toml build.dockerfile.build-args
24+
# section requires statically defined Docker build arguments and parameters
25+
# like current UID or GID must be entered (cannot be generated or fetched
26+
# during cross execution time).
27+
28+
set -euo pipefail
29+
30+
# Determine tar command based on OS
31+
TAR_CMD="tar"
32+
OS_NAME=$(uname)
33+
34+
if [[ "$OS_NAME" == "Darwin" ]]; then
35+
if command -v gtar >/dev/null 2>&1; then
36+
TAR_CMD="gtar"
37+
else
38+
echo "❌ GNU tar (gtar) is required on macOS. Install it with: brew install gnu-tar"
39+
exit 1
40+
fi
41+
fi
42+
43+
if [ "$(basename "$PWD")" == "scripts" ]; then
44+
cd ..
45+
fi
46+
47+
SRC_DIR="./"
48+
RELEASE_DIR="iggy_release"
49+
TEMP_DIR="iggy_release_tmp"
50+
51+
rm -rf "$TEMP_DIR"
52+
rm -rf "$RELEASE_DIR"
53+
mkdir -p "$TEMP_DIR"
54+
mkdir -p "$RELEASE_DIR"
55+
56+
FILES=(
57+
"Cargo.lock"
58+
"Cargo.toml"
59+
"DEPENDENCIES.md"
60+
"DISCLAIMER"
61+
"Dockerfile"
62+
"LICENSE"
63+
"NOTICE"
64+
"docker-compose.yml"
65+
"justfile"
66+
)
67+
68+
DIRS=(
69+
"bench"
70+
"certs"
71+
"cli"
72+
"configs"
73+
"examples"
74+
"integration"
75+
"licenses"
76+
"scripts"
77+
"sdk"
78+
"server"
79+
"tools"
80+
)
81+
82+
for file in "${FILES[@]}"; do
83+
cp "$SRC_DIR/$file" "$TEMP_DIR/"
84+
done
85+
86+
for dir in "${DIRS[@]}"; do
87+
cp -r "$SRC_DIR/$dir" "$TEMP_DIR/"
88+
done
89+
90+
VERSION=$(grep '^version' "$TEMP_DIR/server/Cargo.toml" | head -n 1 | cut -d '"' -f2)
91+
92+
echo "Preparing release for version: $VERSION"
93+
94+
ARCHIVE_NAME="iggy-${VERSION}-incubating-src.tar.gz"
95+
96+
GZIP=-n "$TAR_CMD" --sort=name \
97+
--mtime='UTC 2020-01-01' \
98+
--owner=0 --group=0 --numeric-owner \
99+
-czf "$ARCHIVE_NAME" -C "$TEMP_DIR" .
100+
101+
CHECKSUM_FILE="${ARCHIVE_NAME}.sha512"
102+
sha512sum "$ARCHIVE_NAME" > "$CHECKSUM_FILE"
103+
104+
rm -rf "$TEMP_DIR"
105+
106+
echo "Release directory: $RELEASE_DIR"
107+
echo "SHA-512 checksum:"
108+
cat "$CHECKSUM_FILE"
109+
echo "✔ Archive created: $ARCHIVE_NAME"
110+
echo "✔ Checksum saved to: $CHECKSUM_FILE"
111+
112+
mv "$ARCHIVE_NAME" "$RELEASE_DIR/"
113+
mv "$CHECKSUM_FILE" "$RELEASE_DIR/"
114+
115+

sdk/src/topics/create_topic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use std::str::from_utf8;
3838
/// - `partitions_count` - number of partitions in the topic, max value is 1000.
3939
/// - `message_expiry` - message expiry, if `NeverExpire` then messages will never expire.
4040
/// - `max_topic_size` - maximum size of the topic, if `Unlimited` then topic size is unlimited.
41-
/// Can't be lower than segment size in the config.
41+
/// Can't be lower than segment size in the config.
4242
/// - `replication_factor` - replication factor for the topic.
4343
/// - `name` - unique topic name, max length is 255 characters.
4444
#[derive(Debug, Serialize, Deserialize, PartialEq)]

sdk/src/topics/update_topic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ use std::str::from_utf8;
3737
/// - `topic_id` - unique topic ID (numeric or name).
3838
/// - `message_expiry` - message expiry, if `NeverExpire` then messages will never expire.
3939
/// - `max_topic_size` - maximum size of the topic in bytes, if `Unlimited` then topic size is unlimited.
40-
/// Can't be lower than segment size in the config.
40+
/// Can't be lower than segment size in the config.
4141
/// - `replication_factor` - replication factor for the topic.
4242
/// - `name` - unique topic name, max length is 255 characters.
4343
#[derive(Debug, Serialize, Deserialize, PartialEq)]

0 commit comments

Comments
 (0)