ARK2/Install

From ARK
Revision as of 10:28, 19 May 2017 by John Layt (talk | contribs) (macOS)

Jump to: navigation, search

Install

Git / Github

Development is hosted on Github, so you will need a free Github account to contribute code.

If you are new to Git, you may find the Github desktop application easier to use. Alternatives are SourceTree and GitKraken.

Environment

To develop ARK requires the following tools to be installed:

You will also require PHP, a web server (Apache/PHP), a database server (MySQL/PostreSQL/SQLite), a web browser (Chrome/Firefox), and a an API client (Postman).

The following tools are recommend to adhere to ARK code quality standards:

  • php-cs-fixer
  • PHP CodeSniffer

macOS

On macOS, while you can install the requirements via standalone packages, we recommend using HomeBrew as it makes installing and updating all the tools used easier.

  • Install XCode
  • Install the Command Line Tools (includes Git)
  • Download and install HomeBrew
  • Modify your .profile to add brew packages to your $PATH
    export PATH=/usr/local/bin:/usr/local/sbin:$PATH
  • Install the required packages from Brew:
    brew install homebrew/php/composer homebrew/php/php-cs-fixer homebrew/php/php-code-sniffer homebrew/php/sqlformat homebrew/php/phplint
  • If you need to do front end development you will also need
    brew install node tidy-html5
  • (Optional) Modify your .profile to enable command-line auto-complete
export HOMEBREW_GITHUB_API_TOKEN="token"
source /Library/Developer/CommandLineTools/usr/share/git-core/git-completion.bash
source /Library/Developer/CommandLineTools/usr/share/git-core/git-prompt.sh
GIT_PS1_SHOWDIRTYSTATE=true
PS1='\u@\h \W$(__git_ps1 " (%s)") \$ '

The easiest way to run a webserver and database server is using MAMP. Simply install MAMP and create a soft-link from the MAMP webroot to the location of your ARK git repository. The alternative is to use HomeBrew to configure and run your own install. The HomeBrew method is recommended for developing with PostgreSQL (TODO).

  • brew install homebrew/php/php71 homebrew/php/php71-tidy homebrew/php/php71-xdebug

For QGIS Python:

  • 'brew install python qt pyqt'
  • 'pip install pep8 autopep8 jedi pb_tool '

TODO

  • xdebug setup
  • apache / php /mysql / mamp
  • linter/fixer rulesets

Debian Jessie

curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install build-essential git nodejs php-codesniffer php5-intl libsodium13
curl -sS https://getcomposer.org/installer -o composer-setup.php
php composer-setup.php --install-dir=/usr/local/bin --filename=composer

Install

git clone git@github.com:lparchaeology/ark2.git
cd ark2/
composer install
<may need github token...>
cd build
./build env:install
<build frontend if needed>
cd ../bin
./sysadmin site:create <site>
<fix database load!>
cd ..
ln -s sites/<site>/web  /Applications/MAMP/htdocs/<site>
http://localhost:8888/<site>