Skip to content

Commit ab96e78

Browse files
Merge pull request #250 from datamade/add-wagtail-cookiecutter
Implemented wagtail cookiecutter
2 parents 375a67a + 558c7ad commit ab96e78

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+2818
-0
lines changed

.DS_Store

8 KB
Binary file not shown.

docker/.DS_Store

6 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"app_name": "new-project",
3+
"module_name": "project",
4+
"app_verbose_name": "Site Name"
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module.exports = {
2+
globals: {
3+
__PATH_PREFIX__: true,
4+
},
5+
extends: `react-app`,
6+
rules: {
7+
"indent": ["error", 2],
8+
"no-console": "off",
9+
"strict": ["error", "global"],
10+
"curly": "warn",
11+
"semi": ["error", "never"],
12+
"space-in-parens": ["error", "never"],
13+
"space-before-function-paren": ["error", "always"],
14+
"space-before-blocks": ["error", "always"]
15+
}
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
## Overview
2+
3+
Brief description of what this PR does, and why it is needed.
4+
5+
Closes #XXX
6+
7+
### Demo
8+
9+
Optional. Screenshots, `curl` examples, etc.
10+
11+
### Notes
12+
13+
Optional. Ancillary topics, caveats, alternative strategies that didn't work out, anything else.
14+
15+
## Testing Instructions
16+
17+
* How to test this PR
18+
* Prefer bulleted description
19+
* Start after checking out this branch
20+
* Include any setup required, such as bundling scripts, restarting services, etc.
21+
* Include test case, and expected output
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- deploy
8+
pull_request:
9+
branches:
10+
- main
11+
12+
jobs:
13+
test:
14+
name: Run tests
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v1
18+
- shell: bash
19+
run: |
20+
cp .env.example .env
21+
- name: Build containers and run tests
22+
run: docker-compose -f docker-compose.yml -f tests/docker-compose.yml run --rm app
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Publish Docker image
2+
on:
3+
workflow_dispatch:
4+
jobs:
5+
push_to_registry:
6+
name: Push Docker image to GitHub Packages
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Login to GitHub Container Registry
10+
uses: docker/login-action@v1
11+
with:
12+
registry: ghcr.io
13+
username: {% raw %}${{ github.actor }}{% endraw %}
14+
password: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}
15+
- name: Push to GitHub Packages
16+
uses: docker/build-push-action@v2
17+
with:
18+
push: true
19+
tags: ghcr.io/{% raw %}${{ github.repository }}{% endraw %}:latest
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
.DS_Store
2+
3+
out.txt
4+
/data/final/*.csv
5+
/data/shapefiles/*
6+
/data/intermediate/*.sql
7+
8+
# Byte-compiled / optimized / DLL files
9+
__pycache__/
10+
*.py[cod]
11+
*$py.class
12+
13+
# C extensions
14+
*.so
15+
16+
# Distribution / packaging
17+
.Python
18+
build/
19+
develop-eggs/
20+
dist/
21+
downloads/
22+
eggs/
23+
.eggs/
24+
lib/
25+
lib64/
26+
parts/
27+
sdist/
28+
var/
29+
wheels/
30+
*.egg-info/
31+
.installed.cfg
32+
*.egg
33+
MANIFEST
34+
35+
# PyInstaller
36+
# Usually these files are written by a python script from a template
37+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
38+
*.manifest
39+
*.spec
40+
41+
# Installer logs
42+
pip-log.txt
43+
pip-delete-this-directory.txt
44+
45+
# Unit test / coverage reports
46+
htmlcov/
47+
.tox/
48+
.coverage
49+
.coverage.*
50+
.cache
51+
nosetests.xml
52+
coverage.xml
53+
*.cover
54+
.hypothesis/
55+
.pytest_cache/
56+
57+
# Translations
58+
*.pot
59+
60+
# Django stuff:
61+
*.log
62+
local_settings.py
63+
db.sqlite3
64+
65+
# Flask stuff:
66+
instance/
67+
.webassets-cache
68+
69+
# Scrapy stuff:
70+
.scrapy
71+
72+
# Sphinx documentation
73+
docs/_build/
74+
75+
# PyBuilder
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# pyenv
82+
.python-version
83+
84+
# celery beat schedule file
85+
celerybeat-schedule
86+
87+
# SageMath parsed files
88+
*.sage.py
89+
90+
# Environments
91+
.env
92+
.venv
93+
env/
94+
venv/
95+
ENV/
96+
env.bak/
97+
venv.bak/
98+
99+
# Spyder project settings
100+
.spyderproject
101+
.spyproject
102+
103+
# Rope project settings
104+
.ropeproject
105+
106+
# mkdocs documentation
107+
/site
108+
109+
# mypy
110+
.mypy_cache/
111+
112+
# Compiled JavaScript
113+
node_modules/
114+
efi/static/compressor/*
115+
!efi/static/js/lib/
116+
117+
# Local uploads
118+
media/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Extend the base Python image
2+
# See https://hub.docker.com/_/python for version options
3+
# N.b., there are many options for Python images. We used the plain
4+
# version number in the pilot. YMMV. See this post for a discussion of
5+
# some options and their pros and cons:
6+
# https://pythonspeed.com/articles/base-image-python-docker-images/
7+
FROM python:3.9
8+
9+
# Give ourselves some credit
10+
LABEL maintainer "DataMade <[email protected]>"
11+
12+
# Add the NodeSource PPA
13+
# (see: https://github.com/nodesource/distributions/blob/master/README.md)
14+
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
15+
16+
# Install any additional OS-level packages you need via apt-get. RUN statements
17+
# add additional layers to your image, increasing its final size. Keep your
18+
# image small by combining related commands into one RUN statement, e.g.,
19+
#
20+
RUN apt-get update && \
21+
apt-get install -y --no-install-recommends gettext postgresql-client nodejs gdal-bin postgis
22+
#
23+
# Read more on Dockerfile best practices at the source:
24+
# https://docs.docker.com/develop/develop-images/dockerfile_best-practices
25+
# RUN apt-get install -y --no-install-recommends postgresql-client nodejs gdal-bin
26+
27+
# Inside the container, create an app directory and switch into it
28+
RUN mkdir /app
29+
WORKDIR /app
30+
31+
# Copy the requirements file into the app directory, and install them. Copy
32+
# only the requirements file, so Docker can cache this build step. Otherwise,
33+
# the requirements must be reinstalled every time you build the image after
34+
# the app code changes. See this post for further discussion of strategies
35+
# for building lean and efficient containers:
36+
# https://blog.realkinetic.com/building-minimal-docker-containers-for-python-applications-37d0272c52f3
37+
COPY ./requirements.txt /app/requirements.txt
38+
RUN pip install --no-cache-dir -r requirements.txt
39+
40+
# Install Node requirements
41+
COPY ./package.json /app/package.json
42+
RUN npm install
43+
44+
# Copy the contents of the current host directory (i.e., our app code) into
45+
# the container.
46+
COPY . /app
47+
48+
# Add a bogus env var for the Django secret key in order to allow us to run
49+
# the 'collectstatic' management command
50+
ENV DJANGO_SECRET_KEY 'foobar'
51+
# Add a bogus env var for Debug to make sure that Django compressor can run
52+
ENV DJANGO_DEBUG 'False'
53+
54+
# Build static files into the container
55+
RUN python manage.py collectstatic --noinput
56+
RUN python manage.py compress

0 commit comments

Comments
 (0)