#!/usr/bin/env bash # Copyright 2014, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Notes: # To use this script you MUST move it to some path that will be called. # I recommend that the script be stored and executed from # "/opt/rpc-wheel-builder.sh". This script is a wrapper script that relies # on the "rpc-wheel-builder.py" and is execute from # "/opt/rpc-wheel-builder.py". # Overrides: # This script has several things that can be overriden via environment # variables. # Git repository that the rcbops ansible lxc source code will be cloned from. # This repo should be a repo that is available via HTTP. # GIT_REPO="" # The URI for the github api. This is ONLY used when the $RELEASES variable # is an empty string. Which causes the script to go discover the available # releases. # GITHUB_API_ENDPOINT="" # Local directory to store the source code while interacting with it. # WORK_DIR="" # Local directory to store the built wheels. # OUTPUT_WHEEL_PATH="" # Local directory to store known git repos. # OUTPUT_GIT_PATH="" # Space seperated list of all releases to build for. If unset the releases # will be discovered. # RELEASES="" # Space seperated list of all releases to exclude from building. This is # ONLY used when the $RELEASES variable is an empty string. # EXCLUDE_RELEASES="" set -e -o -v # Ensure there is a base path loaded export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" # Defined variables GIT_REPO="${GIT_REPO:-https://github.com/stackforge/os-ansible-deployment}" GITHUB_API_ENDPOINT="${GITHUB_API_ENDPOINT:-https://api.github.com/repos/stackforge/os-ansible-deployment}" WORK_DIR="${WORK_DIR:-/opt/ansible-lxc-rpc}" REPO_PACKAGES_PATH="${WORK_DIR}/rpc_deployment/vars/repo_packages/" OUTPUT_WHEEL_PATH="${OUTPUT_WHEEL_PATH:-/var/www/repo/python_packages}" OUTPUT_GIT_PATH="${OUTPUT_GIT_PATH:-/var/www/repo/rpcgit}" # Default is an empty string which causes the script to go discover the available # branches from the github API. RELEASES=${RELEASES:-""} EXCLUDE_RELEASES="${EXCLUDE_RELEASES:-v9.0.0 gh-pages revert}" if [[ ! "${RELEASES}" ]];then # From the GITHUB API pull a list of all branches/tags RELEASES=$( $(which python) <