Skip to content

Instantly share code, notes, and snippets.

@izdrail
Forked from LukeTowers/.0 - cheatsheet.sh
Created October 3, 2018 12:52
Show Gist options
  • Save izdrail/8c82e959d30736967cf004f078a334a0 to your computer and use it in GitHub Desktop.
Save izdrail/8c82e959d30736967cf004f078a334a0 to your computer and use it in GitHub Desktop.
Introduction to OctoberCMS
APP_DEBUG=true
APP_URL=http://example.local
APP_KEY=
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=website-oc-example-LOCAL
DB_USERNAME=homestead
DB_PASSWORD=secret
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=587
MAIL_ENCRYPTION=tls
MAIL_USERNAME=null
MAIL_PASSWORD=null
ROUTES_CACHE=false
ASSET_CACHE=false
LINK_POLICY=detect
ENABLE_CSRF=true
/bootstrap/compiled.php
/vendor
composer.phar
Thumbs.db
.DS_Store
.idea
.ftpquota
.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
php_errorlog
sftp-config.json
selenium.php
# Exclude the autogenerated class file caches
/storage/framework/packages.php
/storage/framework/classes.php
/storage/framework/services.php
# Exclude the symlinked public directory
public/
# Exclude the OctoberCMS module folders from being included, they're pulled in via composer
modules/
# Exclude the following plugins, they'll be loaded by composer
plugins/rainlab

About

Repository for the OctoberCMS-powered Example.com. Active development in develop branch; features in feature branches. Develop locally using Homestead. Pushes to develop are automatically deployed on the dev server.

Setup

  1. Clone the repo
  2. Copy .env.example to .env and configure accordingly (APP_URL and DB credentials)
  3. Run the deployment script below, with the exception that php artisan key:generate needs to be run after composer install

Deployment Script

# Install dependencies from composer.lock
composer install;

# Enable maintenance mode
php artisan down;

# Run any pending migrations
php artisan october:up;

# Remove and regenerate the symlinked public directory for whitelist approach to clean out 
# any references that may have been removed and add any new ones that may have been added
rm -rf public;
php artisan october:mirror public --relative;

# Disable maintenance mode
php artisan up;
# Setup symlinks in local development copy of October to the local development copies of my plugins
ln -s ~/LocalRepositories/OctoberCMS/Plugins ~/LocalRepositories/OctoberCMS/Core/october/plugins
# Setup symlinks in local development copy of October to the local development copy of October\Rain
ln -s ~/LocalRepositories/OctoberCMS/Core/library ~/LocalRepositories/OctoberCMS/Core/october/vendor/october/rain
# Setup external symlink (for mac, outside of vagrant) for the october rain library
ln -s ~/Repositories/OctoberCMS/Core/library ~/Repositories/OctoberCMS/Core/october/vendor/october/rain-src
# Setup external symlink (for mac, outside of vagrant) to the local development copies of my plugins
ln -s ~/Repositories/OctoberCMS/Plugins ~/Repositories/OctoberCMS/Core/october/plugins-src
{
"name": "example/example.com",
"description": "Example Project",
"homepage": "https://example.com",
"keywords": ["october", "cms", "octobercms", "laravel"],
"authors": [
{
"name": "Bob Builder",
"email": "[email protected]"
}
],
"require": {
"php": ">=7.0",
"ext-mbstring": "*",
"ext-openssl": "*",
"october/rain": "dev-develop as 1.0",
"october/system": "dev-develop",
"october/backend": "dev-develop",
"october/cms": "dev-develop",
"laravel/framework": "5.5.*@dev",
"wikimedia/composer-merge-plugin": "dev-master",
"rainlab/sitemap-plugin": "dev-master"
},
"require-dev": {
"fzaninotto/faker": "~1.7",
"phpunit/phpunit": "~5.7",
"phpunit/phpunit-selenium": "~1.2",
"rainlab/builder-plugin": "dev-master"
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php",
"tests/UiTestCase.php",
"tests/PluginTestCase.php"
]
},
"scripts": {
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-update-cmd": [
"php artisan october:util set build"
]
},
"config": {
"preferred-install": "dist"
},
"minimum-stability": "dev",
"prefer-stable": true,
"extra": {
"merge-plugin": {
"include": [
"plugins/*/*/composer.json"
],
"recurse": true,
"replace": false,
"merge-dev": false
}
}
}
# 0. Install
composer create-project october/october myoctoberfolderhere;
cd myoctoberfolderhere;
# 1. Update .gitignore
cp ../introduction-to-octobercms/.gitignore ./.gitignore;
# 2. Update or remove .md files
rm README.md;
rm LICENSE.md;
rm CONTRIBUTING.md;
rm ISSUE_TEMPLATE.md;
rm CHANGELOG.md;
cp ../introduction-to-octobercms/README.md ./README.md;
# 3. Switch to dev dependencies
cp -f ../introduction-to-octobercms/composer.json ./composer.json;
composer update;
# 4. Generate and populate environment file & example environment file
php artisan october:env;
cp -f ../introduction-to-octobercms/.env.example ./.env.example;
# 5. Run migrations
php artisan october:up;
# 6. Remove demo theme & plugin
php artisan october:fresh;
# 7. Create blank theme (Note: luketowers.blank-theme not publicly available yet)
php artisan theme:install luketowers.blank-theme theme-dir;
php artisan theme:use theme-dir;
# 8. Change config files
# config/app.php
# - app_name
# config/cms.php
# - edgeUpdates = true // Enables updating plugins not managed by composer to their edge (develop) versions
# - backendTimezone = Whatever timezone most of your backend users will find useful as a default
# - disableCoreUpdates = true // Disables updating the core through the backend interface, this should be managed by composer only
# 9. Generate public folder symlinks
php artisan october:mirror public --relative
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment