Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions bin/sign_deb

This file was deleted.

15 changes: 0 additions & 15 deletions bin/sign_rpm

This file was deleted.

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

copy_to() {
echo -e "Copy $1 to /mnt/repo_storage/manticoresearch_$2";
cp "$1" "/mnt/repo_storage/manticoresearch_$2" && echo -e "Success"
echo
}

get_destination() {
if [ -z "${IS_RELEASE_DIGIT}" ]; then
IS_RELEASE_DIGIT="$(echo "$f" | cut -d. -f3 | cut -d- -f1)"
Expand All @@ -22,19 +16,19 @@ echo "Collected archives"
ls -1 build/

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

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

rm -rf build/*.zip
rm -rf build/*.exe
rm -rf build/*.gz
rm -rf build/*.{zip,gz,exe}
41 changes: 14 additions & 27 deletions bin/upload_repo_deb
Original file line number Diff line number Diff line change
Expand Up @@ -6,60 +6,47 @@ echo "Uploading $DISTRO"
echo "Collected debian packages in build/"
ls -1 build/

copy_to() {
echo -e "Copy $1 to /mnt/repo_storage/manticoresearch_$DISTRO$SUFFIX/dists/$2";
cp "$1" "/mnt/repo_storage/manticoresearch_$DISTRO$SUFFIX/dists/$2" && echo -e "Success"
echo
}

# bundleamd=0
# bundlearm=0
declare -A archs

for f in build/*deb; do
# VER="$(echo "$f" | cut -d_ -f2)"

packageName="$(basename "$f")"

ARCH=$(echo "$f" | cut -d_ -f3 | cut -d. -f1)
echo "Arch: $ARCH"
declare -A archs

if [ -f "$f" ]; then
if [ -z "${IS_RELEASE_DIGIT}" ]; then
if [ -z "$IS_RELEASE_DIGIT" ]; then
IS_RELEASE_DIGIT=$(echo "$f" | cut -d. -f3 | cut -d- -f1)
if [[ $((IS_RELEASE_DIGIT % 2)) -ne 0 ]]; then
SUFFIX="_dev"
TARGET="dev"
else
TARGET="release"
fi
fi

./bin/sign_deb "$GPG_SECRET" "$f"

if [[ $ARCH == "amd64" ]]; then
archs[amd]=1
copy_to "$f" "$DISTRO/main/binary-amd64/"
# bundleamd=1
/usr/bin/docker exec -i repo-generator /generator.sh --distro "$DISTRO" --architecture amd --target "$TARGET" --name "$packageName" --not-index < "$f"
fi

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

if [[ $ARCH == "all" ]]; then
copy_to "$f" "$DISTRO/main/binary-amd64/"
copy_to "$f" "$DISTRO/main/binary-arm64/"
/usr/bin/docker exec -i repo-generator /generator.sh --distro "$DISTRO" --architecture amd --target "$TARGET" --name "$packageName" --not-index < "$f"
/usr/bin/docker exec -i repo-generator /generator.sh --distro "$DISTRO" --architecture arm --target "$TARGET" --name "$packageName" --not-index < "$f"
archs[amd]=1
archs[arm]=1
fi
fi
done

# no need to make bundle as we deploy one single package

dev=
if [ -n "$SUFFIX" ]; then
dev="-dev 1"
fi

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

rm -rf build/*deb
38 changes: 14 additions & 24 deletions bin/upload_repo_rpm
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,14 @@ echo "Uploading $DISTRO"
echo "Collected rpm packages"
ls -1 build/

copy_to() {
echo -e "Copy $1 to /mnt/repo_storage/manticoresearch/$DESTINATION/centos/$DISTRO/$2";
cp "$1" "/mnt/repo_storage/manticoresearch/$DESTINATION/centos/$DISTRO/$2" && echo -e "Success"
echo -e "\n"
}

# bundleaarch=0
# bundleintel=0
declare -A archs

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

echo "file $f"
tail=$(echo "$f" | sed 's_build/__g;s/[a-z]*-//g;')
# VER=$(echo "$tail" | cut -d. -f1,2,3,4,5)
if [[ $tail == *".x86_64."* ]]; then
ARCH=x86_64
elif [[ $tail == *".aarch64."* ]]; then
Expand All @@ -28,6 +22,7 @@ for f in build/*."el$DISTRO".{x86_64,aarch64,noarch}.rpm; do
ARCH=noarch
fi
echo "Arch: $ARCH"

if [ -f "$f" ]; then
if [ -z "${IS_RELEASE_DIGIT}" ]; then
IS_RELEASE_DIGIT=$(echo "$f" | cut -d. -f3 | cut -d_ -f1)
Expand All @@ -38,36 +33,31 @@ for f in build/*."el$DISTRO".{x86_64,aarch64,noarch}.rpm; do
fi
fi


FILENAME=$(basename "$f")
cp $f /work/repomanager/docker/rpm_signer/data/$DISTRO/$ARCH/$FILENAME
/usr/bin/docker exec rpm_signer /worker.sh $DISTRO $ARCH
mv /work/repomanager/docker/rpm_signer/data/$DISTRO/$ARCH/$FILENAME $f

packageName="$(basename "$f")"
if [[ $ARCH == "x86_64" ]]; then
copy_to "$f" x86_64/
# bundleintel=1
/usr/bin/docker exec -i repo-generator /generator.sh -n "$packageName" -d centos -v "$DISTRO" -t "$DESTINATION" -a x86_64 --not-index < "$f"
archs[x86_64]=1
fi

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

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

fi
done

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

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

rm -rf build/*.rpm