Skip to content
This repository
branch: master
executable file 47 lines (33 sloc) 1.261 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
#!/bin/bash

# To update the version shipped in this quickstart, bump this variable:
#
install_version="3.8.1"

# Download and install Wordpress

install_dir=${OPENSHIFT_BUILD_DEPENDENCIES_DIR}${install_version}

# Used in this script only
current_version_dir=${OPENSHIFT_DATA_DIR}current

#
# If WordPress is already installed in the current gear, there
# is nothing to build :-)
#
[ -d "${current_version_dir}" ] && exit 0

mkdir -p $install_dir

pushd ${install_dir} >/dev/null
curl -s http://wordpress.org/wordpress-${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 -s http://wordpress.org/wordpress-${install_version}.tar.gz.md5)

if [ "${tarball_md5}" != "${wordpress_md5}" ]; then
echo "ERROR: Wordpress ${install_version} MD5 checksum mismatch."
  exit 1;
fi

# 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

# Copy the OpenShift wp-config.php file
#
cp -f ${OPENSHIFT_REPO_DIR}.openshift/config/wp-config.php ${install_dir}/wp-config.php

Something went wrong with that request. Please try again.