Skip to content

Commit

Permalink
Merge pull request #174 from springload/feature/update-readme
Browse files Browse the repository at this point in the history
Update setup instructions
  • Loading branch information
AndrewCalderSpringload authored Sep 4, 2023
2 parents 0c6fcac + 11dab99 commit 079fa5a
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 50 deletions.
2 changes: 1 addition & 1 deletion dev.env → .circleci/circleci.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PORT_PREFIX=520
ENVIRONMENT=dev
APPLICATION_VERSION=0.1
PROJECT=madewithwagtail
SITE_HOSTNAME=madewithwagtail-dev.springload.nz
SITE_HOSTNAME=madewithwagtail.dev.springload.nz
DATABASE_URL=postgres://postgres:postgres@database/madewithwagtail
DJANGO_SETTINGS_MODULE=madewithwagtail.settings.dev
APP_SECRET_KEY=111
Expand Down
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ workflows:
docker run \
-it --name app-test --rm \
--link=database \
--env-file=dev.env \
--env-file=dev.env.example \
-e DATABASE_URL="postgres://postgres:$DATABASE_PASSWORD@database/${PROJECT}_test" \
-e ENVIRONMENT=test \
app-test
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ media/*
.coverage
.bundle
dev.env
temp/

docker/database/*.sql

Expand Down
95 changes: 53 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,77 +5,88 @@
*Check out [Awesome Wagtail](https://github.com/springload/awesome-wagtail) for more awesome packages and resources from the Wagtail community.*

## Installation
## Back End Setup

Install [Vagrant](http://www.vagrantup.com/downloads.html) and [VirtualBox](https://www.virtualbox.org/wiki/Downloads), then from the command-line:
Development on this project can be done using docker. If you have not yet
installed docker, consult the instructions for your operating system.

[Docker](https://docs.docker.com/)

It's a good idea to set up the nginx proxy if you have not done so already,
instructions can be found on the github repo.

Vagrant is no longer in this project, and any material relating to vagrant
can be ignored.

## Clone the repo

```sh
cd [my-dev-environment]
git clone [email protected]:springload/madewithwagtail.git
cd madewithwagtail
.githooks/deploy
vagrant up
# [.. wait until everything gets installed]
vagrant ssh
# [.. from your vagrant machine]
djrun
```
### Setup your environment variables

The demo site will now be accessible at [http://localhost:8111/](http://localhost:8111/) and the Wagtail admin interface at [http://localhost:8111/admin/](http://localhost:8111/admin/) . Log into the admin with the credentials ``admin / changeme``.
```sh
cp dev.env.example dev.env
```

### Front-end installation
And then edit `dev.env` to suit your local setup. Any API keys etc should be in Bitwarden.

> Install [Node](https://nodejs.org). This project also uses [nvm](https://github.com/creationix/nvm).
### Database setup

To install our dependencies:
First, download the database dump you want from our [Google Cloud storage](<https://console.cloud.google.com/storage/browser/springload-backups/madewithwagtail?pageState=(%22StorageObjectListTable%22:(%22f%22:%22%255B%255D%22))&project=springload-backups&prefix=&forceOnObjectsSortingFiltering=false>).

```sh
nvm install
# Then, install all project dependencies.
npm install
```

## Working on the project
Next decrypt the dump using gpg.

> Everything mentioned in the installation process should already be done.
Finally, place the decrypted .sql file into [my-dev-environment]/madewithwagtail/docker/database - it will be automatically loaded when you build your database container in the next section.

### Starting the server
### Build your containers

```sh
vagrant up
vagrant ssh
djrun
docker-compose up
# In another terminal tab run:
docker-compose exec application ./manage.py migrate
```

### Front-end commands
### Browsing locally

**https://madewithwagtail.dev.springload.nz/**

## Front End

This project uses [nvm](https://github.com/creationix/nvm) and [Yarn](https://yarnpkg.com/lang/en/)

```sh
# Make sure you use the right node version.
nvm use

# Setup
yarn install

# Start the server and the development tools.
npm run start
yarn run start

# Builds frontend assets.
npm run build
# Runs linting.
npm run lint:versions
# Runs tests.
npm run test
# View other available commands with:
npm run
```
yarn run build

## Deploying a new version
# Builds frontend production assets.
yarn run dist

### To production
# Runs linting.
yarn run lint

```sh
npm run deploy
```
# Runs tests.
yarn run test

From your local machine, it's a good idea to push to the master before
pushing to the deploy branch. That way you know that both are up to date.
# View other available commands with:
yarn run
```

## Documentation

Check out the [`docs/`](docs/) in their own folder.

### Browser support

**Supported browser / device versions:**
Expand All @@ -85,7 +96,7 @@ pushing to the deploy branch. That way you know that both are up to date.
| Mobile Safari | iOS Phone | latest |
| Mobile Safari | iOS Tablet | latest |
| Chrome | Android | latest |
| IE | Desktop | 11 |
| Edge | Desktop | latest |
| Chrome | Desktop | latest |
| Firefox | Desktop | latest |
| Safari | OSX | latest |
Expand Down
1 change: 0 additions & 1 deletion core/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@


def google_credentials(request):

return {
"GOOGLE_ANALYTICS_KEY": getattr(settings, "GOOGLE_ANALYTICS_KEY", False),
"GOOGLE_TAG_MANAGER": getattr(settings, "GOOGLE_TAG_MANAGER", False),
Expand Down
1 change: 0 additions & 1 deletion core/snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ def get_by_natural_key(self, name):

@register_snippet
class NavigationMenu(ClusterableModel):

objects = NavigationMenuManager()
menu_name = models.CharField(max_length=255, null=False, blank=False)

Expand Down
2 changes: 0 additions & 2 deletions core/templatetags/macros.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ def _setup_macros_dict(parser):

class DefineMacroNode(template.Node):
def __init__(self, name, nodelist, args):

self.name = name
self.nodelist = nodelist
self.args = []
Expand Down Expand Up @@ -93,7 +92,6 @@ def __init__(self, macro, fe_args, fe_kwargs, context_only):
self.context_only = context_only

def render(self, context):

for i, arg in enumerate(self.macro.args):
try:
fe = self.fe_args[i]
Expand Down
4 changes: 2 additions & 2 deletions dev.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ PORT_PREFIX=520
ENVIRONMENT=dev
APPLICATION_VERSION=0.1
PROJECT=madewithwagtail
SITE_HOSTNAME=madewithwagtail-dev.springload.nz
DATABASE_URL=postgres://postgres@database/madewithwagtail
SITE_HOSTNAME=madewithwagtail.dev.springload.nz
DATABASE_URL=postgres://postgres:postgres@database/madewithwagtail
DJANGO_SETTINGS_MODULE=madewithwagtail.settings.dev
APP_SECRET_KEY=111
DEV_SHOW_DEBUG_TOOLBAR=False

0 comments on commit 079fa5a

Please sign in to comment.