Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 50 lines (39 sloc) 1.69 KB
# To force a specific version of WordPress, set this variable:
# install_version="4.1"
# Used in this script only
# If WordPress is already installed in the current gear, there
# is nothing to build :-)
[ -d "${current_version_dir}" ] && exit 0
# Download the latest stable version if no install_version specified,
# as long as the latest version is upgrade-compatible:
if [ -z "$install_version" ]; then
install_version=$(curl -s "" | python -c 'import sys, json; latest = json.load(sys.stdin)["offers"][0]; print latest["version"] if latest["response"] == "upgrade" else "4.1"')
# Download and install WordPress
mkdir -p $install_dir
pushd ${install_dir} >/dev/null
curl -Ls${install_version}.tar.gz > wordpress-${install_version}.tar.gz
# Verify the sources
tarball_md5=$(md5sum wordpress-${install_version}.tar.gz | cut -d ' ' -f 1)
wordpress_md5=$(curl -Ls${install_version}.tar.gz.md5)
if [ "${tarball_md5}" != "${wordpress_md5}" ]; then
echo "ERROR: WordPress ${install_version} MD5 checksum mismatch. The wordpress tar file that was downloaded does not match the signature that it should have. Assure that the right tar file and checksum are being acquired by the .openshift/action_hooks/build file."
exit 1;
# Install WordPress
tar --strip-components=1 -xzf wordpress-${install_version}.tar.gz
rm -rf wordpress-${install_version}.tar.gz
echo $install_version > ${OPENSHIFT_BUILD_DEPENDENCIES_DIR}.current_version
popd >/dev/null
Something went wrong with that request. Please try again.