GitHub - commotioncreativeltd/octobercms-deployment GitHub Wiki
Initial setup and deployment
- make new repo in github
- install October CMS locally (removing existing VSC when promoted)
composer create-project october/october myproject dev-master
- clone the repo to a temp dir then move
.git
folder
git clone --no-checkout repo-to-clone myproject/myproject.tmp
mv myproject/myproject.tmp/.git myproject/
rmdir myproject/myproject.tmp
cd myproject
- update config files
app.php
'debug' => env('APP_DEBUG', true),
...
'url' => env('APP_URL', 'http://localhost'),
cms.php
'enableRoutesCache' => env('CMS_ROUTE_CACHE', false),
...
'enableAssetCache' => env('CMS_ASSET_CACHE', false),
...
'storage' => [
'uploads' => [
'disk' => 's3',
'folder' => 'uploads',
'path' => 'https://s3-'.env('FILE_AWS_REGION','').'.amazonaws.com/'.env('FILE_AWS_BUCKET', '').'/uploads',
],
'media' => [
'disk' => 's3',
'folder' => 'media',
'path' => 'https://s3-'.env('FILE_AWS_REGION','').'.amazonaws.com/'.env('FILE_AWS_BUCKET', '').'/media/',
],
],
...
'linkPolicy' => env('CMS_LINK_POLICY', 'detect'),
...
'enableCsrfProtection' => env('CMS_CSRF_PROTECTION', true),
database.php
'host' => env('DB_HOST', 'localhost'),
...
'database' => env('DB_DATABASE', 'homestead'),
'username' => env('DB_USERNAME', 'homestead'),
'password' => env('DB_PASSWORD', 'secret'),
filesystem.php
'default' => env('FILE_DEFAULT', 's3'),
...
's3' => [
'driver' => env('FILE_AWS_DRIVER', 's3'),
'key' => env('FILE_AWS_KEY', ''),
'secret' => env('FILE_AWS_SECRET', ''),
'region' => env('FILE_AWS_REGION', ''),
'bucket' => env('FILE_AWS_BUCKET', ''),
],
mail.php
'driver' => env('MAIL_DRIVER', 'mailgun'),
...
'from' => ['address' => env('MAIL_ADDRESS', '[email protected]'), 'name' => env('MAIL_NAME', 'Administrator')],
...
'pretend' => env('MAIL_PRETEND', false),
queue.php
'default' => env('QUEUE_DEFAULT', 'database'),
services.php
'mailgun' => [
'domain' => env('SERVICES_MAILGUN_DOMAIN', ''),
'secret' => env('SERVICES_MAILGUN_SECRET', ''),
],
...
'stripe' => [
'model' => 'User',
'secret' => env('SERVICES_STRIPE_SECRET', ''),
],
session.php
'secure' => env('SESSION_SECURE', true),
- create local
.env
file with the following:
APP_ENV=local
APP_DEBUG=true
DB_HOST=localhost
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
CMS_ROUTE_CACHE=false
CMS_ASSET_CACHE=false
CMS_CSRF=false
CMS_LINK_POLICY='detect'
CMS_CSRF_PROTECTION=true
APP_URL='http://www.yourdomain.com'
APP_LOCALE=en
MAIL_DRIVER=mailgun
MAIL_ADDRESS='[email protected]'
MAIL_NAME='Administrator'
MAIL_PRETEND=false
QUEUE_DEFAULT='database'
SERVICES_MAILGUN_DOMAIN=''
SERVICES_MAILGUN_SECRET=''
SERVICES_STRIPE_SECRET=''
FILE_DEFAULT='s3'
FILE_AWS_DRIVER='s3'
FILE_AWS_KEY='** ENTER HERE THE 'WEBSITE' AWS SECURITY USER **'
FILE_AWS_SECRET='** ENTER HERE THE 'WEBSITE' AWS SECURITY USER **'
FILE_AWS_REGION='eu-west-1'
FILE_AWS_BUCKET='** ENTER HERE THE S3 BUCKET **'
SESSION_SECURE=false
- create a database with homestead and update
.env
file with name - run the
php artisan october:up
command in initialize October CMS - run the
php artisan october:mirror public/
command to setup the public folder structure - login to the website and change default admin details
username: admin
password: admin
- create a new blank theme, activate it and delete the demo theme
- update the
.gitignore
file
# Numerous always-ignore extensions
*.bak
*.diff
*.err
*.orig
*.log
*.rej
*.swo
*.swp
*.vi
*.idea
.sass-cache
composer.phar
.env
.env.*.php
.env.php
php_errors.log
nginx-error.log
nginx-access.log
nginx-ssl.access.log
nginx-ssl.error.log
php-errors.log
sftp-config.json
selenium.php
composer.lock
# OS or Editor folders
.DS_Store
._*
Thumbs.db
.cache
.project
.settings
.tmproj
nbproject
*.sublime-project
*.sublime-workspace
# Dreamweaver added files
_notes
dwsync.xml
# folders to ignore
node_modules
bower_components
/bootstrap/compiled.php
/vendor
# for netbeans
nbproject
# more folders
/themes/**/assets/node_modules
/themes/demo
/plugins/commotion
/public
- clear the
README.md
file - add git repo into desktop app, commit to
master
then sync - create
dev
andweb
branch and publish to github