Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
gone committed Mar 11, 2022
0 parents commit f326616
Show file tree
Hide file tree
Showing 175 changed files with 42,801 additions and 0 deletions.
88 changes: 88 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
version: 2.1
orbs:
python: circleci/[email protected]
node: circleci/[email protected]
heroku: circleci/[email protected]
codecov: codecov/[email protected]
slack: circleci/[email protected]
test-runner: ghostinspector/[email protected]
jobs:
test-django:
docker:
- image: cimg/python:3.10.1-browsers
- image: cimg/postgres:14.1
environment:
POSTGRES_USER: ubuntu
POSTGRES_DB: circle_test

- image: cimg/redis:6.2.6
environment:
DATABASE_URL: "psql://ubuntu:@localhost/circle_test"
DJANGO_SETTINGS_MODULE: sampleapp.config.settings.test
DJANGO_SECRET_KEY: "!!!! Change me !!!!"
DJANGO_DEBUG: False
REDIS_URL: redis://localhost:6379

working_directory: /home/circleci/project
steps:
- checkout
- node/install-packages:
pkg-manager: npm
- run: npm run build
- python/install-packages:
pkg-manager: poetry
- run: poetry run pre-commit run --all-files
- run: poetry run playwright install
- run: poetry run coverage run --source='.' manage.py test
- store_test_results:
path: test_reports
- run: poetry run coverage xml
- codecov/upload
- slack/status:
fail_only: true
channel: "#sampleapp-internal"
only_for_branches: develop,main

sentry: #issue a new sentry release
docker:
- image: cimg/base:2020.01
steps:
- checkout
- run: curl -sL https://sentry.io/get-cli/ | bash # install sentry cli
- run: sentry-cli releases new -p sampleapp $CIRCLE_SHA1
- run: sentry-cli releases set-commits --auto $CIRCLE_SHA1
- run: sentry-cli releases finalize $CIRCLE_SHA1


workflows:
version: 2.1
deploy:
jobs:
- test-django:
context: lightmatter

# - sentry:
# name: sentry-prod
# context: lightmatter
# requires:
# - deploy-prod
# filters:
# branches:
# only: main

# - sentry:
# name: sentry-dev
# context: lightmatter
# requires:
# - deploy-dev
# filters:
# branches:
# only: develop




# - ghostinspector:
# context: lightmatter
# requires:
# - deploy-dev
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.pyc
*.pyo
/.env
/.venv/
/node_modules
/sampleapp/static
.DS_Store
.editorconfig
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true


[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4

[*.{js,html,css,yml,xml,scss,json,ts}]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false
20 changes: 20 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
PYTHONBREAKPOINT="pudb.set_trace"
ENV_NAME="sampleapp"

DATABASE_URL="psql://sampleapp:sampleapp@localhost/sampleapp"
REDIS_URL="redis://localhost:6379"
DJANGO_SETTINGS_MODULE="sampleapp.config.settings.local"
DJANGO_SECRET_KEY="!!!! Change me !!!!"
DJANGO_DEBUG=True

#required settings for prod to run, sometimes helpful to set locally to run local w/ prod settings
REDIS_HOST=""
REDIS_PORT=""
SENTRY_DSN=""
DJANGO_ALLOWED_HOSTS="127.0.0.1,localhost"
DJANGO_AWS_ACCESS_KEY_ID=""
DJANGO_AWS_SECRET_ACCESS_KEY=""
DJANGO_AWS_STORAGE_BUCKET_NAME=""
DJANGO_AWS_S3_ENDPOINT_URL=""
DJANGO_SECURE_SSL_REDIRECT=False
DJANGO_SECURE_HSTS_SECONDS=0
16 changes: 16 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
layout_poetry() {
if [[ ! -f pyproject.toml ]]; then
log_error 'No pyproject.toml found. Use `poetry new` or `poetry init` to create one first.'
exit 2
fi

# create venv if it doesn't exist
poetry run true

export VIRTUAL_ENV=$(poetry env info --path)
export POETRY_ACTIVE=1
PATH_add "$VIRTUAL_ENV/bin"
}

layout poetry
dotenv .env
34 changes: 34 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
module.exports = {
"env": {
"browser": true,
"es2021": true
},
"extends": [
"plugin:@typescript-eslint/recommended",
"airbnb-base"
],
"parserOptions": {
"ecmaVersion": 13,
"parser": "@typescript-eslint/parser",
"sourceType": "module",
"project": ['./tsconfig.json']
},
"plugins": [
"@typescript-eslint"
],
"settings": {
"import/resolver": {
alias: {
map: [
["@", "./frontend"],
],
}
}
},
"rules": {
"@typescript-eslint/no-unused-vars": "error",
"no-unused-vars": 0,
"import/no-absolute-path": 0,
"quotes": ["error", "double", { "avoidEscape": true }]
},
};
Loading

0 comments on commit f326616

Please sign in to comment.