10up / wpsnapshots

(DEPRECATED) A project sharing tool for WordPress.
MIT License
215 stars 22 forks source link

Feature/arm #92

Open dustinrue opened 2 years ago

dustinrue commented 2 years ago

Description of the Change

This PR modifies the Dockerfile and build routines (actions) to:

Alternate Designs

Benefits

Full native speed for Apple M1

Possible Drawbacks

Verification Process

I'm unable to fully test this

Checklist:

Applicable Issues

Changelog Entry

dustinrue commented 2 years ago

To test this you would need to update the images value in wp-local-docker to ensure this image, where ever it lives, it used. I have a test version of this at https://hub.docker.com/repository/docker/dustinrue/wp-snapshots

NicktheGeek commented 2 years ago

I was able to test this and it solves a couple of important problems.

  1. PHP 7.3 fails during export when encountering code in the site that is built for php 7.4+
  2. M1 chips throw a non failing error but are subject to performance issues

This is the process I used to test.

  1. Delete my local snapshot docker image
  2. Clone the repo and checkout the branch
  3. Modified the docker file with apt-get update && as noted in this comment https://github.com/10up/wpsnapshots/pull/92#discussion_r881725070
  4. Built and tagged as 10up/wpsnaphots:latest so I could use that image with this command docker build -t 10up/wpsnapshots:latest . --build-arg WPSNAPSHOTS_ARCHIVE="https://github.com/10up/wpsnapshots/archive/refs/tags/2.2.1.tar.gz"
  5. Ran snapshots on a site that was failing due to php 7.4 code

This worked for me and I think this should be merged and deployed once the apt-get update part is added so it will build successfully. Until then, I'll be writing instructions for my team to update their local image to a working version.

As a side note, might be a good idea to have multiple versions tagged for php version so that projects using php 8 and even php 8.1 can work correctly. This would require an update for 10up local docker so the php version of the project affects the version used to run snapshots.