Skip to content

Instantly share code, notes, and snippets.

@jfrancoa
Last active February 7, 2019 09:28
Show Gist options
  • Save jfrancoa/6bd59f19730797dab21ed7e0f5b654bb to your computer and use it in GitHub Desktop.
Save jfrancoa/6bd59f19730797dab21ed7e0f5b654bb to your computer and use it in GitHub Desktop.
build-rpm-delorean
#!/bin/bash
#USE: ./build_rpm.sh tripleo-heat-templates refs/changes/54/628154/7
# Parameters:
# - $1=repository name (without the openstack/ part)
# - $2=refs for the gerrit patch
REPO=$1
REFS=$2
set -eu
set -o pipefail
mkdir -p ~/tripleo
cd ~/tripleo
sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum install -y mock redhat-rpm-config rpmdevtools httpd libffi-devel \
openssl-devel yum-utils
[ -d ~/tripleo/${REPO} ] || git clone https://github.com/openstack/${REPO}.git ~/tripleo/${REPO}
cd ${REPO}
git fetch https://git.openstack.org/openstack/${REPO} ${REFS} && git checkout FETCH_HEAD
cd ~/tripleo
[ -d ~/tripleo/tripleo-ci ] || git clone https://github.com/openstack-infra/tripleo-ci.git ~/tripleo/tripleo-ci
./tripleo-ci/scripts/tripleo.sh --delorean-setup
if ! [ -x "$(command -v rdopkg)" ]; then
sudo yum install -y rdopkg
fi
sudo yum remove -y epel-release
[ -e /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 ] || sudo curl https://www.centos.org/keys/RPM-GPG-KEY-CentOS-7 -o /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
./tripleo-ci/scripts/tripleo.sh --delorean-build openstack/${REPO}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment