-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
37 changed files
with
2,806 additions
and
31 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
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 @@ | ||
.vscode/ | ||
assets/ | ||
*.md | ||
.git | ||
.gitignore | ||
.env |
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,148 @@ | ||
[ | ||
{ | ||
"identifier": "microservice", | ||
"title": "Microservice", | ||
"icon": "Service", | ||
"schema": { | ||
"properties": { | ||
"url": { | ||
"title": "URL", | ||
"format": "url", | ||
"type": "string" | ||
}, | ||
"description": { | ||
"title": "Description", | ||
"type": "string" | ||
}, | ||
"namespace": { | ||
"title": "Namespace", | ||
"type": "string" | ||
}, | ||
"full_path": { | ||
"title": "Full Path", | ||
"type": "string" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"identifier": "mergeRequest", | ||
"title": "Merge Request", | ||
"icon": "GitVersion", | ||
"schema": { | ||
"properties": { | ||
"creator": { | ||
"title": "Creator", | ||
"type": "string" | ||
}, | ||
"status": { | ||
"title": "Status", | ||
"type": "string", | ||
"enum": [ | ||
"opened", | ||
"closed", | ||
"merged", | ||
"locked" | ||
], | ||
"enumColors": { | ||
"opened": "yellow", | ||
"closed": "red", | ||
"merged": "green", | ||
"locked": "blue" | ||
} | ||
}, | ||
"createdAt": { | ||
"title": "Create At", | ||
"type": "string", | ||
"format": "date-time" | ||
}, | ||
"updatedAt": { | ||
"title": "Updated At", | ||
"type": "string", | ||
"format": "date-time" | ||
}, | ||
"description": { | ||
"title": "Description", | ||
"type": "string", | ||
"format": "markdown" | ||
}, | ||
"link": { | ||
"title": "Link", | ||
"format": "url", | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"relations": { | ||
"microservice": { | ||
"target": "microservice", | ||
"required": true, | ||
"many": false | ||
} | ||
} | ||
}, | ||
{ | ||
"identifier": "issue", | ||
"title": "Issue", | ||
"icon": "GitLab", | ||
"schema": { | ||
"properties": { | ||
"link": { | ||
"title": "Link", | ||
"type": "string", | ||
"format": "url" | ||
}, | ||
"description": { | ||
"title": "Description", | ||
"type": "string", | ||
"format": "markdown" | ||
}, | ||
"createdAt": { | ||
"title": "Created At", | ||
"type": "string", | ||
"format": "date-time" | ||
}, | ||
"closedAt": { | ||
"title": "Closed At", | ||
"type": "string", | ||
"format": "date-time" | ||
}, | ||
"updatedAt": { | ||
"title": "Updated At", | ||
"type": "string", | ||
"format": "date-time" | ||
}, | ||
"creator": { | ||
"title": "Creator", | ||
"type": "string" | ||
}, | ||
"status": { | ||
"title": "Status", | ||
"type": "string", | ||
"enum": [ | ||
"opened", | ||
"closed" | ||
], | ||
"enumColors": { | ||
"opened": "green", | ||
"closed": "purple" | ||
} | ||
}, | ||
"labels": { | ||
"title": "Labels", | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
}, | ||
"relations": { | ||
"microservice": { | ||
"target": "microservice", | ||
"required": true, | ||
"many": false | ||
} | ||
} | ||
} | ||
] |
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,54 @@ | ||
resources: | ||
- kind: project | ||
selector: | ||
query: 'true' | ||
port: | ||
entity: | ||
mappings: | ||
identifier: .path_with_namespace | gsub(" "; "") | ||
title: .name | ||
blueprint: '"microservice"' | ||
properties: | ||
url: .web_link | ||
description: .description | ||
namespace: .namespace.name | ||
full_path: .namespace.full_path | ||
- kind: mergeRequest | ||
selector: | ||
query: 'true' | ||
port: | ||
entity: | ||
mappings: | ||
identifier: .id | tostring | ||
title: .title | ||
blueprint: '"mergeRequest"' | ||
properties: | ||
creator: .author.name | ||
status: .state | ||
createdAt: .created_at | ||
updatedAt: .updated_at | ||
description: .description | ||
link: .web_url | ||
relations: | ||
microservice: .references.full | ||
- kind: issues | ||
selector: | ||
query: 'true' | ||
port: | ||
entity: | ||
mappings: | ||
identifier: .id | tostring | ||
title: .title | ||
blueprint: '"issue"' | ||
properties: | ||
creator: .author.name | ||
status: .state | ||
createdAt: .created_at | ||
closedAt: .closed_at | ||
updatedAt: .updated_at | ||
description: .description | ||
link: .web_url | ||
labels: '[.labels[]]' | ||
object: . | ||
relations: | ||
microservice: .references.full |
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,27 @@ | ||
version: v0.1.0 | ||
type: gitlab | ||
description: Gitlab integration for Port Ocean | ||
icon: GitLab | ||
features: | ||
- type: gitops | ||
section: GitOps | ||
- type: exporter | ||
section: Git Providers | ||
resources: | ||
- kind: projects | ||
configurations: | ||
- name: tokenMapping | ||
required: true | ||
type: object | ||
description: "Mapping of Gitlab tokens to Port Ocean tokens. example: {\"THE_GROUP_TOKEN\":[\"getport-labs/**\", \"GROUP/PROJECT PATTERN TO RUN FOR\"]}" | ||
sensitive: true | ||
- name: appHost | ||
required: true | ||
type: url | ||
description: The host of the Port Ocean app. Used for setting up the webhooks against the Gitlab. | ||
- name: gitlabHost | ||
required: false | ||
type: url | ||
default: https://gitlab.com | ||
description: The host of the Gitlab instance. If not specified, the default will be https://gitlab.com. | ||
ingressRequired: true |
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,16 @@ | ||
FROM python:3.11-slim-buster | ||
|
||
ENV LIBRDKAFKA_VERSION 1.9.2 | ||
|
||
WORKDIR /app | ||
|
||
RUN apt update && apt install -y wget make g++ libssl-dev autoconf automake libtool curl | ||
RUN wget https://github.com/edenhill/librdkafka/archive/v${LIBRDKAFKA_VERSION}.tar.gz && \ | ||
tar xvzf v${LIBRDKAFKA_VERSION}.tar.gz && \ | ||
(cd librdkafka-${LIBRDKAFKA_VERSION}/ && ./configure && make && make install && ldconfig) | ||
|
||
COPY . /app | ||
|
||
RUN make install | ||
|
||
ENTRYPOINT make run |
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,71 @@ | ||
ACTIVATE := . .venv/bin/activate | ||
|
||
define run_checks | ||
exit_code=0; \ | ||
cd $1; \ | ||
poetry check || exit_code=$$?;\ | ||
poetry lock --check || exit_code=$$?;\ | ||
mypy . || exit_code=$$?; \ | ||
ruff . || exit_code=$$?; \ | ||
black --check . || exit_code=$$?; \ | ||
if [ $$exit_code -eq 1 ]; then \ | ||
echo "\033[0;31mOne or more checks failed with exit code $$exit_code\033[0m"; \ | ||
else \ | ||
echo "\033[0;32mAll checks executed successfully.\033[0m"; \ | ||
fi; \ | ||
exit $$exit_code | ||
endef | ||
|
||
define install_poetry | ||
if ! command -v poetry &> /dev/null; then \ | ||
pip install --upgrade pip; \ | ||
pip install poetry; \ | ||
else \ | ||
echo "Poetry is already installed."; \ | ||
fi | ||
endef | ||
|
||
define deactivate_virtualenv | ||
if [ -n "$$VIRTUAL_ENV" ]; then \ | ||
unset VIRTUAL_ENV; \ | ||
unset PYTHONHOME; \ | ||
unset -f pydoc >/dev/null 2>&1; \ | ||
OLD_PATH="$$PATH"; \ | ||
PATH=$$(echo -n "$$PATH" | awk -v RS=: -v ORS=: '/\/virtualenv\/bin$$/ {next} {print}'); \ | ||
export PATH; \ | ||
hash -r; \ | ||
echo "Deactivated the virtual environment."; \ | ||
fi | ||
endef | ||
|
||
.SILENT: install lint run test clean | ||
|
||
install: | ||
$(call deactivate_virtualenv) && \ | ||
$(call install_poetry) && \ | ||
poetry install --with dev | ||
|
||
lint: | ||
$(ACTIVATE) && \ | ||
$(call run_checks,.) | ||
|
||
run: | ||
$(ACTIVATE) && ocean sail | ||
|
||
test: lint | ||
$(ACTIVATE) && poetry run pytest | ||
|
||
clean: | ||
@find . -name '.venv' -type d -exec rm -rf {} \; | ||
@find . -name '*.pyc' -exec rm -rf {} \; | ||
@find . -name '__pycache__' -exec rm -rf {} \; | ||
@find . -name 'Thumbs.db' -exec rm -rf {} \; | ||
@find . -name '*~' -exec rm -rf {} \; | ||
rm -rf .cache | ||
rm -rf build | ||
rm -rf dist | ||
rm -rf *.egg-info | ||
rm -rf htmlcov | ||
rm -rf .tox/ | ||
rm -rf docs/_build | ||
rm -rf dist/ |
Oops, something went wrong.