-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: merge branch 'main' and resolve conflicts
- Loading branch information
Showing
109 changed files
with
2,307 additions
and
962 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,39 @@ | ||
<p align="center"> | ||
<img src="https://github.com/sixfeetup/cookiecutter-sixiedjango/assets/784273/4e378983-c351-4656-95b9-b5c38d70991d" width="450px"> | ||
<img src="{{cookiecutter.project_slug}}/frontend/public/scaf-logo.png" width="250px"> | ||
</p> | ||
|
||
**scaf** provides developers and DevOps engineers with a complete blueprint for | ||
a new project and streamlines the development experience with Tilt. | ||
|
||
**scaf** generates a new project structure with Kubernetes manifests in | ||
three Kustomize layers for dev, sandbox, and production. A new project | ||
three Kustomize layers for dev, sandbox, and production. A new project | ||
contains the following: | ||
* NextJS or React frontend | ||
* Django backend | ||
* Postgres database for local development | ||
* CloudNativePG deployment for production | ||
* Redis | ||
* Mailhog | ||
* ArgoCD | ||
* Traefik | ||
* Certmanger | ||
* Certificates and Ingress Routes | ||
* Kube Prometheus Stack | ||
* Grafana Loki | ||
* GitHub and Bitbucket pipelines to build and push images, run security, | ||
formatting and linting checks | ||
* Terraform config to set up a k3s cluster on AWS | ||
|
||
- Django backend | ||
- Celery (optional) | ||
- Next.js frontend (optional) | ||
- Strawberry GraphQL (if frontend is chosen) | ||
- Apollo Client (if frontend is chosen) | ||
- _TODO: REST alternative to GraphQL_ | ||
- Postgres database for local development | ||
- CloudNativePG deployment for production | ||
- Redis | ||
- Mailhog | ||
- ArgoCD | ||
- Traefik | ||
- Certmanger | ||
- Certificates and Ingress Routes | ||
- Kube Prometheus Stack | ||
- Grafana Loki | ||
- GitHub and Bitbucket pipelines to build and push images, run security, | ||
formatting and linting checks | ||
- Terraform config to set up a k3s cluster on AWS | ||
- Sentry (optional) | ||
|
||
## Installation | ||
|
||
Installation is supported on Linux and macOS: | ||
|
||
``` | ||
curl -sSL https://raw.githubusercontent.com/sixfeetup/scaf/main/install.sh | sh | ||
``` | ||
|
@@ -36,6 +43,10 @@ be found on your system. | |
|
||
## Creating a new project using this repo | ||
|
||
NB: Before you continue, make sure that you have at least 5 to 10 GB of free | ||
space available to Docker. Note that Docker Desktop on MacOS has its own | ||
resource limits separate from the host. | ||
|
||
Run `scaf myproject`, answer all the questions, and you'll have your new project! | ||
|
||
Inside `myproject/README.md`, you will have more | ||
|
@@ -45,8 +56,9 @@ documentation explaining how to use and configure your newly created project. | |
|
||
To deploy your project using Terraform and AWS, you can follow the instructions in `terraform/README.md.` | ||
Note that you will need: | ||
|
||
- an AWS account where you have access to the `OrganizationAccountAccessRole` | ||
- terraform, and AWS CLI installed and configured | ||
- terraform, and AWS CLI installed and configured | ||
|
||
## Development on Scaf | ||
|
||
|
@@ -57,7 +69,7 @@ The Nix Flake ensures all developers are using the same versions of all packages | |
to develop on Scaf in an isolated environment. | ||
|
||
Follow the instructions to install | ||
[Nix](https://nixos.org/download/#download-nix) for your OS. | ||
[Nix](https://nixos.org/download/#download-nix) for your OS. | ||
|
||
Nix Flakes are a feature that comes with Nix, but they are considered | ||
experimental and are not enabled by default in stable releases of Nix. To use | ||
|
@@ -111,64 +123,20 @@ When making changes to scaf, keep the following in mind: | |
- update to the latest Python supported by Django. For Django 4.1, this is 3.8, 3.9, and 3.10. | ||
|
||
### Testing | ||
To test the cookiecutter portion of scaf, create virtual environment ad install black, isort and cookiecutter. | ||
Create a test cookiecutter.yaml file with the following content: | ||
```yaml | ||
--- | ||
default_context: | ||
author_name: Joe Sixie | ||
aws_account_id: "000000000000" | ||
aws_region: us-east-1 | ||
create_nextjs_frontend: y | ||
debug: n | ||
description: Behold My Awesome Project! | ||
domain_name: sixfeetup.com | ||
email: [email protected] | ||
mail_service: Mailgun | ||
project_dash: my-awesome-sixie-project | ||
project_name: My Awesome Sixie Project | ||
project_slug: my_awesome_sixie_project | ||
repo_name: my_awesome_sixie_project | ||
repo_url: [email protected]:sixfeetup/my_awesome_sixie_project.git | ||
source_control_organization_slug: sixfeetup | ||
source_control_provider: github.com | ||
timezone: US/Eastern | ||
use_celery: n | ||
use_graphql: y | ||
use_sentry: n | ||
version: 0.1.0 | ||
|
||
``` | ||
|
||
Then create a helper script to run the tests: | ||
```bash | ||
#! /bin/bash | ||
To test the cookiecutter portion of Scaf, run the `./test-scaf.sh` script. | ||
|
||
SCAF_ROOT=/Users/gfranxman/sfu/ScafDev/scaf | ||
OUTPUT_FOLDER=./scaf-test | ||
TEST_CONFIG=./scaf-cookiecutter.yaml | ||
If you are not using the Nix development environment, create a virtual environment and | ||
install black, isort and cookiecutter before running `./test-scaf.sh`. | ||
|
||
rm -rf $OUTPUT_FOLDER && cookiecutter $SCAF_ROOT --no-input --config-file $TEST_CONFIG -o $OUTPUT_FOLDER -v | ||
Running `./test-scaf.sh -h` shows the usage instructions: | ||
|
||
```shell | ||
Usage: ./test-scaf.sh [-b <branch_name>] [-o <output_folder>] [-c <config_file>] [-h] | ||
-b <branch_name> Optional: Specify the branch to test (default is local checkout) | ||
-o <output_folder> Optional: Specify the output folder (default is /tmp/scaf-test) | ||
-c <config_file> Optional: Specify the config file (default is ./test-configs/nextjs-django-github.yaml) | ||
-h Show this help message | ||
``` | ||
|
||
Run the script and check the output folder for the generated project. | ||
|
||
To test run the project using your branch for scaf and the cookiecutter you have to tell it | ||
which branch and repo to use. Here is an example script to do that: | ||
|
||
(You will need to adjust the paths and branch name to match your setup): | ||
```bash | ||
#! /bin/bash | ||
|
||
SCAF_ROOT=/Users/gfranxman/sfu/ScafDev/scaf | ||
OUTPUT_FOLDER=./scaf-test | ||
TEST_CONFIG=./scaf-cookiecutter.yaml | ||
|
||
BRANCH_NAME=gfranxman/configure-git-remote | ||
BASE_REPO=https://github.com/sixfeetup/scaf.git | ||
|
||
|
||
rm -rf $OUTPUT_FOLDER && \ | ||
$SCAF_ROOT/scaf myproject --no-input --checkout $BRANCH_NAME ${BASE_REPO} | ||
``` | ||
Feel free to add more useful test configurations to `./test-configs/`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.