Difference between revisions of "ARK2/Install"

From ARK
Jump to: navigation, search
(Install)
(Debian Jessie)
Line 51: Line 51:
 
* linter/fixer rulesets
 
* linter/fixer rulesets
  
=== Debian Jessie ===
+
=== Debian Stable (Stretch) ===
 +
 
 +
Debian Stretch ships with PHP 7.0 by default, but also enables the parallel install of other PHP versions using PHP-FM. PHP 5.6 and 7.1 are not in the official repositories, but the Debian maintainer has made them available in his repo pending their being pushed to Debian Backports. LP Archaeology use this combination for our servers and we strongly recommend you use this method for both simplicity and reliability.
  
 
  curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
 
  curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -

Revision as of 12:09, 12 September 2017

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 Stable (Stretch)

Debian Stretch ships with PHP 7.0 by default, but also enables the parallel install of other PHP versions using PHP-FM. PHP 5.6 and 7.1 are not in the official repositories, but the Debian maintainer has made them available in his repo pending their being pushed to Debian Backports. LP Archaeology use this combination for our servers and we strongly recommend you use this method for both simplicity and reliability.

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
npm install
./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>