Skip to content

Commit 24b6e3b

Browse files
committed
release: prepare v2.0.0
- Bump version to 2.0.0 - Update install script for ProxySQL/dbdeployer releases - Add architecture suffix to goreleaser archive names - Install script handles arm64 and uses checksums.txt format
1 parent 0a05c1a commit 24b6e3b

File tree

3 files changed

+28
-18
lines changed

3 files changed

+28
-18
lines changed

.goreleaser.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ builds:
1717
archives:
1818
- formats: ['tar.gz']
1919
name_template: >-
20-
{{ .ProjectName }}-{{ .Version }}.{{- if eq .Os "darwin" }}osx{{ else }}{{ .Os }}{{ end }}
20+
{{ .ProjectName }}-{{ .Version }}.{{- if eq .Os "darwin" }}osx{{ else }}{{ .Os }}{{ end }}_{{ .Arch }}
2121
2222
checksum:
2323
name_template: 'checksums.txt'

common/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.74.0
1+
2.0.0

scripts/dbdeployer-install.sh

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
# dbdeployer installer version 1.0.0 - Released 2020-12-29
17+
# dbdeployer installer version 2.0.0 - Updated 2026-03-24
1818
# Usage:
19-
# curl -s https://github.com/datacharmer/dbdeployer/master/scripts/dbdeployer-install.sh | bash
20-
# or
21-
# curl -L -s https://bit.ly/dbdeployer | bash
19+
# curl -s https://github.com/ProxySQL/dbdeployer/master/scripts/dbdeployer-install.sh | bash
2220

2321
# Quality set for bash scripts:
2422
# [set -e] fails on error
@@ -31,7 +29,7 @@ set -u
3129
set -o pipefail
3230

3331
# File containing latest version of dbdeployer
34-
version_file=https://github.com/datacharmer/dbdeployer/master/common/VERSION
32+
version_file=https://github.com/ProxySQL/dbdeployer/master/common/VERSION
3533

3634
# check_exit_code checks the return code of the previous command
3735
# exits the script if it is non-zero
@@ -92,6 +90,7 @@ then
9290
fi
9391

9492
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
93+
ARCH=$(uname -m)
9594

9695
# (STEP 4) checks the operating system
9796
# Only Linux and MacOS are recognized
@@ -101,29 +100,40 @@ then
101100
exit 1
102101
fi
103102

103+
# Normalize architecture
104+
case "$ARCH" in
105+
x86_64|amd64) ARCH=amd64 ;;
106+
aarch64|arm64) ARCH=arm64 ;;
107+
*)
108+
echo "Architecture '$ARCH' not supported"
109+
exit 1
110+
;;
111+
esac
112+
104113
# While "darwin" is what the system itself returns,
105114
# "osx" is the identifier in dbdeployer binaries
115+
OS_LABEL=$OS
106116
if [ "$OS" == "darwin" ]
107117
then
108-
OS=osx
118+
OS_LABEL=osx
109119
fi
110120

111121
# Base URL for dbdeployer downloads
112-
origin=https://github.com/datacharmer/dbdeployer/releases/download/v${dbdeployer_version}
122+
origin=https://github.com/ProxySQL/dbdeployer/releases/download/v${dbdeployer_version}
113123

114124
# Name of the archive we are looking for
115-
filename=dbdeployer-${dbdeployer_version}.${OS}.tar.gz
125+
filename=dbdeployer-${dbdeployer_version}.${OS_LABEL}_${ARCH}.tar.gz
116126

117-
# Name of the file containing the checksum
118-
checksum_file=${filename}.sha256
127+
# Name of the file containing the checksums
128+
checksum_file=checksums.txt
119129

120130
# Name of the executable inside the archive
121-
ultimate_file=dbdeployer-${dbdeployer_version}.${OS}
131+
ultimate_file=dbdeployer
122132

123133
# (STEP 5) Checks for already existing files.
124134
# If any of the files that we need to download exist already,
125135
# the program terminates
126-
for existing in $filename $checksum_file $ultimate_file
136+
for existing in $filename $checksum_file
127137
do
128138
if [ -f "$existing" ]
129139
then
@@ -156,9 +166,9 @@ then
156166
exit 1
157167
fi
158168

159-
# (STEP 10) probes the checksum
160-
shasum -c "${checksum_file}"
161-
check_exit_code "shasum -c $checksum_file"
169+
# (STEP 10) probes the checksum (extract the line for our file from checksums.txt)
170+
grep "$filename" "$checksum_file" | shasum -a 256 -c -
171+
check_exit_code "shasum -c for $filename"
162172

163173
# (STEP 11) unpacks the archive
164174
tar -xzf "$filename"
@@ -176,7 +186,7 @@ chmod +x "${ultimate_file}"
176186
check_exit_code "chmod +x ${ultimate_file}"
177187

178188
# (STEP 14) shows the downloaded files
179-
ls -lh "${ultimate_file}" "${checksum_file}" "${filename}"
189+
ls -lh "${ultimate_file}" "${filename}"
180190
target=""
181191

182192
# local_targets are the places where a non-privileged user could store the executable

0 commit comments

Comments
 (0)