-
Notifications
You must be signed in to change notification settings - Fork 17
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 #173 from fga-eps-mds/release/v0.2.0
Release/v0.2.0
- Loading branch information
Showing
57 changed files
with
2,173 additions
and
214 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
DATABASE_USER=postgres | ||
DATABASE_PASSWORD= | ||
DATABASE_NAME=postgres | ||
DATABASE_HOST=db | ||
DATABASE_PORT=5432 | ||
HOST=http://localhost:8000/ |
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,7 @@ | ||
|
||
DATABASE_USER=${{secrets.DATABASE_USER}} | ||
DATABASE_PASSWORD=${{secrets.DATABASE_PASSWORD}} | ||
DATABASE_NAME=${{secrets.DATABASE_NAME}} | ||
DATABASE_HOST=${{secrets.DATABASE_HOST}} | ||
DATABASE_PORT=5432 | ||
PORT=8000 |
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,30 @@ | ||
name: CD | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
env: | ||
HEROKU_API_KEY: ${{secrets.HEROKU_API_KEY}} | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: setup environment | ||
run: docker build -t acacia-back-heroku . | ||
- name: Run container | ||
run: docker run -d -p 8000:8000 --env-file .env-staging acacia-back-heroku | ||
- name: heroku container push | ||
uses: actions/heroku@master | ||
with: | ||
args: "container:login" | ||
- name: heroku container push | ||
uses: actions/heroku@master | ||
with: | ||
args: "container:push web -a acacia-backend-staging" | ||
- name: heroku container release | ||
uses: actions/heroku@master | ||
with: | ||
args: "container:release web -a acacia-backend-staging" |
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 |
---|---|---|
|
@@ -17,7 +17,7 @@ jobs: | |
- name: Setup enviroment | ||
run: docker-compose up -d --build | ||
- name: Run tests | ||
run: docker exec acacia_backend bash -c "cd src/ && coverage run manage.py test && coverage xml -o cov.xml" | ||
run: docker exec acacia_backend bash -c "coverage run manage.py test && coverage xml -o cov.xml" | ||
- name: Upload coverage to Codecov | ||
uses: codecov/[email protected] | ||
with: | ||
|
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,14 @@ | ||
name: style | ||
|
||
on: push | ||
|
||
jobs: | ||
style-check: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@master | ||
- name: Setup enviroment | ||
run: docker-compose up -d --build | ||
- name: Run linter | ||
run: docker exec acacia_backend bash -c "flake8" |
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import os | ||
from django.urls import path | ||
from rest_framework import status | ||
from rest_framework.views import APIView | ||
from rest_framework.response import Response | ||
from rest_framework.permissions import AllowAny | ||
|
||
|
||
def list_all_endpoints(urlpatterns, app_name=None): | ||
|
||
class ListAllEndpoints(APIView): | ||
permission_classes = (AllowAny,) | ||
|
||
def get(self, request, format=None): | ||
link = os.environ.get('HOST') | ||
endpoints = {} | ||
|
||
for url in urlpatterns: | ||
url = url.pattern._route[:-1] | ||
|
||
if url: | ||
|
||
if app_name: | ||
endpoints[url] = f"{link}{app_name}/{url}/" | ||
|
||
else: | ||
endpoints[url] = f"{link}{url}/" | ||
|
||
return Response(endpoints, status=status.HTTP_200_OK) | ||
|
||
urlpatterns += [ | ||
path('', ListAllEndpoints.as_view()), | ||
] | ||
|
||
return urlpatterns |
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,22 +1,14 @@ | ||
"""acacia URL Configuration | ||
The `urlpatterns` list routes URLs to views. For more information please see: | ||
https://docs.djangoproject.com/en/2.2/topics/http/urls/ | ||
Examples: | ||
Function views | ||
1. Add an import: from my_app import views | ||
2. Add a URL to urlpatterns: path('', views.home, name='home') | ||
Class-based views | ||
1. Add an import: from other_app.views import Home | ||
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') | ||
Including another URLconf | ||
1. Import the include() function: from django.urls import include, path | ||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) | ||
""" | ||
from django.contrib import admin | ||
from django.urls import path, include | ||
from .helpers import list_all_endpoints | ||
|
||
|
||
urlpatterns = [ | ||
path('admin/', admin.site.urls), | ||
path('users/', include('users.urls')), | ||
] | ||
path('harvests/', include('harvest.urls')), | ||
path('properties/', include('property.urls')), | ||
] | ||
|
||
|
||
urlpatterns = list_all_endpoints(urlpatterns) |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from django.contrib import admin | ||
from .models import Harvest, RulesHarvest | ||
|
||
|
||
class HarvestAdmin(admin.ModelAdmin): | ||
list_display = ( | ||
'date', | ||
'description', | ||
'status', | ||
'equipment', | ||
) | ||
|
||
|
||
admin.site.register(Harvest) | ||
admin.site.register(RulesHarvest) |
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,5 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class HarvestConfig(AppConfig): | ||
name = 'harvest' |
Oops, something went wrong.