Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/metacell/cloud-harness i…
Browse files Browse the repository at this point in the history
…nto feature/CH-95
  • Loading branch information
ddelpiano committed Feb 10, 2024
2 parents f446bd9 + c958a9e commit 4c03f53
Show file tree
Hide file tree
Showing 39 changed files with 1,237 additions and 90 deletions.
73 changes: 73 additions & 0 deletions application-templates/base/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
.travis.yaml
.openapi-generator-ignore
README.md
tox.ini
git_push.sh
test-requirements.txt

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
venv/
.python-version

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/

#Ipython Notebook
.ipynb_checkpoints

.git
1 change: 1 addition & 0 deletions application-templates/django-app/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
dist
.git
2 changes: 2 additions & 0 deletions application-templates/flask-server/backend/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,5 @@ target/

#Ipython Notebook
.ipynb_checkpoints

.git
75 changes: 73 additions & 2 deletions application-templates/webapp/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,73 @@
node_modules
dist
.travis.yaml
.openapi-generator-ignore
README.md
tox.ini
git_push.sh
test-requirements.txt

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
venv/
.python-version

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/

#Ipython Notebook
.ipynb_checkpoints

.git
175 changes: 104 additions & 71 deletions applications/common/api/openapi.yaml
Original file line number Diff line number Diff line change
@@ -1,78 +1,111 @@
openapi: 3.0.0
info:
description: Cloud Harness Platform - Reference CH service API
license:
name: UNLICENSED
title: CH common service API
version: 0.1.0
title: CH common service API
version: 0.1.0
description: Cloud Harness Platform - Reference CH service API
license:
name: UNLICENSED
servers:
- description: SwaggerHub API Auto Mocking
url: /api
tags:
- description: Sentry
name: Sentry
-
url: /api
description: SwaggerHub API Auto Mocking
paths:
/sentry/getdsn/{appname}:
parameters:
- in: path
name: appname
schema:
type: string
required: true
get:
tags:
- Sentry
description: Gets the Sentry DSN for a given application
operationId: getdsn
responses:
'200':
description: Sentry DSN for the given application
content:
application/json:
schema:
type: object
'400':
description: Sentry not configured for the given application
content:
application/json:
schema:
type: object
text/html:
schema:
type: string
'404':
description: Sentry not configured for the given application
content:
application/problem+json:
schema:
type: object
text/html:
schema:
type: string
summary: Gets the Sentry DSN for a given application
x-openapi-router-controller: common.controllers.sentry_controller
/accounts/config:
get:
tags:
- Accounts
description: Gets the config for logging in into accounts
operationId: get_config
responses:
'200':
description: Config for accounts log in
content:
application/json:
schema:
type: object
properties:
url:
'/sentry/getdsn/{appname}':
get:
tags:
- Sentry
responses:
'200':
content:
application/json:
schema:
type: object
description: Sentry DSN for the given application
'400':
content:
application/json:
schema:
type: object
text/html:
schema:
type: string
description: Sentry not configured for the given application
'404':
content:
application/problem+json:
schema:
type: object
text/html:
schema:
type: string
description: Sentry not configured for the given application
operationId: getdsn
summary: Gets the Sentry DSN for a given application
description: Gets the Sentry DSN for a given application
x-openapi-router-controller: common.controllers.sentry_controller
parameters:
-
name: appname
schema:
type: string
description: The auth URL.
realm:
in: path
required: true
/accounts/config:
get:
tags:
- Accounts
responses:
'200':
content:
application/json:
schema:
type: object
properties:
url:
description: The auth URL.
type: string
realm:
description: The realm.
type: string
clientId:
description: The clientID.
type: string
description: Config for accounts log in
operationId: get_config
summary: Gets the config for logging in into accounts
description: Gets the config for logging in into accounts
x-openapi-router-controller: common.controllers.accounts_controller
/version:
summary: Get the version for this deployment
get:
tags:
- config
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/AppVersion'
examples:
version:
value: "{\r\n \"build\": \"63498f19146bae1a6ae7e354\"\r\n \"tag\": \"v1.2.0\"\r\n}"
description: Deployment version GET
operationId: getVersion
components:
schemas:
AppVersion:
title: Root Type for AppVersion
description: ''
type: object
properties:
build:
type: string
description: The realm.
clientId:
tag:
type: string
description: The clientID.
summary: Gets the config for logging in into accounts
x-openapi-router-controller: common.controllers.accounts_controller
example:
build: 63498f19146bae1a6ae7e354
tag: v1.2.0
tags:
-
name: Sentry
description: Sentry
25 changes: 25 additions & 0 deletions applications/common/server/common/controllers/config_controller.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

import connexion
import six
from typing import Dict
from typing import Tuple
from typing import Union

from common.models.app_version import AppVersion # noqa: E501
from common import util

from cloudharness.utils.config import CloudharnessConfig
from cloudharness_model.models import HarnessMainConfig

def get_version(): # noqa: E501
"""get_version
# noqa: E501
:rtype: Union[AppVersion, Tuple[AppVersion, int], Tuple[AppVersion, int, Dict[str, str]]
"""

config: HarnessMainConfig = HarnessMainConfig.from_dict(CloudharnessConfig.get_configuration())

return AppVersion(tag=config.tag, build=config.build_hash)
1 change: 1 addition & 0 deletions applications/common/server/common/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
# flake8: noqa
from __future__ import absolute_import
# import models into model package
from common.models.app_version import AppVersion
from common.models.get_config200_response import GetConfig200Response
Loading

0 comments on commit 4c03f53

Please sign in to comment.