Got a question about committing the entire October CMS instance. I want to lock my app down to a specific version in git, so I include the composer.lock file. When I setup everything in another instance, it adds a lot more files to the git structure. This causes git to see this stuff and not sure why.
what’s the exact process for this so I don’t run into this?
Please, go ahead! The only minor problem with this setup is if you want to bootstrap a working October installation after cloning the git repo (during a deployment or new project setup). Since the storage, bootstrap or config folders are probably missing, you cannot simply run composer install to get everything up and running.
We use the following helper script to move the repo’s content into a folder, install October into a temporary directory, copy the october installation over and then copying the original files over the created installation.
It’s not pretty by any means, but has served us well for many many projects without any issues so far!
Our process is usually:
git clone repo
./bootstrap.sh (file below)
# Install October CMS
# - Move existing repo files to a _originals/ folder
# - Install October into a tmp directory
# - Move all files from the tmp directory to the current directory
# - Restore repo files from _originals/
if [ -d "modules/editor" ]; then
echo "October is already installed, skipping setup"
echo "Installing October CMS"
# Move all repo contents to _orignials/
rsync -rlv --exclude 'composer.phar' --exclude 'vendor' --exclude 'auth.json' --exclude '_originals' --remove-source-files ./ _originals/
# Install October into a tmp directory
rm -rf /tmp/october_install
composer create-project october/october /tmp/october_install --no-scripts
# Move installation to pwd
rsync -lr --exclude 'themes/demo' --remove-source-files /tmp/october_install/ ./
# Restore original files
rsync -rlv --remove-source-files ./_originals/ ./
rm -rf _originals
# Install dependencies
composer install --no-interaction
echo "Installation successful"