Skip to content

Commit 5b50c1a

Browse files
authored
Merge pull request #28 from manticoresoftware/switch_to_new_repomanager
CI switch to new repo manager
2 parents c48e2c3 + 48178f9 commit 5b50c1a

File tree

5 files changed

+33
-91
lines changed

5 files changed

+33
-91
lines changed

bin/sign_deb

Lines changed: 0 additions & 14 deletions
This file was deleted.

bin/sign_rpm

Lines changed: 0 additions & 15 deletions
This file was deleted.

bin/upload_repo_arc

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
#!/usr/bin/env bash
22
# That file here is for reference; actually used the one stored on the host to avoid checkout of the whole code
33

4-
copy_to() {
5-
echo -e "Copy $1 to /mnt/repo_storage/manticoresearch_$2";
6-
cp "$1" "/mnt/repo_storage/manticoresearch_$2" && echo -e "Success"
7-
echo
8-
}
9-
104
get_destination() {
115
if [ -z "${IS_RELEASE_DIGIT}" ]; then
126
IS_RELEASE_DIGIT="$(echo "$f" | cut -d. -f3 | cut -d- -f1)"
@@ -22,19 +16,19 @@ echo "Collected archives"
2216
ls -1 build/
2317

2418
for f in build/*.zip build/*.exe; do
19+
packageName="$(basename $f)"
2520
if [ -f "$f" ]; then
2621
get_destination
27-
copy_to "$f" windows/$DESTINATION/x64/
22+
/usr/bin/docker exec -i repo-generator /generator.sh --path "/repository/manticoresearch_windows/$DESTINATION/x64/" --name "$packageName" --not-index --skip-signing < "$f"
2823
fi
2924
done
3025

3126
for f in build/*.gz; do
27+
packageName="$(basename $f)"
3228
if [ -f "$f" ]; then
3329
get_destination
34-
copy_to "$f" macos/$DESTINATION/
30+
/usr/bin/docker exec -i repo-generator /generator.sh --path "/repository/manticoresearch_macos/$DESTINATION/" --name "$packageName" --not-index --skip-signing < "$f"
3531
fi
3632
done
3733

38-
rm -rf build/*.zip
39-
rm -rf build/*.exe
40-
rm -rf build/*.gz
34+
rm -rf build/*.{zip,gz,exe}

bin/upload_repo_deb

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,60 +6,47 @@ echo "Uploading $DISTRO"
66
echo "Collected debian packages in build/"
77
ls -1 build/
88

9-
copy_to() {
10-
echo -e "Copy $1 to /mnt/repo_storage/manticoresearch_$DISTRO$SUFFIX/dists/$2";
11-
cp "$1" "/mnt/repo_storage/manticoresearch_$DISTRO$SUFFIX/dists/$2" && echo -e "Success"
12-
echo
13-
}
14-
15-
# bundleamd=0
16-
# bundlearm=0
9+
declare -A archs
1710

1811
for f in build/*deb; do
19-
# VER="$(echo "$f" | cut -d_ -f2)"
12+
13+
packageName="$(basename "$f")"
14+
2015
ARCH=$(echo "$f" | cut -d_ -f3 | cut -d. -f1)
2116
echo "Arch: $ARCH"
22-
declare -A archs
17+
2318
if [ -f "$f" ]; then
24-
if [ -z "${IS_RELEASE_DIGIT}" ]; then
19+
if [ -z "$IS_RELEASE_DIGIT" ]; then
2520
IS_RELEASE_DIGIT=$(echo "$f" | cut -d. -f3 | cut -d- -f1)
2621
if [[ $((IS_RELEASE_DIGIT % 2)) -ne 0 ]]; then
27-
SUFFIX="_dev"
22+
TARGET="dev"
23+
else
24+
TARGET="release"
2825
fi
2926
fi
3027

31-
./bin/sign_deb "$GPG_SECRET" "$f"
32-
3328
if [[ $ARCH == "amd64" ]]; then
3429
archs[amd]=1
35-
copy_to "$f" "$DISTRO/main/binary-amd64/"
36-
# bundleamd=1
30+
/usr/bin/docker exec -i repo-generator /generator.sh --distro "$DISTRO" --architecture amd --target "$TARGET" --name "$packageName" --not-index < "$f"
3731
fi
3832

3933
if [[ $ARCH == "arm64" ]]; then
4034
archs[arm]=1
41-
copy_to "$f" "$DISTRO/main/binary-arm64/"
42-
# bundlearm=1
35+
/usr/bin/docker exec -i repo-generator /generator.sh --distro "$DISTRO" --architecture arm --target "$TARGET" --name "$packageName" --not-index < "$f"
4336
fi
4437

4538
if [[ $ARCH == "all" ]]; then
46-
copy_to "$f" "$DISTRO/main/binary-amd64/"
47-
copy_to "$f" "$DISTRO/main/binary-arm64/"
39+
/usr/bin/docker exec -i repo-generator /generator.sh --distro "$DISTRO" --architecture amd --target "$TARGET" --name "$packageName" --not-index < "$f"
40+
/usr/bin/docker exec -i repo-generator /generator.sh --distro "$DISTRO" --architecture arm --target "$TARGET" --name "$packageName" --not-index < "$f"
4841
archs[amd]=1
4942
archs[arm]=1
5043
fi
5144
fi
5245
done
5346

54-
# no need to make bundle as we deploy one single package
55-
56-
dev=
57-
if [ -n "$SUFFIX" ]; then
58-
dev="-dev 1"
59-
fi
6047

6148
for arch in "${!archs[@]}"; do
62-
/usr/bin/docker exec repo-generator /generator.sh -distro "$DISTRO" -architecture "$arch" $dev
49+
/usr/bin/docker exec -i repo-generator /generator.sh --distro "$DISTRO" --architecture "$arch" --target "$TARGET" --only-index
6350
done
6451

6552
rm -rf build/*deb

bin/upload_repo_rpm

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,14 @@ echo "Uploading $DISTRO"
66
echo "Collected rpm packages"
77
ls -1 build/
88

9-
copy_to() {
10-
echo -e "Copy $1 to /mnt/repo_storage/manticoresearch/$DESTINATION/centos/$DISTRO/$2";
11-
cp "$1" "/mnt/repo_storage/manticoresearch/$DESTINATION/centos/$DISTRO/$2" && echo -e "Success"
12-
echo -e "\n"
13-
}
14-
159
# bundleaarch=0
1610
# bundleintel=0
11+
declare -A archs
1712

1813
for f in build/*."el$DISTRO".{x86_64,aarch64,noarch}.rpm; do
1914

2015
echo "file $f"
2116
tail=$(echo "$f" | sed 's_build/__g;s/[a-z]*-//g;')
22-
# VER=$(echo "$tail" | cut -d. -f1,2,3,4,5)
2317
if [[ $tail == *".x86_64."* ]]; then
2418
ARCH=x86_64
2519
elif [[ $tail == *".aarch64."* ]]; then
@@ -28,6 +22,7 @@ for f in build/*."el$DISTRO".{x86_64,aarch64,noarch}.rpm; do
2822
ARCH=noarch
2923
fi
3024
echo "Arch: $ARCH"
25+
3126
if [ -f "$f" ]; then
3227
if [ -z "${IS_RELEASE_DIGIT}" ]; then
3328
IS_RELEASE_DIGIT=$(echo "$f" | cut -d. -f3 | cut -d_ -f1)
@@ -38,36 +33,31 @@ for f in build/*."el$DISTRO".{x86_64,aarch64,noarch}.rpm; do
3833
fi
3934
fi
4035

41-
42-
FILENAME=$(basename "$f")
43-
cp $f /work/repomanager/docker/rpm_signer/data/$DISTRO/$ARCH/$FILENAME
44-
/usr/bin/docker exec rpm_signer /worker.sh $DISTRO $ARCH
45-
mv /work/repomanager/docker/rpm_signer/data/$DISTRO/$ARCH/$FILENAME $f
46-
36+
packageName="$(basename "$f")"
4737
if [[ $ARCH == "x86_64" ]]; then
48-
copy_to "$f" x86_64/
49-
# bundleintel=1
38+
/usr/bin/docker exec -i repo-generator /generator.sh -n "$packageName" -d centos -v "$DISTRO" -t "$DESTINATION" -a x86_64 --not-index < "$f"
39+
archs[x86_64]=1
5040
fi
5141

5242
if [[ $ARCH == "aarch64" ]]; then
53-
copy_to "$f" aarch64/
54-
# bundleaarch=1
43+
/usr/bin/docker exec -i repo-generator /generator.sh -n "$packageName" -d centos -v "$DISTRO" -t "$DESTINATION" -a aarch64 --not-index < "$f"
44+
archs[aarch64]=1
5545
fi
5646

5747
if [[ $ARCH == "noarch" ]]; then
58-
copy_to "$f" x86_64/
59-
copy_to "$f" aarch64/
48+
/usr/bin/docker exec -i repo-generator /generator.sh -n "$packageName" -d centos -v "$DISTRO" -t "$DESTINATION" -a x86_64 --not-index < "$f"
49+
/usr/bin/docker exec -i repo-generator /generator.sh -n "$packageName" -d centos -v "$DISTRO" -t "$DESTINATION" -a aarch64 --not-index < "$f"
50+
archs[x86_64]=1
51+
archs[aarch64]=1
6052
fi
6153

6254
fi
6355
done
6456

6557
# no need to make bundle as we deploy one single package
58+
for arch in "${!archs[@]}"; do
59+
/usr/bin/docker exec -i repo-generator /generator.sh -d centos -v "$DISTRO" --architecture "$arch" --target "$DESTINATION" --only-index
60+
done
6661

67-
if [ "$DESTINATION" = "dev" ]; then
68-
/usr/bin/docker exec repo-generator /generator.sh -distro centos -version "$DISTRO" -dev 1
69-
else
70-
/usr/bin/docker exec repo-generator /generator.sh -distro centos -version "$DISTRO"
71-
fi
7262

7363
rm -rf build/*.rpm

0 commit comments

Comments
 (0)