Wagtail CMS
Wagtail is an open source CMS built in Python.
Configure Tugboat
The Tugboat configuration is managed by a YAML file at
.tugboat/config.yml in your git repository. For the full config file, along with installation instructions, please see
the corresponding GitHub repository for configuring Wagtail on Tugboat.
1services:
2 # Set the hostname
3 python:
4 image: tugboatqa/debian
5 # In case multiple services are installed.
6 default: true
7 commands:
8 init:
9 - apt-get update && apt-get install python3 python3-pip python3-venv
10 - python3 -m venv mysite/env
11 - . mysite/env/bin/activate
12 - pip3 install wagtail
13 - wagtail start mysite mysite
14 - cd mysite && pip3 install -r requirements.txt
15 - cd mysite && python3 manage.py migrate
16 # Create the admin user. The password could also be
17 # stored as a Tugboat environment variable.
18 - cd mysite && echo "from django.contrib.auth import get_user_model; User = get_user_model();
19 User.objects.create_superuser('admin', 'root@localhost', 'tugboat')" | python3 manage.py shell
20 # Cleanup to reduce disk space
21 - apt-get clean
22 - rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
23
24 start:
25 # Run on the default Tugboat port.
26 - cd mysite && python3 manage.py runserver 0.0.0.0:80 &
27# Optionally install a redis cache.
28# redis:
29# image: tugboatqa/redis
30
31# Optionally install Elasticsearch.
32# elasticsearch:
33# image: tugboatqa/elasticsearchNote that this config builds a Wagtail site from scratch. You’ll likely want to deploy Tugboat into an existing site, so
additional steps will be needed to import your database and file assets into the build. One way you can do this by
importing the Tugboat Repository’s SSH key to the
server hosting your site’s data and then using scp for import. Here’s an
example with mysql.
Want to know more about something mentioned in the comments of this config file? Check out these topics:
- Name your Service
- Specify a Service image
- Leverage Service commands
- Define a default Service
- Preview build process phases (
init,update,build)
Start Building Previews!
Once this Tugboat configuration file is committed to your git repository, you can start building previews!