Skip to content

Commit

Permalink
Ready for Production / Release v0.0.3 (#384)
Browse files Browse the repository at this point in the history
* add update cotroller fnction

* getting new changes from this branch

* Able to update App information

* Able to update  services and env variables

* Finish all project update fields

* Remove project_id field from api docs

* Remove duplicate user project app route

* Increase token expiry time

* Backend resource cleanup for removing organisations, orgnisation_members and organisation_admins

* Add github authentication route

* change route from github_auth to oauth

* remove linter changes

* Fix dependency issue

* remove pycrypt dependency

* Add linting

* handle null email

* fix null git name issue

* feat: add db stats

* refactor: improve effeciency by reducing loops

* feat: add cluster count stats metadata

* feat: add summary status stats to deployments

* Add env variables and command to app detail info

* Add new user graph data

* feat: create graph data for apps

* refactor graph method implementation

* change graph method to class method

* Remove old configs (#261)

* Add organisation and project_type to project

* Enhancements (#263)

* edit config to source db variables from env

* add small nits to README file

* add updates to README, source variables in config file

* revert and only keep READme changes

* env alternative from .env in config

* edit READMe

* small nit

* feat: tag beta users (#265)

* feat: tag beta users

* correct typo

* Update app creation controllers (#266)

* update app schema fields

* update app creation controller, appschema

* update api docs

* update documentation

* Fix circleci build (#268)

* fix database password creation error

* edit circleci config

* small nit for perm

* update app update ingress rules (#269)

* add custom domain field to app model (#270)

* Let Apps and projects get deleted if the cluster doesnot exist (#271)

* Revert from custom domain to cc domain (#272)

* add revert custom domain endpoint

* Add revert url route

* remove redundant print statement

* remove duplication

Co-authored-by: mubangizi <mubangizia22@gmail.com>

* update app has custom domain status, update api docs, routes (#273)

* Add Authorization to roles endpoints (#277)

* Setup Pytest (#278)

* add pytest fixtures

* clean up test and report job

* add database fixture, functional tests

* Fix app update bug (#279)

* Add custom domain validation

* Add functionality to retrieve evn failed apps

* Remove custom domain commented code

* Add beta user check on app creation and up update

* Fix celery version issue (#283)

* bump celery requirement

* celery version

* GitHub workflow run tests and linter (#280)

* run tests and linter before pushing changes to repository

* skip linting

* clean versions

* remove redundant flake 8 requirement

* add warnings flag to workflow

* modify pytest run command

* delete redundant file

* define env in workflow

* edit app config name

* Add admin custom db route

* Extend database models(Billing) (#285)

* - add billing invoice model

* - add billing metrics model

* - add user payment details model

* - billing invoice schema

* - add models to manager module

* - update migrations with chnages

* CI/CD Revamp (#286)

* Test workflow should run on all pushes and PRs.

* Add staging workflow

* Add staging values file.

* Fix action reference.

* Remove not yet defined action.

* Specify namespace on rollout status.

* Remove circleci config.

* Restrict branch

* refactor: remove db status check on admin endpoint for retrieving all dbs

* Store transaction record on success (#287)

* - create transaction model and register in manage
module

* add transaction record schema

* add migrations

* - add transaction record endpoint

* - update api docs

* - register controller

* - register transaction route

* - small shema refactor

* add date created field

* - add date created field

* Add production workflows. (#289)

* Show user transactions and transaction detail (#291)

* - add user transactions view

* - add user transaction api docs

* - add transaction record detail

* - add route

* - add docs

* - update api docs

* - modify routes

* - refactor transactions endpoint

* - extend project model

* - extend model

* - update schema

* - update migrations

* fix failing post transcation route (#293)

* update transaction status (#294)

* Add billing cost endpoint (#292)

* Fix Migrations. (#295)

* Remove problematic migration(08246b2fe16f)

* Remove problematic migration(f4f92e)

* Update down_revision

* Create 011c3345849a_.py

* Add the prometheus url to a cluster (#296)

* Attach prometheus to cluster model

* Remove unused import

* Update kubernetes version and fix Ingress (#297)

* Update kubernetes version

* Remove unwanted migrations

* Add Celery to requirements.txt

* Fix app update route (#300)

* Client Invoice Integration (#298)

* - billing invoice endpoint pseudocode

* ft: create send invoice email functionality

* refactor invoice email

* - add live data integration for invoice

* - small nits

* - model change

* auto date cashed

* migrations

* Fix failing import and migration

* update html

* migration update

* schema and project model update

* - generate receipts and new invoices

Co-authored-by: MutegekiHenry <henrymutegeki117@gmail.com>
Co-authored-by: mubangizi <mubangizia22@gmail.com>

* Add string checker for app url on revert app url route (#301)

* refactor:add date to transcation payload (#303)

* Ft invoice details (#302)

* small nit

* get billing invoices list

* document endpoint

* add invoice detail view

* document invoice detail view

* - handle edge cases

* Added content to invoice email and gave the table more padding to give items more space for readability (#304)

* update staging variables, circleci migration (#307)

* update staging variables, circleci migration

* - delete circleci directory

* Get Receipt details (#306)

* small nit

* get billing invoices list

* document endpoint

* add invoice detail view

* document invoice detail view

* - handle edge cases

* - add receipts schema

* - receipts detail api

* - add routes and api docs

* - clean up

* small refactor

* add date field

* Ft add monitoring modules (#305)

* Add clusters statuses

* Add clusters statuses

* Add prometheus status

* Add database statuses

* Add cranecloud apps status

* Add mira status

* Remove auth

* On the invoice, formatted date for more readability and also added currency symbol to the amount. (#308)

* Change invoice email to include invoice id, remove project id and add change name label to user name (#311)

* Add cost modal url to cluster (#309)

* Add cost modal url to cluster

* Remove commented urls

* add credits models (#312)

* add credits models

* update model rlshp

* Fix failed test

Co-authored-by: Henry Mutegeki <hmutegeki@Henrys-MacBook-Pro.local>

* ft: add credits to user object on fetch all users (#313)

Co-authored-by: Henry Mutegeki <hmutegeki@Henrys-MacBook-Pro.local>

* created controllers and endpoints for credits (#314)

* retrieve user credit record (#315)

Co-authored-by: Henry Mutegeki <hmutegeki@Henrys-MacBook-Pro.local>

* added endpoint to get a users credit records (#316)

* Add trailing Invoice notifications (#317)

* Add user notification

* Fix invoice quering logic

* Remove comments

* Remmove unnecessary characters from db password (#318)

* Project cost values(Kubecost) (#319)

* - use kubecost data on billing invoice

* better edge case handling

* refactor

* add payments with credits (#321)

* add name to the user object on login (#322)

Co-authored-by: Henry Mutegeki <hmutegeki@Henrys-MacBook-Pro.local>

* Add ugx value to billing info (#324)

* Add Celery task for sending user invoices

* added feature to send email to user on assignment (#326)

* Ft refactor friendly invoice (#323)

* Made invoice id readable and in the format CCYY-a1b2c3d4e

* Made requested changes

* Delete 4bd21f73a577_.py

Was not supposed to be pushed

* added changes to email notification (#328)

* Added feater for credits expiration with celery (#331)

* Added feater for credits expiration with celery

* added change from pull request

* added change from pull request

* Added scheduler for notification of credits expiration (#333)

* Added feature where credits now expire based on usage as well (#334)

* Add project collaboration (#339)

* Create project users CRUD

* Change to use user emails instead of user ids

* Add Permissions to Projects, Apps and databases

* Add user project transfer

* Fix permissions checker function

* add owner role at project creation

* Separated promotional credits from purchased credits (#337)

* Separated promotional credits from purchased credits

* update celery scheduler to midnight

* Fix staging build (#340)

* add a celery version

* alter celery version

* fix conflicting ranges

* specify celery version

* refactor celery instance name

* introduce absolute imports

* absolute import at celery init

* move future import to file beginning

* remove future imports

* add importlib-metadata

* cleanup

* Fix migrations (#345)

* fix db uri

* edit down revision to avoid conflict

* Refactor promotional and purchased credits (#346)

* fix db uri

* edit down revision to avoid conflict

* new migration for purchased and promotion credit name change

* refactor purchase, promotion credit names

* Fix migrations (#347)

* fix db uri

* edit down revision to avoid conflict

* new migration for purchased and promotion credit name change

* refactor purchase, promotion credit names

* makes fields nullable

* small refactor db name

* migration revision for nullable field

* make fields nullable

* delete redundant migration

* add branch deployment

* revert changes

* make columns nullable

* remove temporary deplyment branch

* Ft update links (#348)

* Updated links to dashboard for credit expiry and credit assignment email notifications

* updated link in credit_expiration

* Ft notify user to project (#349)

* notifications to users for role on projects

* revert change

* changed spelling email notification

* Add user login and creation tests (#350)

* Add user login and creation tests

* add postgres db service to github actions

* revert to investigate test run

* test run with db service

* test db uri variable

* db url parsing

* formatting

* configure jwt secret

* remove jwt secret config

* comment out failing tests to test work flow

* add test db env variables

* test deployment after tests

* remove test deployment branch

Co-authored-by: e-ian <ianemma70@gmail.com>

* credit purchase transaction (#351)

* Setup logging (#354)

* add pymongo requirement

* add mongo connection client and document helper function

* time helper function

* apply to project function

* add requirements

* test deploy

* fix pymongo version

* downgrade zipp requirement

* back roll deployment from pull request

* test to deploy

* roll back staging deployment test

* Remove azure/helm-setup action.

* test staging deployment

* roll back test staging deployment

Co-authored-by: Innocent Asiimwe <asiimwe@outlook.com>

* Add user tests (#353)

* Add user login and creation tests

* add postgres db service to github actions

* revert to investigate test run

* test run with db service

* test db uri variable

* db url parsing

* formatting

* configure jwt secret

* remove jwt secret config

* comment out failing tests to test work flow

* add test db env variables

* test deployment after tests

* remove test deployment branch

* Add user tests

* add secrets to conftest

* small refactor

* test deployment on staging

* abstract test secret

* set app test secret in config

* revert testing config changes

* hard code testing secret

* roll back staging deploy on branch

Co-authored-by: e-ian <ianemma70@gmail.com>

* Adding tests for credit assignments endpoint (#356)

* Adding tests for credit assignments endpoint

* remove unused init file

* added more tests

* Configure test report (#359)

* add coverage requirement

* add test report generation to pipeline

* update test coverage badge

* integrate pull request report

* test staging deploy

* test build badge

* adding staging build badge

* roll back staging test deploy

* Create logger function (#355)

* Add logger function

* Add default value for MONGO_URL

* Remove action calls from project controller

Co-authored-by: mubangizi <mubangizi22@gmail.com>

* Fix build workflow (#364)

* fix build version and test deploy

* revert staging test build

* ft user collaboration: handle anonymous users invitations (#357)

* ft user collaboration: handle anonymous users invitations

* Adding tests for credit assignments endpoint (#356)

* Adding tests for credit assignments endpoint

* remove unused init file

* added more tests

* work on pr feedback: reformat email

* Configure test report (#359)

* add coverage requirement

* add test report generation to pipeline

* update test coverage badge

* integrate pull request report

* test staging deploy

* test build badge

* adding staging build badge

* roll back staging test deploy

* ft user collaboration: handle anonymous users invitations

* work on pr feedback: reformat email

* Create logger function (#355)

* Add logger function

* Add default value for MONGO_URL

* Remove action calls from project controller

Co-authored-by: mubangizi <mubangizi22@gmail.com>

* add extra checks on transitioning anonymous user to real user

* fix failing tests: add missing package

* Fix build workflow (#364)

* fix build version and test deploy

* revert staging test build

* ft user collaboration: handle anonymous users invitations

* work on pr feedback: reformat email

* ft user collaboration: handle anonymous users invitations

* rebase develop-new

* add extra checks on transitioning anonymous user to real user

Co-authored-by: Henry Mutegeki <hmutegeki@Henrys-MacBook-Pro.local>
Co-authored-by: bashaashma <bashaashma@gmail.com>
Co-authored-by: e-ian <36891299+e-ian@users.noreply.github.com>
Co-authored-by: Mubangizi Allan <mubangizia22@gmail.com>
Co-authored-by: mubangizi <mubangizi22@gmail.com>

* implemented user activities logs (#362)

* implemented user activities logs

* Fix build workflow (#364) (#366)

* fix build version and test deploy

* revert staging test build

Co-authored-by: e-ian <36891299+e-ian@users.noreply.github.com>

* fix merge conflict

* fix conflict

Co-authored-by: e-ian <36891299+e-ian@users.noreply.github.com>

* Check and validate flutter-wave payment status (#358)

* document endpoint using swagger

* add python flutterwave requirement

* implement payment verification logic

* register route

* downgrade python flutterwave version

* add python 3.8 to test pipeline

* test staging deployment

* update api docs with query params

* remove build check

* remove python flutterwave requirement add rave python

* check for build versions in matrix

* Add rave python logic

* edit route

* handle exception

* test staging build

* revert test deploy

* - add stable python build version

* update image runner version

* test deploy

* revert changes

* remove redundant pymongo

* feat: add accept or decline collaboration invite (#367)

Co-authored-by: Mutegeki Henry <hmutegeki@Henrys-MacBook-Pro.local>

* Add App Revision feature (#368)

* Add App revision list

* Able to revert apps

* Add update replicas for app revisions

* Add admin authorisation to revise app (#370)

* Add mongo to Docker Compose (#375)

* Add mongo service to dockercompose

* Add mongo db to docker compose

* Fix deployment workflows. (#376)

* Update staging workflow

* Update prod workflow

* Fix deploy workflow (For real 😄 ) (#377)

* specify zone

* Fix typo

* Use zone for location.

* fix deploy workflow

* fix user activity logs (#374)

* fix user activity logs

* fix actvity logs mongodb uri

* changes to yml

* Add Mongo URI to staging and prod configs (#380)

* Ft remove anonymoususers &  multi-project invites for anonymous user (#373)

* add delete for anonymous users

* allow for multiple project invites of anonymous user

* Add mongo to Docker Compose (#375)

* Add mongo service to dockercompose

* Add mongo db to docker compose

* Fix deployment workflows. (#376)

* Update staging workflow

* Update prod workflow

* Fix deploy workflow (For real 😄 ) (#377)

* specify zone

* Fix typo

* Use zone for location.

* fix deploy workflow

* fix user activity logs (#374)

* fix user activity logs

* fix actvity logs mongodb uri

* changes to yml

* add delete for anonymous users

* allow for multiple project invites of anonymous user

Co-authored-by: Mutegeki Henry <hmutegeki@Henrys-MacBook-Pro.local>
Co-authored-by: Mubangizi Allan <mubangizia22@gmail.com>
Co-authored-by: Innocent Asiimwe <asiimwe@outlook.com>
Co-authored-by: bashaashma <bashaashma@gmail.com>

* Upgrade Backend packages (#379)

* upgrade packages

* revert pyjwt requirement

* test build deploy

* revert test deploy

* increase rollout timeout

* test and deploy

* revert timeout time

* revert build deploy

* Ft increase logger coverage (#381)

* Add activity logger to App CRUD operations

* Add activity logger to database C.U.D operations

* Make log activity asynchronous

* Add test database uri

* Add default database to mongo client

* Ready for Production (#290) (#385)

* add update cotroller fnction

* getting new changes from this branch

* Able to update App information

* Able to update  services and env variables

* Finish all project update fields

* Remove project_id field from api docs

* Remove duplicate user project app route

* Increase token expiry time

* Backend resource cleanup for removing organisations, orgnisation_members and organisation_admins

* Add github authentication route

* change route from github_auth to oauth

* remove linter changes

* Fix dependency issue

* remove pycrypt dependency

* Add linting

* handle null email

* fix null git name issue

* feat: add db stats

* refactor: improve effeciency by reducing loops

* feat: add cluster count stats metadata

* feat: add summary status stats to deployments

* Add env variables and command to app detail info

* Add new user graph data

* feat: create graph data for apps

* refactor graph method implementation

* change graph method to class method

* Remove old configs (#261)

* Add organisation and project_type to project

* Enhancements (#263)

* edit config to source db variables from env

* add small nits to README file

* add updates to README, source variables in config file

* revert and only keep READme changes

* env alternative from .env in config

* edit READMe

* small nit

* feat: tag beta users (#265)

* feat: tag beta users

* correct typo

* Update app creation controllers (#266)

* update app schema fields

* update app creation controller, appschema

* update api docs

* update documentation

* Fix circleci build (#268)

* fix database password creation error

* edit circleci config

* small nit for perm

* update app update ingress rules (#269)

* add custom domain field to app model (#270)

* Let Apps and projects get deleted if the cluster doesnot exist (#271)

* Revert from custom domain to cc domain (#272)

* add revert custom domain endpoint

* Add revert url route

* remove redundant print statement

* remove duplication



* update app has custom domain status, update api docs, routes (#273)

* Add Authorization to roles endpoints (#277)

* Setup Pytest (#278)

* add pytest fixtures

* clean up test and report job

* add database fixture, functional tests

* Fix app update bug (#279)

* Add custom domain validation

* Add functionality to retrieve evn failed apps

* Remove custom domain commented code

* Add beta user check on app creation and up update

* Fix celery version issue (#283)

* bump celery requirement

* celery version

* GitHub workflow run tests and linter (#280)

* run tests and linter before pushing changes to repository

* skip linting

* clean versions

* remove redundant flake 8 requirement

* add warnings flag to workflow

* modify pytest run command

* delete redundant file

* define env in workflow

* edit app config name

* Add admin custom db route

* Extend database models(Billing) (#285)

* - add billing invoice model

* - add billing metrics model

* - add user payment details model

* - billing invoice schema

* - add models to manager module

* - update migrations with chnages

* CI/CD Revamp (#286)

* Test workflow should run on all pushes and PRs.

* Add staging workflow

* Add staging values file.

* Fix action reference.

* Remove not yet defined action.

* Specify namespace on rollout status.

* Remove circleci config.

* Restrict branch

* refactor: remove db status check on admin endpoint for retrieving all dbs

* Store transaction record on success (#287)

* - create transaction model and register in manage
module

* add transaction record schema

* add migrations

* - add transaction record endpoint

* - update api docs

* - register controller

* - register transaction route

* - small shema refactor

* add date created field

* - add date created field

* Add production workflows. (#289)

* Show user transactions and transaction detail (#291)

* - add user transactions view

* - add user transaction api docs

* - add transaction record detail

* - add route

* - add docs

* - update api docs

* - modify routes

* - refactor transactions endpoint

* - extend project model

* - extend model

* - update schema

* - update migrations

* fix failing post transcation route (#293)

* update transaction status (#294)

* Add billing cost endpoint (#292)

* Fix Migrations. (#295)

* Remove problematic migration(08246b2fe16f)

* Remove problematic migration(f4f92e)

* Update down_revision

* Create 011c3345849a_.py

* Add the prometheus url to a cluster (#296)

* Attach prometheus to cluster model

* Remove unused import

* Update kubernetes version and fix Ingress (#297)

* Update kubernetes version

* Remove unwanted migrations

* Add Celery to requirements.txt

* Fix app update route (#300)

* Client Invoice Integration (#298)

* - billing invoice endpoint pseudocode

* ft: create send invoice email functionality

* refactor invoice email

* - add live data integration for invoice

* - small nits

* - model change

* auto date cashed

* migrations

* Fix failing import and migration

* update html

* migration update

* schema and project model update

* - generate receipts and new invoices




* Add string checker for app url on revert app url route (#301)

* refactor:add date to transcation payload (#303)

* Ft invoice details (#302)

* small nit

* get billing invoices list

* document endpoint

* add invoice detail view

* document invoice detail view

* - handle edge cases

* Added content to invoice email and gave the table more padding to give items more space for readability (#304)

* update staging variables, circleci migration (#307)

* update staging variables, circleci migration

* - delete circleci directory

* Get Receipt details (#306)

* small nit

* get billing invoices list

* document endpoint

* add invoice detail view

* document invoice detail view

* - handle edge cases

* - add receipts schema

* - receipts detail api

* - add routes and api docs

* - clean up

* small refactor

* add date field

* Ft add monitoring modules (#305)

* Add clusters statuses

* Add clusters statuses

* Add prometheus status

* Add database statuses

* Add cranecloud apps status

* Add mira status

* Remove auth

* On the invoice, formatted date for more readability and also added currency symbol to the amount. (#308)

* Change invoice email to include invoice id, remove project id and add change name label to user name (#311)

* Add cost modal url to cluster (#309)

* Add cost modal url to cluster

* Remove commented urls

* add credits models (#312)

* add credits models

* update model rlshp

* Fix failed test



* ft: add credits to user object on fetch all users (#313)



* created controllers and endpoints for credits (#314)

* retrieve user credit record (#315)



* added endpoint to get a users credit records (#316)

* Add trailing Invoice notifications (#317)

* Add user notification

* Fix invoice quering logic

* Remove comments

* Remmove unnecessary characters from db password (#318)

* Project cost values(Kubecost) (#319)

* - use kubecost data on billing invoice

* better edge case handling

* refactor

* add payments with credits (#321)

* add name to the user object on login (#322)



* Add ugx value to billing info (#324)

Co-authored-by: Innocent Asiimwe <asiimwe@outlook.com>
Co-authored-by: mubangizi <mubangizia22@gmail.com>
Co-authored-by: “ttcollins” <“ttamalecollins@gmail.com”>
Co-authored-by: Tamale Talemwa Collins <51233620+ttcollins@users.noreply.github.com>
Co-authored-by: MutegekiHenry <henrymutegeki117@gmail.com>
Co-authored-by: Henry Mutegeki <36065782+MutegekiHenry@users.noreply.github.com>
Co-authored-by: Henry Mutegeki <hmutegeki@Henrys-MacBook-Pro.local>
Co-authored-by: Awath Javar Abdat <awath.abdat7@gmail.com>
Co-authored-by: bashaashma <bashaashma@gmail.com>

* fic workflow error on staging

* fix test run workflow

---------

Co-authored-by: mubangizi <mubangizia22@gmail.com>
Co-authored-by: “ttcollins” <“ttamalecollins@gmail.com”>
Co-authored-by: inno-asiimwe <asiimwe@outlook.com>
Co-authored-by: Tamale Talemwa Collins <51233620+ttcollins@users.noreply.github.com>
Co-authored-by: MutegekiHenry <henrymutegeki117@gmail.com>
Co-authored-by: Henry Mutegeki <36065782+MutegekiHenry@users.noreply.github.com>
Co-authored-by: Henry Mutegeki <hmutegeki@Henrys-MacBook-Pro.local>
Co-authored-by: Awath Javar Abdat <awath.abdat7@gmail.com>
Co-authored-by: bashaashma <bashaashma@gmail.com>
Co-authored-by: Beijukabruno <105637789+Beijukabruno@users.noreply.github.com>
Co-authored-by: mubangizi <mubangizi22@gmail.com>
  • Loading branch information
12 people committed Feb 9, 2023
1 parent f7b2a70 commit e6bafc5
Show file tree
Hide file tree
Showing 72 changed files with 4,702 additions and 256 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ jobs:
credentials_json: ${{ secrets.CREDENTIALS_JSON }}

- name: Install (Gcloud)
uses: google-github-actions/setup-gcloud@v0
uses: google-github-actions/setup-gcloud@v1
with:
project_id: crane-cloud-274413
install_components: 'gke-gcloud-auth-plugin'

- name: Login (GCR)
run: gcloud auth configure-docker
Expand Down Expand Up @@ -96,16 +97,20 @@ jobs:
credentials_json: ${{ secrets.CREDENTIALS_JSON }}

- name: Install (Gcloud)
uses: google-github-actions/setup-gcloud@v0
uses: google-github-actions/setup-gcloud@v1
with:
project_id: crane-cloud-274413
install_components: 'gke-gcloud-auth-plugin'

- name: Install (Helm)
uses: azure/setup-helm@v1

- name: Login (Kubernetes Cluster)
run: |
gcloud container clusters get-credentials staging-cluster --zone us-central1-a
uses: google-github-actions/get-gke-credentials@v1
with:
cluster_name: staging-cluster
location: us-central1-a
project_id: crane-cloud-274413

- name: Add Repo (cranecloud-backend)
run: |
Expand All @@ -124,6 +129,7 @@ jobs:
--set environment.ADMIN_PSQL_PASSWORD="${{ secrets.PRODUCTION_ADMIN_PSQL_PASSWORD }}" \
--set environment.APP_MAIL_PASSWORD="${{ secrets.PRODUCTION_APP_MAIL_PASSWORD }}" \
--set environment.DATABASE_URI="${{ secrets.PRODUCTION_DATABASE_URI }}" \
--set environment.MONGO_URI="${{ secrets.PRODUCTION_MONGO_URI }}" \
--set environment.FLASK_APP_SALT="${{ secrets.PRODUCTION_FLASK_APP_SALT }}" \
--set environment.FLASK_APP_SECRET="${{ secrets.PRODUCTION_FLASK_APP_SECRET }}" \
--set environment.GITHUB_CLIENT_SECRET="${{ secrets.PRODUCTION_GITHUB_CLIENT_SECRET }}" \
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ jobs:
credentials_json: ${{ secrets.CREDENTIALS_JSON }}

- name: Install (Gcloud)
uses: google-github-actions/setup-gcloud@v0
uses: google-github-actions/setup-gcloud@v1
with:
project_id: crane-cloud-274413
install_components: 'gke-gcloud-auth-plugin'

- name: Login (GCR)
run: gcloud auth configure-docker
Expand Down Expand Up @@ -92,16 +93,17 @@ jobs:
credentials_json: ${{ secrets.CREDENTIALS_JSON }}

- name: Install (Gcloud)
uses: google-github-actions/setup-gcloud@v0
uses: google-github-actions/setup-gcloud@v1
with:
project_id: crane-cloud-274413

- name: Install (Helm)
uses: azure/setup-helm@v1
install_components: 'gke-gcloud-auth-plugin'

- name: Login (Kubernetes Cluster)
run: |
gcloud container clusters get-credentials staging-cluster --zone us-central1-a
uses: google-github-actions/get-gke-credentials@v1
with:
cluster_name: staging-cluster
location: us-central1-a
project_id: crane-cloud-274413

- name: Add Repo (cranecloud-backend)
run: |
Expand All @@ -120,6 +122,7 @@ jobs:
--set environment.ADMIN_PSQL_PASSWORD="${{ secrets.STAGING_ADMIN_PSQL_PASSWORD }}" \
--set environment.APP_MAIL_PASSWORD="${{ secrets.STAGING_APP_MAIL_PASSWORD }}" \
--set environment.DATABASE_URI="${{ secrets.STAGING_DATABASE_URI }}" \
--set environment.MONGO_URI="${{ secrets.STAGING_MONGO_URI }}" \
--set environment.FLASK_APP_SALT="${{ secrets.STAGING_FLASK_APP_SALT }}" \
--set environment.FLASK_APP_SECRET="${{ secrets.STAGING_FLASK_APP_SECRET }}" \
--set environment.GITHUB_CLIENT_SECRET="${{ secrets.STAGING_GITHUB_CLIENT_SECRET }}" \
Expand Down
39 changes: 38 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,29 @@ env:
jobs:
build:

runs-on: ubuntu-latest
runs-on: ubuntu-20.04

services:
postgres:
image: postgres:12
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${{ secrets.TEST_DATABASE_PASSWORD }}
POSTGRES_DB: ${{ secrets.TEST_DATABASE_NAME }}
options:
--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
ports:
- 5432:5432

mongo:
image: mongo:4.2.3
env:
MONGO_INITDB_ROOT_USERNAME: crane
MONGO_INITDB_ROOT_PASSWORD: ${{ secrets.TEST_MONGO_PASSWORD }}
ports:
- 27017:27017


strategy:
matrix:
python-version: ["3.6", "3.7"]
Expand All @@ -28,6 +50,21 @@ jobs:
python -m pip install --upgrade pip
pip install pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test with pytest
env:
TEST_DATABASE_URI: ${{ secrets.TEST_DATABASE_URI }}
TEST_MONGO_URI: ${{ secrets.TEST_MONGO_URI }}
run: |
python -m pytest
- name: Generate Report
env:
TEST_DATABASE_URI: ${{ secrets.TEST_DATABASE_URI }}
TEST_MONGO_URI: ${{ secrets.TEST_MONGO_URI }}
run: |
pip install coverage
coverage run -m pytest
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v2
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

# Crane Cloud

[![CircleCI](https://circleci.com/gh/crane-cloud/backend/tree/develop.svg?style=svg)](https://circleci.com/gh/crane-cloud/backend/tree/develop)
[![codecov](https://codecov.io/gh/crane-cloud/backend/branch/develop/graph/badge.svg)](https://codecov.io/gh/crane-cloud/backend)
![Test](https://github.com/crane-cloud/backend/actions/workflows/test.yml/badge.svg)
![Build](https://github.com/crane-cloud/backend/actions/workflows/staging.yml/badge.svg)
[![codecov](https://codecov.io/gh/crane-cloud/backend/branch/develop-new/graph/badge.svg?token=kkuF1X6MWx)](https://codecov.io/gh/crane-cloud/backend)

Managed Kubernetes Platform

Expand Down Expand Up @@ -52,7 +52,6 @@ export FLASK_RUN_PORT=5000
export FLASK_APP_SECRET=<app_secret>
```


Run the application.

`flask run`
Expand All @@ -79,7 +78,6 @@ To create the default roles

`python manage.py create_roles`


##### Creating default admin account

To create an admin account run
Expand All @@ -90,12 +88,7 @@ To create an admin account run

Run the application using `flask run` and visit `http://127.0.0.1:5000/apidocs/#/clusters/post_clusters`

`{
"description": "string",
"host": "string",
"name": "string",
"token": "string"
}`
`{ "description": "string", "host": "string", "name": "string", "token": "string" }`
Reach out to backend team to get token and host values

##### Add image repositories
Expand All @@ -104,3 +97,12 @@ To add image repositories to the database run

`python manage.py create_registries`

##### Run celery worker and beat on linux with

`celery -A server.celery worker --loglevel=info`
`celery -A server.celery beat --loglevel=info`

##### Run celery worker and beat on windows with

`celery -A server.celery worker --pool=solo --loglevel=info`
`celery -A server.celery beat --loglevel=info`
Loading

0 comments on commit e6bafc5

Please sign in to comment.