Files
scylladb/scripts/scylla_current_repo
Takuya ASADA f9b0a29def dist/ami: setup correct repository when --localrpm specified
There was no way to setup correct repo when AMI is building by --localrpm option, since AMI does not have access to 'version' file, and we don't passed repo URL to the AMI.
So detect optimal repo path when starting build AMI, passes repo URL to the AMI, setup it correctly.

Note: this changes behavor of build_ami.sh/scylla_install_pkg's --repo option.
It was repository URL, but now become .repo/.list file URL.
This is optimal for the distribution which requires 3rdparty packages to install scylla, like CentOS7.
Existing shell scripts which invoking build_ami.sh are need to change in new way, such as our Jenkins jobs.

Fixes #1414

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1469636377-17828-1-git-send-email-syuu@scylladb.com>
(cherry picked from commit d3746298ae)
2016-08-05 09:45:22 +03:00

38 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
VERSION=$(./SCYLLA-VERSION-GEN)
SCYLLA_VERSION=$(cat build/SCYLLA-VERSION-FILE)
SCYLLA_RELEASE=$(cat build/SCYLLA-RELEASE-FILE)
. /etc/os-release
if [ "$SCYLLA_VERSION" = "666.development" ]; then
if [ "$ID" = "ubuntu" ]; then
CODENAME=`lsb_release -c|awk '{print $2}'`
if [ "$CODENAME" = "trusty" ]; then
CODENAME=ubuntu
fi
echo https://downloads.scylladb.com/deb/unstable/$CODENAME/master/latest/scylla.list
elif [ "$ID" = "centos" ]; then
echo https://downloads.scylladb.com/rpm/unstable/centos/master/latest/scylla.repo
elif [ "$ID" = "fedora" ]; then
echo https://downloads.scylladb.com/rpm/unstable/fedora/master/latest/scylla.repo
else
echo "Unsupported distribution."
exit 1
fi
else
REPO_VERSION=$(echo $SCYLLA_VERSION |sed -e "s/^\([0-9]*\.[0-9]*\).*/\1/")
if [ "$ID" = "ubuntu" ]; then
CODENAME=`lsb_release -c|awk '{print $2}'`
echo http://downloads.scylladb.com/deb/ubuntu/scylla-$REPO_VERSION-$CODENAME.list
elif [ "$ID" = "centos" ]; then
echo http://downloads.scylladb.com/rpm/centos/scylla-$REPO_VERSION.repo
elif [ "$ID" = "fedora" ]; then
echo http://downloads.scylladb.com/rpm/fedora/scylla-$REPO_VERSION.repo
else
echo "Unsupported distribution."
exit 1
fi
fi