oc-bootstrapper
is a simple script that enables you to bootstrap an October CMS installation
with custom plugins and custom themes. You simply describe your setup in a config file and run
the install command.
oc-bootstrapper
enables you to install plugins and themes from your own git repo.
The following steps will be taken care of:
- The latest October CMS gets downloaded from github and gets installed
- All composer dependencies are installed
- Relevant config entries are moved to a
.env
file for easy customization - Sensible configuration defaults for your
prod
environment get pre-set - Your database gets migrated
- All demo data gets removed
- Your selected theme gets downloaded and installed
- All your plugins get downloaded and installed
- A .gitignore file gets created
- A push to deploy setup gets initialized for you
- Zip PHP extension (
sudo apt-get install php7.0-zip
) - Composer (via global binary or
composer.phar
in your working directory)
- Ubuntu 15.10
- Ubuntu 16.04
Should work on OS X. Will probably not work on Windows.
composer global require offline/oc-bootstrapper
You can now run october
from your command line.
$ october
October CMS Bootstrapper version 0.2.0
Use the october init
command to create a new project with a config file:
october init myproject.com
cd myproject.com
In your newly created project directory you'll find an october.yaml
file. Edit its contents
to suite your needs.
app:
url: http://october.dev
locale: en
debug: true
cms:
theme: name (user@remote.git)
edgeUpdates: false
database:
connection: mysql
username: homestead
password: secret
database: bootstrapper
host: 192.168.10.10
git:
deployment: false
# Exclude everything except themes and custom plugins in git
bareRepo: true
plugins:
- Rainlab.Pages
- Rainlab.Builder
- Adrenth.Redirect
- Indikator.Backend
- OFFLINE.SiteSearch
- OFFLINE.ResponsiveImages
# - Vendor.Private (user@remote.git)
# - Vendor.PrivateCustomBranch (user@remote.git#branch)
mail:
host: smtp.mailgun.org
name: User Name
address: email@example.com
driver: log
oc-bootstrapper
enables you to install plugins and themes from your own git repo. Simply
append your repo's address in ()
to tell oc-bootstrapper
to check it out for you.
If no repo is defined the plugins are loaded from the October Marketplace.
When you are done editing your configuration file, simply run october install
to install October.
If at any point in time you need to install additional plugins, simply add them to your october.yaml
and rerun october install
. Missing plugins will be installed.
To change your installation's configuration, simply edit the .env
file in your project root.
When deploying to production, make sure to edit your .env.production
template file and rename it to .env
.
If you don't want to have the complete October source code in your repository set the bareRepo
option to true
.
This will set up a .gitignore
file that excludes everything except your theme
directory and all the manually installed plugins in your plugins
directory.
If you want to deploy a bare repo please read the section
SSH deployments with bare repos
below.
After cloning a bare repo for the first time, simply run october install
. October CMS and all missing plugins will get installed locally on your machine.
Set the deployment
option to false
if you don't want to setup deployments.
Currently oc-bootstrapper
supports a simple setup to deploy a project on push via GitLab CI. To automatically create all needed files, simply set the deployment
option to gitlab
.
Support for other CI systems is added on request.
If you use SSH deployments with a bare repo, make sure to run ./vendor/bin/october install
in your deployment script to install the October source code and all of your plugins . If the October source code is already available it won't be downloaded again.
If you use the provided GitLab deployment via Envoy make sure to simply uncomment this line.
It is important that you list every installed plugin in your october.yaml
file. Otherwise the plugins won't be available after deployment.
If you use the gitlab deployment option the .gitlab-ci.yml
and Envoy.blade.php
files are created for you.
Change the variables inside the Envoy.blade.php
to fit your needs.
If you push to your GitLab server and CI builds are enabled, the ssh tasks inside Envoy.blade.php
are executed. Make sure that your GitLab CI Runner user can access your target server via ssh user@targetserver
. You'll need to copy your ssh public key to the target server and enable password-less logins via ssh.
For more information on how to use ssh keys during a CI build see http://doc.gitlab.com/ce/ci/ssh_keys/README.html
If a deployed website is edited by a customer directly on the prod server you might want to commit those changes back to your git repository.
To do this, simply create a cronjob that executes git.cron.sh
every X minutes. This script will commit all changes
to your git repo automatically.
You can overwrite all default file templates by creating a folder called october
in your global composer directory.
Usually it is located under ~/.composer/
.
Place the files you want to use as defaults in ~/.composer/october
. All files from the templates
directory can be overwritten.
- Update command to update private plugins
If you are working with XAMPP on Windows you will most likely get the following error during october install
:
cURL error 60: SSL certificate problem: unable to get local issuer certificate
You can fix this error by executing the following steps.
-
Download the
cacert.pem
file from VersatilityWerks -
Extract the
cacert.pem
to thephp
folder in your xampp directory (eg.c:\xampp\php
) -
Edit your
php.ini
(C:\xampp\php\php.ini
). Add the following line.curl.cainfo = "\xampp\php\cacert.pem"
october install
should work now as expected.