diff --git a/dev.env b/.circleci/circleci.env similarity index 83% rename from dev.env rename to .circleci/circleci.env index 07bddb0..f36e406 100644 --- a/dev.env +++ b/.circleci/circleci.env @@ -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 diff --git a/.circleci/config.yml b/.circleci/config.yml index 7e7c427..6bf9d4c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 diff --git a/.gitignore b/.gitignore index d4870d4..7d56a07 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,7 @@ media/* .coverage .bundle dev.env +temp/ docker/database/*.sql diff --git a/README.md b/README.md index 48107a2..7e73a30 100644 --- a/README.md +++ b/README.md @@ -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 git@github.com: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](). -```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:** @@ -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 | diff --git a/core/context_processors.py b/core/context_processors.py index 6d375e2..856924a 100644 --- a/core/context_processors.py +++ b/core/context_processors.py @@ -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), diff --git a/core/snippets.py b/core/snippets.py index 057212c..eebc137 100644 --- a/core/snippets.py +++ b/core/snippets.py @@ -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) diff --git a/core/templatetags/macros.py b/core/templatetags/macros.py index 0ce9d5d..47c6e7a 100644 --- a/core/templatetags/macros.py +++ b/core/templatetags/macros.py @@ -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 = [] @@ -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] diff --git a/dev.env.example b/dev.env.example index 51db07c..f36e406 100644 --- a/dev.env.example +++ b/dev.env.example @@ -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