Skip to content

sb2050/athene2

 
 

Repository files navigation

Athene2

Build Status Kanban board

Installation

You need Docker php-cli and node installed on your system. To build the assets you also need to install ruby-sass and ruby-compass installed.

On Windows we recommend Bash on Ubuntu on Windows. You can install the dependencies above (except Docker) with:

sudo apt-get install php5-cli nodejs ruby-sass ruby-compass

WARNING ruby.compass must be in version range 0.12.2 and ruby-sass must be in version range 3.2.10 - check this with compass version and sass -v. If versions mismatch, building the assets will fail! Bash on Windows installs the right versions out of the box (at least on my system).

Now follow the upcoming instructions.

Clone the project

# Clone the project and its submodules:
$ git clone [email protected]:serlo-org/athene2.git --recursive

$ cd athene2

If you forgot to clone recursively, you can also do this to fetch the submodules:

$ git submodule update --init --recursive

Bootstrapping the project

If you are on windows, run the following in Bash on Windows:

# Copy some config files
$ cp src/config/autoload/local.php.dist src/config/autoload/local.php
$ cp src/config/autoload/develop.local.php.dist src/config/autoload/develop.local.php
$ cp src/public/htaccess.dist src/public/.htaccess

# Install various dependencies
$ php composer.phar install

# Install and build the assets
$ (cd src/assets; npm install)
$ (cd src/assets/athene2-editor; npm install)

Troubleshooting

Wrong php version

If php composer.phar install fails with error

Your requirements could not be resolved to an installable set of packages.           
 Problem 1
 - doctrine/collections v1.4.0 requires php ^5.6 || ^7.0 -> your PHP version (5.5.9) does not satisfy that requirement.                                   
 - doctrine/collections v1.4.0 requires php ^5.6 || ^7.0 -> your PHP version (5.5.9) does not satisfy that requirement.                                   
 - Installation request for doctrine/collections v1.4.0 -> satisfiable by doctrine/collections[v1.4.0].                                           

then you can try updating php to 5.6:

sudo apt-get remove php5-cli
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php5.6-cli
npm install failing

Try a different node version (i.e. using nvm). Try using node version 0.12.5

Also try cleaning the cache and rebuilding: make sure to cd to the correct location first!

npm cache clean -f
npm rebuild
postinstall script: bower fails

If you get an error like bower ESUDO Cannot be run with sudo then try running

npm run bower -- --allow-root
npm run build

Now you can start the cluster

# Start the docker-compose cluster.
# ps: The database import might take some time (1-10 minutes).

# If you are on Windows, run this in regular cmd.exe

$ docker-compose up --build

Setting up hosts

On windows, please add

127.0.0.1 de.serlo.localhost
127.0.0.1 en.serlo.localhost

to your C:\Windows\System32\drivers\etc\hosts.txt file. Then run ipconfig /flushdns in cmd.exe and restart your browser.

On OSX:

sudo nano /etc/hosts

# add lines
127.0.0.1    de.serlo.localhost
127.0.0.1    en.serlo.localhost

# flush mac DNS cache
sudo killall -HUP mDNSResponder

Now, open de.serlo.localhost:4567. Happy coding!

ps: de.serlo.localhost:4567 works for me in chrome but not in FireFox. Not sure why, but if it doesn't work try a different browser.

Development

Development is straight forward, make your changes to the php files and then reload the browser. Done!

If you want to modify the assets, you will have to run the grunt dev task

$ cd src/assets
$ grunt dev

and after the changes are built simply reload the site. Done!

Further resources

Most of these are outdated:

About

Athene2, the Serlo CMS.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 69.7%
  • HTML 15.6%
  • JavaScript 11.5%
  • CSS 2.9%
  • Shell 0.3%