Manual Setup
cortex-starter Preparation
cortex-starter PreparationAs cortex itself is only a Rails Engine, it needs to be mounted within a parent Rails applicaton. cortex-starter serves as a starting point for new users, with cortex and cortex-plugins-core already mounted and configured with several example ContentTypes/Decorators. Start by cloning the repository:
$ git clone [email protected]:cortex-cms/cortex-starter.git && cd cortex-starterEnvironment
Copy and rename the example .env.example file as .env and modify it to match your environment.
For a rudimentary setup, these variables should be configured:
Execute
$ bin/rails secrettwice to generate both anAPP_SECRETandDEVISE_SECRETIf the superuser isn't used for the app databases, the
DATABASE_USERNAMEandDATABASE_PASSWORDshould be set accordingly.
Dependencies
System
macOS
Install the Xcode Command Line tools:
$ xcode-select --installInstall all Cortex system-wide dependencies (and the
readlineRuby/byebugbuild dependency) using Homebrew from theBrewfilevia$ brew install $(cat Brewfile|grep -v "#")Enable system agents:
$ ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
$ ln -sfv /usr/local/opt/elasticsearch/*.plist ~/Library/LaunchAgents
$ ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgentsand start them with brew services:
$ brew services start postgresql
$ brew services start elasticsearch
$ brew services start redisor launchctl:
$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist
$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plistLinux
Install all Cortex system-wide dependencies (and the
readlineRuby/byebugbuild dependency) using your distribution's package manager (pacman,apt-get,yum, etc). For example, with Ubuntu'sapt-get:
$ apt-get install libreadline6-dev postgresql postgresql-contrib redis-server openjdk-8-jre imagemagick jpegoptim ghostscriptEnable & start system agents using your distribution's service manager frontend, which is likely
systemd's frontend,systemctl:
$ systemctl enable --now postgresql elasticsearch redisApplication
Install Bundler and its dependencies:
$ gem install bundler && bin/bundle installInstall
nodedependencies usingyarn:
$ bin/yarn installData Provisioning
Quick
cortex-starter ships with an automated setup script. Execute this in lieu of the Manual Setup steps below, if you're comfortable doing so:
$ bin/setupManual
Create databases:
$ bin/rails db:createInitialize the schema:
$ bin/rails db:schema:loadSeed database with a top-level tenant, the superuser and Custom Content data, then rebuild the Elasticsearch index:
$ bin/rails db:seed
$ bin/rails cortex_starter:content_types:seed
$ bin/rails cortex:rebuild_indexesServer
Start Cortex, Sidekiq and live Webpack rebuild via Foreman with the dev-server script:
$ bin/dev-serverThe admin interface should now be accessible locally at http://localhost:3000. To access Cortex as superadmin, login as [email protected] with password welcome1.
Last updated