-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Integration][Amplication] add initial version of Amplication integration #1354
base: main
Are you sure you want to change the base?
Changes from 2 commits
7b90611
d14a9fe
6a1dd43
ca93c1f
b5fe2de
0aca535
1276b08
f46c8ae
242b599
3042492
aa1bf35
dd302a9
3584a62
d7aadcc
f207ebb
79b5d7b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
|
||
# Git | ||
**/.git | ||
**/.gitignore | ||
**/.gitattributes | ||
|
||
|
||
# CI | ||
**/.codeclimate.yml | ||
**/.travis.yml | ||
**/.taskcluster.yml | ||
|
||
# Docker | ||
**/docker-compose.yml | ||
**/Dockerfile | ||
**/.docker | ||
**/.dockerignore | ||
|
||
# Byte-compiled / optimized / DLL files | ||
**/__pycache__/ | ||
**/*.py[cod] | ||
|
||
# C extensions | ||
**/*.so | ||
|
||
# Distribution / packaging | ||
**/.Python | ||
**/env/ | ||
**/build/ | ||
**/develop-eggs/ | ||
**/dist/ | ||
**/downloads/ | ||
**/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 | ||
**/.cache | ||
**/nosetests.xml | ||
**/coverage.xml | ||
|
||
# Translations | ||
**/*.mo | ||
**/*.pot | ||
|
||
# Django stuff: | ||
**/*.log | ||
|
||
# Sphinx documentation | ||
**/docs/_build/ | ||
|
||
# PyBuilder | ||
**/target/ | ||
|
||
# Virtual environment | ||
**/.env | ||
**/.venv/ | ||
**/venv/ | ||
|
||
# PyCharm | ||
**/.idea | ||
|
||
# Python mode for VIM | ||
**/.ropeproject | ||
|
||
# Vim swap files | ||
**/*.swp | ||
|
||
# VS Code | ||
**/.vscode/ | ||
|
||
**/*.md | ||
**/.ruff_cache | ||
**/changelog | ||
**/tests |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
OCEAN__PORT__CLIENT_ID=<port-client-id> | ||
OCEAN__PORT__CLIENT_SECRET=<port-client-secret> | ||
OCEAN__INTEGRATION__IDENTIFIER=<your-integration-identifier> | ||
OCEAN__PORT__BASE_URL=https://api.getport.io/v1 | ||
OCEAN__INTEGRATION={"identifier": "amplication", "type": "amplication", "config": {}} | ||
OCEAN__INTEGRATION__CONFIG__AMPLICATION_API_URL=<amplication-api-url> | ||
OCEAN__INTEGRATION__CONFIG__AMPLICATION_AUTHORIZATION=<amplication-api-authorization> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
share/python-wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# 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/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
*.py,cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
cover/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
db.sqlite3-journal | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
.pybuilder/ | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# IPython | ||
profile_default/ | ||
ipython_config.py | ||
|
||
# pyenv | ||
# For a library or package, you might want to ignore these files since the code is | ||
# intended to run in multiple environments; otherwise, check them in: | ||
# .python-version | ||
|
||
# pipenv | ||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. | ||
# However, in case of collaboration, if having platform-specific dependencies or dependencies | ||
# having no cross-platform support, pipenv may install dependencies that don't work, or not | ||
# install all needed dependencies. | ||
#Pipfile.lock | ||
|
||
# poetry | ||
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. | ||
# This is especially recommended for binary packages to ensure reproducibility, and is more | ||
# commonly ignored for libraries. | ||
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control | ||
#poetry.lock | ||
|
||
# pdm | ||
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. | ||
#pdm.lock | ||
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it | ||
# in version control. | ||
# https://pdm.fming.dev/#use-with-ide | ||
.pdm.toml | ||
|
||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm | ||
__pypackages__/ | ||
|
||
# Celery stuff | ||
celerybeat-schedule | ||
celerybeat.pid | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
.dmypy.json | ||
dmypy.json | ||
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
# pytype static type analyzer | ||
.pytype/ | ||
|
||
# Cython debug symbols | ||
cython_debug/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
!.gitignore |
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,131 @@ | ||||||||
[ | ||||||||
{ | ||||||||
"identifier": "amplication_service_from_template", | ||||||||
"title": "Scaffold a Service", | ||||||||
"icon": "Microservice", | ||||||||
"description": "Create a new service from template (using [Amplication](https://amplication.com))", | ||||||||
"trigger": { | ||||||||
"type": "self-service", | ||||||||
"operation": "CREATE", | ||||||||
"userInputs": { | ||||||||
"properties": { | ||||||||
"template": { | ||||||||
"type": "string", | ||||||||
"title": "Template", | ||||||||
"blueprint": "AmplicationTemplate", | ||||||||
"icon": "Template", | ||||||||
"format": "entity" | ||||||||
}, | ||||||||
"service_name": { | ||||||||
"icon": "Service", | ||||||||
"type": "string", | ||||||||
"title": "Service Name" | ||||||||
} | ||||||||
}, | ||||||||
"required": [ | ||||||||
"template", | ||||||||
"service_name" | ||||||||
], | ||||||||
"order": [ | ||||||||
"template", | ||||||||
"service_name" | ||||||||
] | ||||||||
} | ||||||||
}, | ||||||||
"invocationMethod": { | ||||||||
"type": "WEBHOOK", | ||||||||
"url": "https://server.amplication.com/graphql", | ||||||||
"agent": false, | ||||||||
"synchronized": true, | ||||||||
"method": "POST", | ||||||||
"headers": { | ||||||||
"RUN_ID": "{{ .run.id }}", | ||||||||
"authorization": "Bearer {{ .secrets.amplication_token }}" | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this will not work, as
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @omby8888 I'm sorry, but I don't follow. I see an example to this comment in GitLab's integration:
but it means users which install Amplication's integration will have to go to the two self-service actions and add the token there, instead of going to the Manage secrets panel, like the suggestion in the Edit Action's Backend tab:
It actually work for us now with our sandbox, so this is why I'm confused. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. BTW, looks like when installing an integration, the token requested in |
||||||||
}, | ||||||||
"body": { | ||||||||
"operationName": "createServiceFromTemplate", | ||||||||
"variables": { | ||||||||
"data": { | ||||||||
"name": "{{ .inputs.service_name }}", | ||||||||
"description": "", | ||||||||
"project": { | ||||||||
"connect": { | ||||||||
"id": "{{ .inputs.template.properties.project_id }}" | ||||||||
} | ||||||||
}, | ||||||||
"serviceTemplate": { | ||||||||
"id": "{{ .inputs.template.identifier }}" | ||||||||
} | ||||||||
} | ||||||||
}, | ||||||||
"query": "mutation createServiceFromTemplate($data: ResourceFromTemplateCreateInput!) {\n createResourceFromTemplate(data: $data) {\n id\n name\n description\n __typename\n }\n}" | ||||||||
} | ||||||||
}, | ||||||||
"requiredApproval": false | ||||||||
}, | ||||||||
{ | ||||||||
"identifier": "amplication_rebuild_code", | ||||||||
"title": "Code Re-build", | ||||||||
"icon": "Microservice", | ||||||||
"trigger": { | ||||||||
"type": "self-service", | ||||||||
"operation": "DAY-2", | ||||||||
"userInputs": { | ||||||||
"properties": { | ||||||||
"resource": { | ||||||||
"title": "Resource", | ||||||||
"icon": "Service", | ||||||||
"type": "string", | ||||||||
"blueprint": "AmplicationResource", | ||||||||
"format": "entity" | ||||||||
}, | ||||||||
"message": { | ||||||||
"icon": "Neo4j", | ||||||||
"type": "string", | ||||||||
"title": "Message" | ||||||||
} | ||||||||
}, | ||||||||
"required": [ | ||||||||
"resource", | ||||||||
"message" | ||||||||
], | ||||||||
"order": [ | ||||||||
"resource", | ||||||||
"message" | ||||||||
] | ||||||||
} | ||||||||
}, | ||||||||
"invocationMethod": { | ||||||||
"type": "WEBHOOK", | ||||||||
"url": "https://server.amplication.com/graphql", | ||||||||
"agent": false, | ||||||||
"synchronized": true, | ||||||||
"method": "POST", | ||||||||
"headers": { | ||||||||
"RUN_ID": "{{ .run.id }}", | ||||||||
"authorization": "Bearer {{ .secrets.amplication_token }}" | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above |
||||||||
}, | ||||||||
"body": { | ||||||||
"operationName": "commit", | ||||||||
"variables": { | ||||||||
"data": { | ||||||||
"message": "{{ .inputs.message }}", | ||||||||
"project": { | ||||||||
"connect": { | ||||||||
"id": "{{ .inputs.resource.properties.project_id }}" | ||||||||
} | ||||||||
}, | ||||||||
"resourceIds": [ | ||||||||
"{{ .inputs.resource.identifier }}" | ||||||||
], | ||||||||
"bypassLimitations": true, | ||||||||
"commitStrategy": "Specific", | ||||||||
"resourceTypeGroup": "Services" | ||||||||
} | ||||||||
}, | ||||||||
"query": "mutation commit($data: CommitCreateInput!) {\n commit(data: $data) {\n id\n builds {\n id\n resourceId\n status\n __typename\n }\n __typename\n }\n}" | ||||||||
} | ||||||||
}, | ||||||||
"requiredApproval": false | ||||||||
} | ||||||||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for this file