Skip to content

Commit

Permalink
[Integration][Amplication] Add initial version of Amplication integra…
Browse files Browse the repository at this point in the history
…tion (#1354)
  • Loading branch information
itainathaniel authored Feb 24, 2025
1 parent 3dc76a6 commit f274ccd
Show file tree
Hide file tree
Showing 23 changed files with 2,826 additions and 0 deletions.
6 changes: 6 additions & 0 deletions integrations/amplication/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
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__CONFIG__AMPLICATION_HOST=<amplication-host>
OCEAN__INTEGRATION__CONFIG__AMPLICATION_TOKEN=<amplication-token>
153 changes: 153 additions & 0 deletions integrations/amplication/.gitignore
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/
1 change: 1 addition & 0 deletions integrations/amplication/.port/resources/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!.gitignore
132 changes: 132 additions & 0 deletions integrations/amplication/.port/resources/actions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
[
{
"identifier": "amplication_service_from_template",
"title": "Scaffold a Service",
"icon": "Amplication",
"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": "Amplication",
"format": "entity"
},
"service_name": {
"type": "string",
"icon": "DefaultProperty",
"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_AMPLICATION_TOKEN }}"
},
"body": {
"operationName": "createServiceFromTemplate",
"variables": {
"data": {
"name": "{{ .inputs.service_name }}",
"description": "",
"project": {
"connect": {
"id": "{{ .inputs.template.properties.project_id }}"
}
},
"serviceTemplate": {
"id": "{{ .inputs.template.identifier }}"
},
"buildAfterCreation": true
}
},
"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": "Amplication",
"trigger": {
"type": "self-service",
"operation": "DAY-2",
"userInputs": {
"properties": {
"resource": {
"title": "Resource",
"icon": "Amplication",
"type": "string",
"blueprint": "AmplicationResource",
"format": "entity"
},
"message": {
"title": "Message",
"icon": "DefaultProperty",
"type": "string"
}
},
"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_AMPLICATION_TOKEN }}"
},
"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
}
]
Loading

0 comments on commit f274ccd

Please sign in to comment.