If you have a WordPress website, the core, most plugins and standaard themes are developed by someone else and you never change those files. So it makes no sense to track changes for them in GIT.
I would like to deploy only the (child) theme and maybe some site specific (self written) plugins.
Is this possible with deployment hooks? Instead of excluding a single directory, just include only single directories?
I did some tests with a child repository. On the âcode repositoryâ tab from the settings, there is a field for the app folder. Is this maybe the function I need to use?
My site is installed into â/home/user/domain.com/current/public/â. What kind of value should I use?
The value from the screenshot doesnât workâŚ
I had an similar situation but the exact other way around, i had a folder that i wanted to keep out of git since there were all stuff my customer uploaded so the âgit files protectâ didn´t work,
So i got help to create an deploy hook that made the folder lie permanent outside cleavr´s deploy versoning system.
Maybe this can give you some ideas?
SHARED_DIR=upload
echo 'Checking the shared directory...'
if [ -d "{{ projectPath }}/$SHARED_DIR" ]; then
echo 'Found an existing shared directory.'
else
mkdir -p "{{ projectPath }}/$SHARED_DIR"
chown -R {{ username }}:www-data "{{ projectPath }}/$SHARED_DIR"
chmod -R 775 "{{ projectPath }}/$SHARED_DIR"
fi
# remove the storage folder if exists
if [ -d "{{ releasePath }}/public/$SHARED_DIR" ]; then
echo "Shared directory {{ releasePath }}/public/$SHARED_DIR is pushed. To make data persists across deployments, removing this directory and linking it to {{ projectPath }}/$SHARED_DIR instead."
rm -rf "{{ releasePath }}/public/$SHARED_DIR"
fi
echo 'Linking the shared folder...'
ln -s "{{ projectPath }}/$SHARED_DIR" "{{ releasePath }}/public/$SHARED_DIR"
The question is interesting though since in this use case it sounds like @finalwebsites wants to keep WordPress mostly static but then just deploy to a single directoryâŚ
The short answer is we donât have a way to do that exactly in Cleavr. This is because every deployment we pull down the whole repo into a new directory, build it, and then make it live.
For this particular use case, youâd have to set up a separate web app (probably using the âplain htmlâ type) and pull just the sub-directory from the repo like in the screenshot above, and then make a custom deployment hook that copies and pastes to the appropriate directory in the static appâŚ
Itâs not for a static website. I have several customers with a lot of custom code which is stored in a child theme. If you use WordPress you never change the code for Plugins, standaard themes and the core, thatâs why it doesnât make sense to version control them in your website project.
Iâm not sure if a partly deployment would work because you need also a staging site to test all the (plugin) updates.
The two examples (WordPlate and Bedrock) are complete site deployments. This might work but your deployment is huge in many case while your development work is only small.
Maybe itâs easier to create a ZIP file from you modified child theme and install it over the old version. This should work and is the âregular WordPress wayâ how stuff is done.