Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local environment setup instructions #1882

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 59 additions & 88 deletions docs/developers/setup.rst
Original file line number Diff line number Diff line change
@@ -1,101 +1,72 @@
Setting up a complete Largo dev environment
===========================================

**This recipe is really old. It may not suit your needs.**
**This recipe has been updated, please see an older version of the docs for the previous setup methods.**

This recipe will walk you through setting up a fresh WordPress install on a Vagrant Virtualbox machine with INN's deploy tools and Largo installed.
This recipe will walk you through setting up a fresh WordPress install using `Laravel's Valet CLI <https://laravel.com/docs/8.x/valet>`_.

We'll walk you through the overall setup of the WordPress directory, and then we'll walk you through setting up Largo and its development requirements.

Software to install first
-------------------------
Make sure you have these items installed locally on your machine before proceeding:

From `INN's computer setup guide <https://github.com/INN/docs/blob/master/staffing/onboarding/os-x-setup.md#command-line-utilities>`_, install the following software:

- git
- homebrew
- Home Brew
- Composer
- php
- MySQL
- wp-cli
- virtualenv and virtualenvwrapper
- Vagrant
- npm and grunt-cli
- xgettext and msgmerge (only needed for rebuilding translation files and releasing)

If you're on OSX, you will also want to install Homebrew, to assist in the installation of the above.

Once you have all that set up, you're ready to install Largo and WordPress inside a virtual machine!

Setting up Largo and WordPress
------------------------------

1. Follow the instructions in `INN/docs for creating an umbrella repository at <https://github.com/INN/docs/blob/master/projects/largo/umbrella-setup.md>`_. This provides a few options, which are updated separately from Largo.

2. Now, to setting up Largo. ::

cd wp-content/themes/largo

3. You're going to have to install some things first.

4. First, install the Python dependencies.

We use a few Python libraries for this project, including `Fabric <https://www.fabfile.org>`_ which powers the INN deploy-tools to elegantly run `many common but complex tasks <https://github.com/INN/deploy-tools/blob/master/COMMANDS.md>`_. In the `OS X setup guide <https://github.com/INN/docs/blob/master/staffing/onboarding/os-x-setup.md>`_, you should have installed Python virtualenv and virtualenvwrapper.

Make sure you tell virtualenvwrapper where the umbrella is. ::

export WORKON_HOME=~/largo-umbrella
mkdir -p $WORKON_HOME
source /usr/local/bin/virtualenvwrapper.sh


You should add that last line to your .bashrc or your .bash_profile.

Now we can create a virtual environment and install the required Python libraries: ::

mkvirtualenv largo-umbrella --no-site-packages
workon largo-umbrella
pip install -r requirements.txt

5. Now, the NodeJS dependencies.

If this command fails, make sure you're in the ``largo`` directory. ::

npm install

6. Our API docs/function reference uses doxphp to generate documentation based on the comments embedded in Largo's source code. You'll need to install doxphp to generate API docs.

- Installation process with git: ::
1. ``git clone https://github.com/avalanche123/doxphp.git`` to someplace in your filesystem
2. add ``doxphp/bin/`` to your ``$PATH`` by adding ``export PATH=$PATH:/path/to/doxphp/bin`` to your ``.bashrc`` or similar file

The last step may require you to use sudo.

All done? Log into WordPress and start poking around. Remember to take Vagrant snapshots when you get things working how you like the. You'll probably want to take one after you add some posts and configure your menus for testing purposes. If you want to log into the vagrant box, it's as easy as ``vagrant ssh``.

You have installed:

- INN's deploy tools
- the Largo theme
- Grunt and the nodejs packages we use to handle a bunch of things
- pip, virtualenv, a largo-umbrella virtualenv, sphinx, and everything needed to rebuild the documentation
- doxphp and dpxphp2sphinx
- WordPress on a dev environment of your choice.

Some notes about deploy-tools and Fabric
----------------------------------------

The full list of supported commands can be found in `the deploy-tools documentation <https://github.com/INN/deploy-tools/blob/master/COMMANDS.md>`_.

Most fabric commands take the form of ::

fab <environment> <branch> <action>
fab <action that defines its own environment>:arguments

Every command in `the list of commands <https://github.com/INN/deploy-tools/blob/master/COMMANDS.md>`_ is prefixed with ``fab``.

If you recieve an error when running your command, make sure that you have run ``workon largo-umbrella``, or the name of the Python virtualenv you are using. When run, ``workon`` will prefix your prompt: ::

you@computer:~$ workon largo
(largo-umbrella)you@computer:~$

To exit the virtualenv, you can use the command ``deactivate``.
Let's walk through these steps first, starting with Home Brew.

1. Install `Home Brew <https://www.digitalocean.com/community/tutorials/how-to-install-and-use-homebrew-on-macos>`_, open terminal of your choice and type or paste in
curl -fsSL -o install.sh https://raw.githubusercontent.com/Homebrew/install/master/install.sh
2. Once that is finished you can install Composer
brew install composer
3. Now we can add php in
brew install php
3a. Once Composer is installed an update to your PATH may need to happen once php is installed you can try
export PATH=$PATH:~/.composer/vendor/bin
4. Now you can install Laravel/Valet the program that will do all the heavy lifting to setup Largo project locally.
composer global require laravel/valet
5. Now we can install valet
valet install
6. Lets get WP-CLI installed so we can use that to get WordPress
brew install wp-cli
6a. Now lets get WordPress core downloaded into a new directory first
mkdir <what-ever-you-name-it>
cd <what-ever-you-name-it>
6b. Now we can use WP-CLI to download WordPress core
wp core download

Now if your not using `MAMP <https://www.mamp.info/en/mac/>`_ or some other database GUI you will need some way to manage mySQL for Wordpress. We recommend using what you feel at home with.
Here we can run through using Home Brew to install Mysql
brew install mysql

Once that is complete you can create a Wordpress Database to use locally while you develop, Brew will print instructions for accessing Mysql server.

Now that everything is installed, we can move on to getting a local dev environment setup and running Largo Theme.
Valet has a great set of cli tools to help speed up provisioning a working Wordpress installation.
From getting a working URL to securing that URL with an SSL cert, valet will handle this all in a couple of commands.
With the same terminal open change directory to where you want Wordpress to be installed. From there run these commands

7. Lets navigate to WordPress themes folder and install the largo theme
cd wp-content/themes
8. Using Git we can download the state of trunk, we then create a new branch to start working from
git clone -b trunk https://github.com/WPBuddy/largo.git
9. Navigate to the largo theme directory and create a new branch
git checkout -b <branch name>
10. Navigate to the base of the install and create the valet site link using this command (note: this will create a URL with the name of the directory you created, in this case it will be largo.test)
valet link
11. Lets secure this new URL using (note: we specify the site here using just the first part of the URL)
vale secure largo
12. From here you will want to the visit the link created, ours was largo.test, to finish installing Wordpress normally, we will pick up after you have completed this and can login to your local site.


Setting up Largo
----------------

1. Download the current release from Github, `Largo Theme <https://github.com/WPBuddy/largo/releases>`_
2. Login to your local Wordpress site and click Appearance in the left side menu, then click Add New in the top of screen (blue outlined button) or the very large plus sign.
3. Upload the zipped file you downloaded from Github once that is done you will now have a fresh Wordpress installation along with our most current version of Largo theme

Many commands in the deploy tools can now be done with `wp-cli <https://wp-cli.org/>`_.
6 changes: 3 additions & 3 deletions docs/feedback.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ Feedback on these docs

If you have comments or suggestions on this documentation, you can reach us through the following ways:

- `File an issue on Largo's Github repository <https://github.com/INN/Largo/issues/new>`_
- Send an email to [email protected]
- Tweet to us `@innnerds <https://twitter.com/innnerds>`_
- `File an issue on Largo's Github repository <https://github.com/WPBuddy/largo/issues>`_
- Send an email to [email protected]
- Tweet to us `@LargoProject <https://twitter.com/largoproject>`_
18 changes: 9 additions & 9 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
Welcome to the Largo Project
============================

`Largo <https://largo.inn.org/>`_ is a responsive WordPress starter/parent theme built specifically with the needs of news publishers in mind and is built and maintained by the news apps and technology team at the `Institute for Nonprofit News (INN) <http://nerds.inn.org>`_.
`Largo <https://largo.wpbuddy.co/>`_ is a responsive WordPress starter/parent theme built specifically with the needs of news publishers in mind and is maintained by the buddies @ `Wpbuddy.co <https://wpbuddy.co/>`_
Formerly built and maintained by the news apps and technology team at the `Institute for Nonprofit News (INN) <http://nerds.inn.org>`_.
Questions? Comments? Send us an email at [email protected]

Questions? Comments? Send us an email at [email protected]
Project Repository: https://github.com/WPBuddy/largo

Project Repository: https://github.com/INN/Largo/
Technical Issues (Bugs, Feature Requests, etc.): https://github.com/WPBuddy/largo/issues

Technical Issues (Bugs, Feature Requests, etc.): https://github.com/INN/Largo/issues
Largo User Guides for Administrators, Authors, and Editors: https://largo.wpbuddy.co/guides/

Largo User Guides for Administrators, Authors, and Editors: https://largo.inn.org/guides/
Help Desk (Support Requests): https://largo.wpbuddy.co/support/

Help Desk (Support Requests): https://support.inn.org/
Knowledge Base: https://largo.wpbuddy.co/support/

Knowledge Base: https://support.inn.org/

User Forum: https://support.inn.org/
User Forum: https://largo.wpbuddy.co/support/

Twitter: https://twitter.com/largoproject

Expand Down