Skip to content
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

Gitlab app poc #2

Merged
merged 391 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
391 commits
Select commit Hold shift + click to select a range
855a4fc
version bumpp
yairsimantov20 Jun 29, 2023
9ece944
idea files
yairsimantov20 Jun 29, 2023
dd9df57
idea files
yairsimantov20 Jun 29, 2023
46097b4
remove dstore
yairsimantov20 Jun 29, 2023
25071ad
fixing the request middleware
yairsimantov20 Jun 29, 2023
da4df10
more logs and exceptions
yairsimantov20 Jul 2, 2023
0bfbb31
readme updates & renaming port_ocean file to ocean.py
yairsimantov20 Jul 2, 2023
b41c2c9
fixed linting
yairsimantov20 Jul 2, 2023
86d1ba7
Merge branch 'POC' of github.com:port-labs/port-ocean into gitlab-app…
yairsimantov20 Jul 2, 2023
b050522
revert changes in ocean
yairsimantov20 Jul 2, 2023
58e6c99
readme updates
yairsimantov20 Jul 2, 2023
0c7fd22
Merge branch 'POC' of github.com:port-labs/port-ocean into gitlab-app…
yairsimantov20 Jul 2, 2023
c0b1246
using the logger
yairsimantov20 Jul 2, 2023
b97c242
better logs
yairsimantov20 Jul 2, 2023
8d9a673
Merge branch 'POC' of github.com:port-labs/port-ocean into gitlab-app…
yairsimantov20 Jul 2, 2023
dcc4db8
improved README.md
yairsimantov20 Jul 2, 2023
ecc9c0d
Merge branch 'POC' of github.com:port-labs/port-ocean into gitlab-app…
yairsimantov20 Jul 2, 2023
f398129
better logs
yairsimantov20 Jul 2, 2023
bd35e22
ignoring pydantic FutureWarning
yairsimantov20 Jul 2, 2023
5538385
Merge branch 'POC' of github.com:port-labs/port-ocean into gitlab-app…
yairsimantov20 Jul 2, 2023
baafb48
fixed bugs in the gitlab app logic
yairsimantov20 Jul 2, 2023
74f6b9e
fixed some implementations
yairsimantov20 Jul 2, 2023
e939d9a
Merge branch 'POC' of github.com:port-labs/port-ocean into gitlab-app…
yairsimantov20 Jul 2, 2023
3b270ef
moved some exceptions
yairsimantov20 Jul 2, 2023
4cad95f
moved some exceptions
yairsimantov20 Jul 2, 2023
490c125
Merge branch 'POC' of github.com:port-labs/port-ocean into gitlab-app…
yairsimantov20 Jul 2, 2023
8a75986
Merge remote-tracking branch 'origin/gitlab-app-POC' into gitlab-app-POC
yairsimantov20 Jul 2, 2023
6e6563d
checking for diff in the integration before initializing
yairsimantov20 Jul 3, 2023
c53e23c
Merge branch 'POC' of github.com:port-labs/port-ocean into gitlab-app…
yairsimantov20 Jul 3, 2023
d8005c6
svg to png
yairsimantov20 Jul 3, 2023
b5b8489
some readme and git ignore improvements
yairsimantov20 Jul 3, 2023
4e12126
Added OceanLogo.svg
yairsimantov20 Jul 3, 2023
5cae31d
fixed logo
yairsimantov20 Jul 3, 2023
de98204
fixed logo
yairsimantov20 Jul 3, 2023
4849231
fixed logo
yairsimantov20 Jul 3, 2023
e5e7927
Prerequisites
yairsimantov20 Jul 3, 2023
1007bc7
version command
yairsimantov20 Jul 3, 2023
1e27ae8
version command
yairsimantov20 Jul 3, 2023
89be610
cli improved cli help
yairsimantov20 Jul 3, 2023
c12223b
existing gracefully on kafka error
yairsimantov20 Jul 3, 2023
fd38a5b
removing secret.yaml from the settings config
yairsimantov20 Jul 3, 2023
2d376ac
using python gitignore
yairsimantov20 Jul 3, 2023
9bc536c
using python gitignore
yairsimantov20 Jul 3, 2023
022063c
port base url default value
yairsimantov20 Jul 3, 2023
997dae0
lint fixes
yairsimantov20 Jul 3, 2023
d419f39
moved provider patterns to consts
yairsimantov20 Jul 4, 2023
8048297
seperated port client.py
yairsimantov20 Jul 4, 2023
10260be
using consts for status codes
yairsimantov20 Jul 4, 2023
8b982aa
passing integration type to the port client for the user agent
yairsimantov20 Jul 4, 2023
2b39bb8
added integration type to the kafka consumer
yairsimantov20 Jul 4, 2023
2afb347
using rich console for printing
yairsimantov20 Jul 4, 2023
bb627bf
cli test changes
yairsimantov20 Jul 4, 2023
46fa6de
removed Shell:= from the make file
yairsimantov20 Jul 4, 2023
a218369
updated base url
yairsimantov20 Jul 4, 2023
e6f40c5
fixed sail command
yairsimantov20 Jul 4, 2023
4b0937c
fixed black version for python
yairsimantov20 Jul 4, 2023
11319d2
getting kafka credentials more safely
yairsimantov20 Jul 4, 2023
e5e5758
base config cosmetic changes
yairsimantov20 Jul 4, 2023
01350b5
cosmetic changes
yairsimantov20 Jul 4, 2023
a03fa97
cosmetic changes
yairsimantov20 Jul 4, 2023
77f4c33
cosmetic changes
yairsimantov20 Jul 4, 2023
a7f4203
cosmetic changes
yairsimantov20 Jul 4, 2023
65e1740
cosmetic changes
yairsimantov20 Jul 4, 2023
3e180fc
fixed imports
yairsimantov20 Jul 4, 2023
a0093f1
validating the result with pydantic
yairsimantov20 Jul 4, 2023
21d1ff8
fixed typo
yairsimantov20 Jul 4, 2023
9d0763c
cosmetics
yairsimantov20 Jul 4, 2023
8af245b
cosmetics
yairsimantov20 Jul 4, 2023
a9d2eea
removed unused error handling
yairsimantov20 Jul 4, 2023
dbb1f3b
renaming
yairsimantov20 Jul 4, 2023
acaab4d
removed idea file
yairsimantov20 Jul 4, 2023
8e77f19
fixed the type
yairsimantov20 Jul 4, 2023
b6199ab
using get time for validating the token instead of datetime
yairsimantov20 Jul 5, 2023
f0eba0f
better status code validation
yairsimantov20 Jul 5, 2023
1680de3
getting delete_dependent_entities from options better
yairsimantov20 Jul 5, 2023
aa3345c
better status code handling
yairsimantov20 Jul 5, 2023
d2b9bb0
better status code handling
yairsimantov20 Jul 5, 2023
2956e6a
cosmetics
yairsimantov20 Jul 5, 2023
3da7a5c
cosmetics
yairsimantov20 Jul 5, 2023
5efbd3a
cosmetics
yairsimantov20 Jul 5, 2023
9358c02
fixed usage of options
yairsimantov20 Jul 5, 2023
fdba889
logger updates
yairsimantov20 Jul 5, 2023
97c846e
better contributing part for the README.md
yairsimantov20 Jul 5, 2023
1645d71
gave http event a name
yairsimantov20 Jul 5, 2023
bc010b3
noramalized the event types
yairsimantov20 Jul 5, 2023
a359060
noramalized the event types
yairsimantov20 Jul 5, 2023
7011ad4
renaming
yairsimantov20 Jul 9, 2023
e0d5908
revert change
yairsimantov20 Jul 9, 2023
0aadfc3
better intro
yairsimantov20 Jul 9, 2023
c31605c
better README.md
yairsimantov20 Jul 9, 2023
a2ba148
CONTRIBUTING.md
yairsimantov20 Jul 9, 2023
eef6a36
better README.md
yairsimantov20 Jul 9, 2023
ca1f390
unpacking iterator instead of array
yairsimantov20 Jul 9, 2023
5cd8deb
renaming
yairsimantov20 Jul 9, 2023
217dad4
removed actions for now from the code
yairsimantov20 Jul 9, 2023
45f1446
fixed get uniqueu logic
yairsimantov20 Jul 9, 2023
fa0b1e6
strip logo
yairsimantov20 Jul 9, 2023
6021e53
better cookiecutter comments
yairsimantov20 Jul 9, 2023
609d597
better cookiecutter comments
yairsimantov20 Jul 9, 2023
7d97f43
better cookiecutter comments
yairsimantov20 Jul 9, 2023
f88b5e0
returning trigger channel instead of holding it in the factory.py
yairsimantov20 Jul 9, 2023
d75ec7f
fixed typing
yairsimantov20 Jul 9, 2023
8a6a007
fixed import
yairsimantov20 Jul 9, 2023
99b17ae
made the load providers function more readable
yairsimantov20 Jul 9, 2023
e1952eb
cosmetic changes
yairsimantov20 Jul 9, 2023
a3c61f0
cosmetic changes
yairsimantov20 Jul 9, 2023
e839ad4
cosmetic changes
yairsimantov20 Jul 9, 2023
d2f7f9b
cosmetic changes
yairsimantov20 Jul 9, 2023
11a7f03
cosmetic changes
yairsimantov20 Jul 9, 2023
fa477e7
cosmetic changes
yairsimantov20 Jul 9, 2023
ba6bedf
cosmetic changes
yairsimantov20 Jul 9, 2023
52eea5e
cosmetic changes
yairsimantov20 Jul 9, 2023
da1e876
better gitignore
yairsimantov20 Jul 9, 2023
02430cb
better gitignore
yairsimantov20 Jul 9, 2023
2adde96
better gitignore
yairsimantov20 Jul 9, 2023
320a793
better gitignore
yairsimantov20 Jul 9, 2023
00d8d2a
cosmetic changes
yairsimantov20 Jul 9, 2023
8d44fce
cosmetic changes
yairsimantov20 Jul 9, 2023
ae4d026
debug py
yairsimantov20 Jul 9, 2023
1c93a50
sample trigger channel
yairsimantov20 Jul 10, 2023
77d1556
dockerfile and spec.yaml
yairsimantov20 Jul 10, 2023
d819fad
dockerfile and spec.yaml
yairsimantov20 Jul 10, 2023
5d8922b
release integration workflow
yairsimantov20 Jul 10, 2023
c742e10
fixed make file poetry installation
yairsimantov20 Jul 10, 2023
c6818c8
fixed make file poetry installation
yairsimantov20 Jul 10, 2023
69101a0
Merge branch 'POC' of github.com:port-labs/port-ocean into gitlab-app…
yairsimantov20 Jul 10, 2023
3aa961b
fixed make file poetry installation
yairsimantov20 Jul 10, 2023
2051a31
fixed make file poetry installation
yairsimantov20 Jul 10, 2023
4302f29
fixed make file poetry installation
yairsimantov20 Jul 10, 2023
6b16fcc
check diff for the integration type when patching
yairsimantov20 Jul 10, 2023
b856462
Merge branch 'PORT-4223-Add-sampling-trigger-channel-to-ocean' of git…
yairsimantov20 Jul 10, 2023
8828581
fixed sample trigger_channel.py
yairsimantov20 Jul 10, 2023
9640050
Merge branch 'PORT-4223-Add-sampling-trigger-channel-to-ocean' of git…
yairsimantov20 Jul 10, 2023
992c9a2
log for sample trigger channel
yairsimantov20 Jul 10, 2023
76bc135
Merge branch 'PORT-4223-Add-sampling-trigger-channel-to-ocean' of git…
yairsimantov20 Jul 10, 2023
ef95c96
consumer_poll_timeout configuration
yairsimantov20 Jul 10, 2023
cc35e78
improved syntax for getting the provider data
yairsimantov20 Jul 10, 2023
4fe4faf
unpacking configuration into kafka consumer config
yairsimantov20 Jul 10, 2023
4321a8c
removed requests package
yairsimantov20 Jul 10, 2023
f52e707
adding config yamlto the cookie cutter
yairsimantov20 Jul 10, 2023
c097225
pyproject.toml metadata
yairsimantov20 Jul 10, 2023
5af1669
more text in CONTRIBUTING.md
yairsimantov20 Jul 10, 2023
718363c
a start of a CHANGELOG.md
yairsimantov20 Jul 10, 2023
804eb7c
implemented towncrier
yairsimantov20 Jul 10, 2023
08f9397
implemented towncrier
yairsimantov20 Jul 10, 2023
12ac91d
transport class renaming
yairsimantov20 Jul 11, 2023
0f80339
fixed README.md folder structure
yairsimantov20 Jul 12, 2023
28816b8
fixed the repo name in the list and pull commands.py
yairsimantov20 Jul 12, 2023
d25c399
removed runs from the consumer
yairsimantov20 Jul 12, 2023
841c451
manipulation -> entity processor renaming
yairsimantov20 Jul 12, 2023
f21825b
improved imports
yairsimantov20 Jul 12, 2023
12e8b34
handling abort errors
yairsimantov20 Jul 12, 2023
318c93b
renaming
yairsimantov20 Jul 12, 2023
1de69ab
Merge branch 'POC' of github.com:port-labs/port-ocean into PORT-4223-…
yairsimantov20 Jul 12, 2023
601766f
added consumer_poll_timeout
yairsimantov20 Jul 12, 2023
c56e08b
Merge branch 'PORT-4223-Add-sampling-trigger-channel-to-ocean' of git…
yairsimantov20 Jul 12, 2023
cc6f65b
corrected according the class renaming
yairsimantov20 Jul 12, 2023
b380dec
updated spec yaml
yairsimantov20 Jul 12, 2023
3b4d41a
reusing asyncClient instance
yairsimantov20 Jul 12, 2023
f9bb37e
Merge branch 'POC' of github.com:port-labs/port-ocean into PORT-4223-…
yairsimantov20 Jul 12, 2023
65e3a45
Merge branch 'PORT-4223-Add-sampling-trigger-channel-to-ocean' of git…
yairsimantov20 Jul 12, 2023
0d4aabe
fixed spec typing
yairsimantov20 Jul 12, 2023
193b1e8
added license and updated the version
yairsimantov20 Jul 12, 2023
1227e24
Merge branch 'main' of github.com:port-labs/Port-Ocean into PORT-4223…
yairsimantov20 Jul 12, 2023
0ddc084
removed previous files
yairsimantov20 Jul 12, 2023
fcec669
fixed docstrings
yairsimantov20 Jul 12, 2023
9e2490e
getting the current integration in the client instead of passing the …
yairsimantov20 Jul 12, 2023
666f038
removed unused parameters on `repeat_every`
yairsimantov20 Jul 12, 2023
278e727
removed duplication of the http trigger
yairsimantov20 Jul 12, 2023
e0a10f0
Merge branch 'PORT-4223-Add-sampling-trigger-channel-to-ocean' of git…
yairsimantov20 Jul 12, 2023
9ccc25b
infra updates
yairsimantov20 Jul 12, 2023
1e9af2a
removed irrelevant todo
yairsimantov20 Jul 12, 2023
e59aef4
removed extra whitespaces
yairsimantov20 Jul 12, 2023
b8f4ce7
readme fixes
yairsimantov20 Jul 12, 2023
14317ad
merge conflicts
yairsimantov20 Jul 13, 2023
cf2a34b
reverted deletion for utils.py
yairsimantov20 Jul 13, 2023
8d8b3de
Merge branch 'main' of github.com:port-labs/Port-Ocean into gitlab-ap…
yairsimantov20 Jul 13, 2023
b7147c4
fixed readme file structure
yairsimantov20 Jul 13, 2023
ceca5c7
renamed the gitlab app to gitlab
yairsimantov20 Jul 13, 2023
3afd3f9
fixed imports
yairsimantov20 Jul 13, 2023
d8fdba1
initializing defaults
yairsimantov20 Jul 13, 2023
bd78656
Merge branch 'PORT-4250-Add-default-blueprint-and-mapping-for-integra…
yairsimantov20 Jul 13, 2023
cd1cf45
corrected parameter name
yairsimantov20 Jul 13, 2023
34f1261
added debug.py
yairsimantov20 Jul 13, 2023
b0aef8c
gitlab app default blueprints and port app config
yairsimantov20 Jul 13, 2023
4cc70d1
Added a py.typed file so that mypy will know to use our type annotati…
yairsimantov20 Jul 14, 2023
3a182ec
Merge branch 'PORT-4254-Support-port-ocean-in-mypy' of github.com:por…
yairsimantov20 Jul 14, 2023
50b96ed
removed unused variable
yairsimantov20 Jul 14, 2023
3ebf5f5
updated make file
yairsimantov20 Jul 14, 2023
dc2ecc3
removed uneeded fields
yairsimantov20 Jul 16, 2023
a2b1537
Merge branch 'main' of github.com:port-labs/Port-Ocean into gitlab-ap…
yairsimantov20 Jul 18, 2023
9db06ff
removed merge conflict file
yairsimantov20 Jul 18, 2023
026ccc9
removed merge conflict file
yairsimantov20 Jul 18, 2023
322ddf0
updated files according to main
yairsimantov20 Jul 18, 2023
7378392
renamed the folder
yairsimantov20 Jul 18, 2023
3fa7ab2
modified according to changes in main
yairsimantov20 Jul 18, 2023
6af1e61
casting the port_app_config on the push hook to get the right configu…
yairsimantov20 Jul 18, 2023
139ab8a
merged files
yairsimantov20 Jul 18, 2023
8dba19c
switched to generator from list
yairsimantov20 Jul 18, 2023
1b259e1
renaming and moved some files
yairsimantov20 Jul 18, 2023
5c814f2
updated the packages
yairsimantov20 Jul 18, 2023
d9e3c3b
Merge branch 'main' of github.com:port-labs/Port-Ocean into gitlab-ap…
yairsimantov20 Jul 18, 2023
84e2bff
updated the Dockerfile
yairsimantov20 Jul 18, 2023
c25bfc3
Update pyproject.toml
yairsimantov20 Jul 18, 2023
e3dfea8
Update pyproject.toml
yairsimantov20 Jul 18, 2023
2102203
More documentation for the gitlab
yairsimantov20 Jul 19, 2023
14d22f0
unified kinds
yairsimantov20 Jul 19, 2023
c15b083
removed required true from blueprints.json
yairsimantov20 Jul 19, 2023
b03d6e1
kind documentation
yairsimantov20 Jul 19, 2023
3f364bb
spec bump
yairsimantov20 Jul 19, 2023
0c4692b
fixed object kind
yairsimantov20 Jul 19, 2023
e7c95ed
fixed object kind
yairsimantov20 Jul 19, 2023
c330e9e
fixed the workflow
yairsimantov20 Jul 19, 2023
f9ad713
added the extras
yairsimantov20 Jul 19, 2023
da30c3a
bumped spec
yairsimantov20 Jul 19, 2023
a012cb6
updated ocean
yairsimantov20 Jul 19, 2023
1d87c72
Merge branch 'main' of github.com:port-labs/Port-Ocean into gitlab-ap…
yairsimantov20 Jul 19, 2023
82de021
bumped version
yairsimantov20 Jul 19, 2023
9995fb8
passing the body directly
yairsimantov20 Jul 19, 2023
f9a14ea
removed the scope model
yairsimantov20 Jul 19, 2023
85dbf17
removed hook context
yairsimantov20 Jul 19, 2023
705b9be
reordered functions
yairsimantov20 Jul 19, 2023
f9f4cea
creating all services once on startup
yairsimantov20 Jul 19, 2023
ae4a95d
todo
yairsimantov20 Jul 19, 2023
a54637a
gitlab fixes
yairsimantov20 Jul 20, 2023
2def65e
fixed lint
yairsimantov20 Jul 20, 2023
d5aa96e
fixed lint
yairsimantov20 Jul 20, 2023
c7d96c5
addressed non async integration logic performance
yairsimantov20 Jul 20, 2023
f36aceb
default in the spec file
yairsimantov20 Jul 20, 2023
448279d
fixed lint
yairsimantov20 Jul 20, 2023
e72a45a
changelog fragments
yairsimantov20 Jul 20, 2023
5c8a4a3
Merge branch 'PORT-4294-Ocean-fixes' of github.com:port-labs/Port-Oce…
yairsimantov20 Jul 20, 2023
1482a3e
Merge branch 'main' of github.com:port-labs/Port-Ocean into gitlab-ap…
yairsimantov20 Jul 20, 2023
3c49033
Fixed cookiecutter and added helm chart installation example
danielsinai Jul 20, 2023
fc56f3c
Merge branch 'gitlab-app-POC' of https://github.com/port-labs/port-oc…
danielsinai Jul 20, 2023
ece0f4b
fixed gitops implementation
yairsimantov20 Jul 20, 2023
9110918
Merge branch 'gitlab-app-POC' of https://github.com/port-labs/port-oc…
danielsinai Jul 20, 2023
ce69a6d
updated version
yairsimantov20 Jul 20, 2023
aa53fdb
Merge branch 'gitlab-app-POC' of github.com:port-labs/Port-Ocean into…
yairsimantov20 Jul 20, 2023
269ed79
updated the readme
yairsimantov20 Jul 20, 2023
e4d57b6
Merge branch 'main' of github.com:port-labs/Port-Ocean into gitlab-ap…
yairsimantov20 Jul 20, 2023
b3709b9
cr requests
yairsimantov20 Jul 20, 2023
b449e3e
updated blueprints.json
yairsimantov20 Jul 20, 2023
6f4753e
added __project to gitlab pipeline
yairsimantov20 Jul 20, 2023
c3d2309
fixed schema
yairsimantov20 Jul 20, 2023
ab9f865
bump
yairsimantov20 Jul 20, 2023
9077632
bump
yairsimantov20 Jul 20, 2023
cebb840
bump ocean 0.1.0
yairsimantov20 Jul 20, 2023
f3e6479
gitlab integration first version
yairsimantov20 Jul 20, 2023
e7ad43b
Merge branch 'main' of github.com:port-labs/Port-Ocean into gitlab-ap…
yairsimantov20 Jul 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 9 additions & 13 deletions .github/workflows/release-integrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
workflow_dispatch:

jobs:
build-and-push-image:
release-all:
runs-on: ubuntu-latest
permissions:
packages: write
Expand All @@ -24,7 +24,7 @@ jobs:
run: |
GHCR_TOKEN=$(echo ${{ secrets.GITHUB_TOKEN }} | base64)

files=$(find integrations -name "ocean-spec.yaml")
files=$(find integrations/*/.port -name "spec.yaml")
for file in $files; do
# Get the type from ocean-spec.yaml
type=$(yq eval '.type' "$file")
Expand All @@ -41,7 +41,7 @@ jobs:
echo "Image already exists in $repository: port-ocean-$type:$version"
else
echo "Building and pushing new image: port-ocean-$type:$version"
docker build -t "ghcr.io/port-labs/port-ocean-$type:$version" -t "ghcr.io/port-labs/port-ocean-$type:latest" "$folder"
docker build -t "ghcr.io/port-labs/port-ocean-$type:$version" -t "ghcr.io/port-labs/port-ocean-$type:latest" "$folder/.."
docker push "ghcr.io/port-labs/port-ocean-$type" --all-tags
fi
done
Expand All @@ -51,12 +51,9 @@ jobs:
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Upload specifications to s3
run: |
# Directory to search for ocean-spec.yaml files
directory="integrations"

# Temporary file to store the concatenated YAML content
temp_file="temp.yaml"

Expand All @@ -67,14 +64,13 @@ jobs:
aws_s3_bucket="ocean-registry"

# Find all ocean-spec.yaml files under the specified directory
find "$directory" -type f -name "ocean-spec.yaml" > file_list.txt
find integrations/*/.port -type f -name "spec.yaml" > file_list.txt

# Concatenate the YAML files into a temporary file
while IFS= read -r file; do
cat "$file" >> "$temp_file"
echo "---" >> "$temp_file"
echo "- " >> "$temp_file"
sed 's/^/ /' "$file" >> "$temp_file"
done < file_list.txt

# Convert the concatenated YAML file to JSON using yq (install it first if not already installed)
yq -y . < "$temp_file" > "$output_file"
aws s3 cp "$output_file" "s3://$aws_s3_bucket/$output_file"
yq -j . < "$temp_file" > "$output_file"
aws s3 cp "$output_file" "s3://$aws_s3_bucket/$output_file"
6 changes: 6 additions & 0 deletions integrations/gitlab/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.vscode/
assets/
*.md
.git
.gitignore
.env
148 changes: 148 additions & 0 deletions integrations/gitlab/.port/resources/blueprints.json
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"
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any required ?

}
}
},
{
"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,
yairsimantov20 marked this conversation as resolved.
Show resolved Hide resolved
"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
}
}
}
]
54 changes: 54 additions & 0 deletions integrations/gitlab/.port/resources/port-app-config.yaml
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
27 changes: 27 additions & 0 deletions integrations/gitlab/.port/spec.yaml
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
yairsimantov20 marked this conversation as resolved.
Show resolved Hide resolved
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
16 changes: 16 additions & 0 deletions integrations/gitlab/Dockerfile
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
71 changes: 71 additions & 0 deletions integrations/gitlab/Makefile
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/
Loading