Skip to content
Menu
Billy Fisher
  • Home
  • Talks
  • About Me
  • Resume
Billy Fisher

Establish the WordPress Directory Structure

Posted on November 8, 2020November 14, 2020 by Billy

And now that we’ve parameterized the arguments, we’ll want to focus on a repeatable process for building the Elastic Beanstalk source bundle.

Establish the wordpress directory from the latest sources available:

def establish_wordpress_dir():
    script_dir = os.path.dirname(os.path.realpath(__file__))

    if not os.path.exists('{0}/wordpress'.format(script_dir)):
        print("Could not find wordpress directory, downloading latest ...")
        local_filename, headers = urllib.request.urlretrieve('https://www.wordpress.org/latest.zip')
        with ZipFile(local_filename) as zip:
            zip.extractall()  # Establish wordpress dir

        zip_filename = headers.get('Content-Disposition').split('=')[-1]

        os.rename(local_filename,
                  '{0}/{1}'.format(script_dir, zip_filename))

💡 Reviewing the following was helpful while updating the code to Python 3: https://docs.python.org/3.8/library/zipfile.html.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

− 5 = 4

Categories

  • Building the Elasticbeanstalk Source Bundle
  • Cloud Computing
  • Coding
  • Computing
  • Going Serverless on Wordpress for AWS
  • Uncategorized

This Site Hosted On

Amazon Web Services: ElasticBeanstalk, RDS, and EFS. Really enjoying just focusing in on the content and having ElasticBeanstalk, and the package build process, perform all of the LAMP and Wordpress updates, automatically. Using aws blueprint: aws_blueprint_ebs_wordpress_efs_rds

My Github Projects

  • api-gateway-custom-authorizers
  • async-http-client-gradle-scala
  • async-http-client-sbt-scala
  • aws-serverless-express
  • aws_api_gateway_http_proxy_redirect_rewrite
  • aws_blueprint_ebs_wordpress_efs_rds
  • aws_lambda_scala_ec2_reports
  • aws_serverless_application_model_python
  • bike-distributor-refactor
  • CRUDUsers
  • digital-ocean-jenkins-dev-environment
  • java-functional-tests
  • java9-hello-modules
  • kind-argo
  • nbbo
©2023 Billy Fisher | Theme: Wordly by SuperbThemes