Skip to content

Instantly share code, notes, and snippets.

@markllama
Created March 22, 2013 15:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markllama/5222366 to your computer and use it in GitHub Desktop.
Save markllama/5222366 to your computer and use it in GitHub Desktop.
Add and tweak Yum repositories for a custom OpenShift Origin broker installation.
#!/bin/sh
#
# Create yum repo files before installation
# Also tune fedora repos to avoid conflicts
#
#
# usage: sh ./oo-add-repos.sh <ORIGIN_SERVER_BASEURL>
#
# SUDO=echo sh.... if you want
SUDO=${SUDO:="sudo"}
ORIGIN_SERVER_BASEURL=$1
ORIGIN_EXTRAS_BASEURL=${ORIGIN_EXTRAS_BASEURL:=https://mirror.openshift.com/pub/openshift-origin/fedora-18/x86_64/}
#
# add a yum repo file for origin server
#
function enable_origin_server_repo() {
# ORIGIN_SERVER_BASEURL=$1
#
# Add local build repo
#
echo "Creating origin-server repo file"
cat <<EOF >/tmp/origin-server.repo-$$
[origin-server]
name=OpenShift Origin Server
baseurl=${1}
enable=1
gpgcheck=0
EOF
${SUDO} mv /tmp/origin-server.repo-$$ /etc/yum.repos.d/origin-server.repo
}
#
# Add a yum repo file for origin extras
#
function enable_origin_extras_repo() {
# ORIGIN_EXTRAS_BASEURL=$1
#
# Add repo for packages awaiting upstream integration
#
echo "Creating origin-extras repo file"
cat <<EOF >/tmp/origin-extras.repo-$$
[origin-extras]
name=Custom packages for OpenShift Origin Server
baseurl=${1}
enable=1
gpgcheck=0
EOF
${SUDO} mv /tmp/origin-extras.repo-$$ /etc/yum.repos.d/origin-extras.repo
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment