-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1028 from lucyparsons/develop
OpenOversight `v0.7.0`
- Loading branch information
Showing
309 changed files
with
19,298 additions
and
12,568 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<!-- New Contributor? Welcome! | ||
We recommend you check your privacy settings, so the name and email associated with | ||
the commits are what you want them to be. See the contribution guide at | ||
https://github.com/lucyparsons/OpenOversight/blob/develop/CONTRIB.md#recommended-privacy-settings for more infos. | ||
Also make sure you have read and abide by the code of conduct: | ||
https://github.com/lucyparsons/OpenOversight/blob/develop/CODE_OF_CONDUCT.md | ||
--> | ||
## What issue are you seeing? |
29 changes: 10 additions & 19 deletions
29
PULL_REQUEST_TEMPLATE.md → .github/pull_request_template.md
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,36 +1,27 @@ | ||
<!-- New Contributor? Welcome! | ||
We recommend you check your privacy settings, so the name and email associated with | ||
the commit are what you want them to be. See the contribution guide at | ||
the commits are what you want them to be. See the contribution guide at | ||
https://github.com/lucyparsons/OpenOversight/blob/develop/CONTRIB.md#recommended-privacy-settings for more infos. | ||
Also make sure you have read and abide by the code of conduct: | ||
https://github.com/lucyparsons/OpenOversight/blob/develop/CODE_OF_CONDUCT.md | ||
https://github.com/lucyparsons/OpenOversight/blob/develop/CODE_OF_CONDUCT.md | ||
If this pull request is not ready for review yet, please submit it as a draft. | ||
--> | ||
|
||
## Status | ||
|
||
Ready for review / in progress | ||
## Fixes issue | ||
<!-- LINK YOUR ISSUE HERE --> | ||
|
||
## Description of Changes | ||
|
||
Fixes # . | ||
|
||
Changes proposed in this pull request: | ||
|
||
- | ||
- | ||
- | ||
|
||
## Notes for Deployment | ||
|
||
## Screenshots (if appropriate) | ||
|
||
## Tests and linting | ||
|
||
- [ ] I have rebased my changes on current `develop` | ||
## Screenshots (if appropriate) | ||
|
||
- [ ] pytests pass in the development environment on my local machine | ||
|
||
- [ ] `flake8` checks pass | ||
## Tests and linting | ||
- [ ] This branch is up-to-date with the `develop` branch. | ||
- [ ] `pytest` passes on my local development environment. | ||
- [ ] `pre-commit` passes on my local development environment. |
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 |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: Publish Docker image and deploy it | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
- main | ||
|
||
env: | ||
image_name: lucyparsons/openoversight | ||
# env_mapping: {"develop": "staging", "main": "prod"} | ||
env_name: ${{ fromJson(vars.env_mapping)[github.ref_name] }} | ||
# docker_mapping: {"develop": "latest", "main": "stable"} | ||
docker_name: ${{ fromJson(vars.docker_mapping)[github.ref_name] }} | ||
python_version: "3.11" | ||
|
||
jobs: | ||
push_to_registry: | ||
name: Push Docker image to GitHub Packages | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
contents: read | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v3 | ||
- name: Log in to GitHub Docker Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: https://ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and push image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
file: dockerfiles/web/Dockerfile-prod | ||
push: true | ||
build-args: PYTHON_VERSION=${{ env.python_version }} | ||
# Build the slimmer production target | ||
target: production | ||
tags: | | ||
ghcr.io/${{ env.image_name }}:${{ github.sha }} | ||
ghcr.io/${{ env.image_name }}:${{ env.docker_name }} | ||
ghcr.io/${{ env.image_name }}:${{ env.docker_name }}-py${{ env.python_version }} | ||
deploy: | ||
name: Deploy code to respective server | ||
needs: push_to_registry | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: read | ||
defaults: | ||
run: | ||
shell: bash | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v3 | ||
- name: install fabric | ||
run: pip install fabric2 | ||
- name: setup ssh connection | ||
run: install -m 600 -D /dev/null ~/.ssh/id_ed25519 | ||
# choose SSH key depending on which environment we want to deploy to | ||
- name: ssh key staging | ||
if: ${{ env.env_name == 'staging' }} | ||
run: echo "${{secrets.SSH_STAGING_PRIVATE_KEY}}" > ~/.ssh/id_ed25519 | ||
- name: ssh key prod | ||
if: ${{ env.env_name == 'prod' }} | ||
run: echo "${{secrets.SSH_PROD_PRIVATE_KEY}}" > ~/.ssh/id_ed25519 | ||
# Next three steps use fabric2's "invoke" command which runs tasks defined in tasks.py | ||
- name: backup db | ||
run: invoke backup ${{ env.env_name }} | ||
- name: deploy | ||
run: invoke deploy ${{ env.env_name }} ${{ github.actor }} ${{ secrets.GITHUB_TOKEN }} | ||
- name: cleanup | ||
run: invoke cleanup ${{ env.env_name }} |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Test Coverage | ||
on: | ||
push: | ||
branches: | ||
- develop | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
env: | ||
FLASK_APP: OpenOversight.app | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
python-version: "3.11" | ||
- name: Run tests | ||
run: | | ||
PYTHON_VERSION=${{ matrix.python-version }} make test_with_version | ||
- name: Upload Coverage Results | ||
uses: coverallsapp/github-action@v2 | ||
with: | ||
github-token: ${{ secrets.github_token }} | ||
path-to-lcov: OpenOversight/tests/coverage.xml |
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: CI | ||
|
||
# Controls when the action will run. | ||
on: | ||
pull_request: | ||
branches: | ||
- develop | ||
- main | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
build: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-20.04 | ||
env: | ||
FLASK_APP: OpenOversight.app | ||
strategy: | ||
matrix: | ||
python-version: ["3.11"] | ||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v3 | ||
- name: Run tests | ||
run: PYTHON_VERSION=${{ matrix.python-version }} make test_with_version | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
- uses: pre-commit/action@v3.0.0 |
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.