New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Large refactor + improvements #97
Conversation
Have you had a chance to look through this @karellm? Any questions? |
@karellm Merging this monday if I don't hear back. Need the fixes on my sites. |
@dsifford I disagree about merging code that wasn't reviewed. I will take the time tomorrow to look at it (past few weeks have been quite busy for me). |
@karellm No problem. Take all the time you need. I just didn't hear back with even an acknowledgment of the PR so that's why I was opting to merge if I didn't hear back. I didn't know what your particular circumstances were or if you'd be able to review in a semi-timely fashion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, the project is a lot cleaner now. I added couple minor comments. I will also test it with a website tomorrow.
|
||
# start the website at localhost:8080 | ||
docker-compose up | ||
docker-compose up -d && docker-compose logs -f wordpress |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the motivation behind this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's how I start it. It allows you to watch build logs and know when exactly the build is finished, rather than just trying localhost:8080 a bunch of times until it works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't run a wordpress site in a while but I think docker-compose up
did output the logs for me. It is arguably more verbose though since it logs all services and not just wordpress
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the benefit to doing my way is that you get only the wordpress logs, as you stated, and also you can just ctrl-c after it's done building without it tearing down the application.
You can detach from a forground process by hitting ctrl-p followed by ctrl-q as well (I think), but that's too difficult to remember.
- [Part 3: Optimize your wordpress theme assets and deploy to S3](https://visible.vc/engineering/optimize-wordpress-theme-assets-and-deploy-to-s3-cloudfront/) | ||
- Part 4: Auto deploy your site on your server (coming) | ||
|
||
### Example |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Example section was removed altogether. Why is that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved it to its own ./example
directory to contain all of it there for those who need a complete example to look at.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My question wasn't clear. I think that there is value in the documentation. You might want to use this without relying on the example at all no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about moving the example details to a separate README.md file in the example directory? That way the info is still there for those who need it, but it clears up some of the noise from the main readme.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with that
package.json
Outdated
"accessKeyId": "", | ||
"secretAccessKey": "" | ||
} | ||
"update-version": "for file in './php7.0/Dockerfile' './php5.6/Dockerfile'; do sed -Ei \"s/(version=\\\")(.*)(-)/\\1$npm_package_version\\3/g\" \"$file\"; done && sed -Ei \"s/(wordpress:)(.*)(-)/\\1$npm_package_version\\3/g\" ./example/docker-compose.yml" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 I think you missed 7.1 though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, good catch. Adding 7.1 was an afterthought. I'll fix later this afternoon.
php5.6/Dockerfile
Outdated
# Set recommended PHP.ini settings (see https://secure.php.net/manual/en/opcache.installation.php) | ||
RUN echo "memory_limit = 512M" > /usr/local/etc/php/php.ini \ | ||
zip \ | ||
# See https://secure.php.net/manual/en/opcache.installation.php) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing ) not needed
php7.0/Dockerfile
Outdated
# Set recommended PHP.ini settings (see https://secure.php.net/manual/en/opcache.installation.php) | ||
RUN echo "memory_limit = 512M" > /usr/local/etc/php/php.ini \ | ||
zip \ | ||
# See https://secure.php.net/manual/en/opcache.installation.php) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
php7.1/Dockerfile
Outdated
opcache \ | ||
soap \ | ||
zip \ | ||
# See https://secure.php.net/manual/en/opcache.installation.php) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
h1 "WordPress Configuration Complete!" | ||
while read -r -d, i; do | ||
[[ ! "$i" ]] && continue | ||
i="${i# }" # Trim leading whitespace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could maybe be a function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose it could. No preference. I can change later this afternoon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I take that back. It would end up being more code than just keeping as is because bash functions can't return values. So there'd have to be a minimum of 2 side effects each time it's called, which I'm not super fond of.
I can still change it if you're firm on this, but I wouldn't recommend it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fine as is!
@karellm I addressed everything you mentioned in the last commit, less the part about converting the string replacements into a function. Gonna wait to hear back on that before I travel that road. Let me know what else you need. |
I still need to run it but looks good. I will do that later today |
You get a chance to run this yet? Any issues? |
@karellm status? |
@karellm Can you please let me know if I can merge this? I really need the update. Thanks in advance. |
@dsifford I apologize for the delay. I was offline for a while (a much needed break). I just ran everything and it went smoothly. Also did another pass of the code and didn't see anything bugging me. So let's merge this. Thanks again for the great work! |
No problem. Everyone needs a good disconnect every now and again! Glad to hear yours went well. 😄 Gonna merge and let my automatic builds run. If you'd like to also update your dockerhub builds, can you take care of those? Thanks! |
@dsifford I looked and the Hub still require us to grant full access to all private repos, which I don't want to do. That said, I simplified the way to deploy a bit: https://github.com/visiblevc/wordpress-starter/wiki/Development |
@karellm I have automated builds pulling from this repo here: https://hub.docker.com/r/dsifford/wordpress/builds/ On a different note: found a couple issues with the run.sh file.. Patch coming shortly |
@karellm This PR addresses a bunch of the nagging issues that have been around for a while now. There's a lot of changes, all good I think, so, in an effort to reduce verbosity, I'll copy the changelog verbatim below...
0.15.0 - latest
Deprecations
Note: Both deprecations will still work as usual until the next release cycle.
[local]plugin-name
&[local]theme-name
syntaxThe build process is now aware of locally-volumed plugins and themes automatically.
Additionally, listing locally-volumed plugins and themes in your
docker-compose.yml
file is optional; you may list them if you'd like to keep your compose file declarative, or you may skip listing them completely. The build will complete the same either way.SEARCH_REPLACE
has been renamed toURL_REPLACE
We chose to rename this because, although you may search and replace strings that are not URLs, the build process requires them to be.
This name reflects that requirement better and will lead to less confusion down the road.
VERBOSE
environment variableLogging has been changed to show necessary information by default.
Improvements
SERVER_NAME
is specified (eg.example.com
), create aServerAlias
in the apache configs forwww.example.com
.Fixes
docker-compose.yml
.Final Note:
run.sh
was pretty much rewritten again because it was sort of a disaster, which is my fault. A lot of the complexity from the last version came from just making the logging pretty. I changed a bunch of that, which I'm sure you'll see. I was able to slim down the file a good bit and keep it readable.Let me know your thoughts! Glad to discuss anything that you aren't sure of or think can be done better.