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

Upgrade integrations & add CI #865

Merged
merged 30 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
36f792b
Upgraded dependencies and bumped version to 0.1.70 for argocd
Tankilevitch Jul 31, 2024
0daae19
Upgraded dependencies and bumped version to 0.2.20 for aws
Tankilevitch Jul 31, 2024
45be33d
Upgraded dependencies and bumped version to 0.1.74 for azure
Tankilevitch Jul 31, 2024
6ebbbfd
Upgraded dependencies and bumped version to 0.1.47 for azure-devops
Tankilevitch Jul 31, 2024
072ffd1
Upgraded dependencies and bumped version to 0.1.22 for datadog
Tankilevitch Jul 31, 2024
3256c8d
Upgraded dependencies and bumped version to 0.1.36 for dynatrace
Tankilevitch Jul 31, 2024
5602adb
Upgraded dependencies and bumped version to 0.1.59 for firehydrant
Tankilevitch Jul 31, 2024
574c237
Upgraded dependencies and bumped version to 0.1.34 for gcp
Tankilevitch Jul 31, 2024
e14753f
Upgraded dependencies and bumped version to 0.1.97 for gitlab
Tankilevitch Jul 31, 2024
9971771
Upgraded dependencies and bumped version to 0.1.42 for jenkins
Tankilevitch Jul 31, 2024
2fff829
Upgraded dependencies and bumped version to 0.1.69 for jira
Tankilevitch Jul 31, 2024
2c60eb3
Upgraded dependencies and bumped version to 0.1.59 for kafka
Tankilevitch Jul 31, 2024
67955c0
Upgraded dependencies and bumped version to 0.1.63 for kubecost
Tankilevitch Jul 31, 2024
b5c2036
Upgraded dependencies and bumped version to 0.1.35 for launchdarkly
Tankilevitch Jul 31, 2024
080d7c1
Upgraded dependencies and bumped version to 0.1.21 for linear
Tankilevitch Jul 31, 2024
5513466
Upgraded dependencies and bumped version to 0.1.64 for newrelic
Tankilevitch Jul 31, 2024
ae071de
Upgraded dependencies and bumped version to 0.1.62 for opencost
Tankilevitch Jul 31, 2024
2ef2616
Upgraded dependencies and bumped version to 0.1.62 for opsgenie
Tankilevitch Jul 31, 2024
4a34962
Upgraded dependencies and bumped version to 0.1.83 for pagerduty
Tankilevitch Jul 31, 2024
0b49f6d
Upgraded dependencies and bumped version to 0.1.62 for sentry
Tankilevitch Jul 31, 2024
759495a
Upgraded dependencies and bumped version to 0.1.51 for servicenow
Tankilevitch Jul 31, 2024
fd1fbd3
Upgraded dependencies and bumped version to 0.1.70 for snyk
Tankilevitch Jul 31, 2024
e0c4181
Upgraded dependencies and bumped version to 0.1.75 for sonarqube
Tankilevitch Jul 31, 2024
fdac7c1
Upgraded dependencies and bumped version to 0.1.10 for statuspage
Tankilevitch Jul 31, 2024
66f282b
Upgraded dependencies and bumped version to 0.1.49 for terraform-cloud
Tankilevitch Jul 31, 2024
25c269d
Upgraded dependencies and bumped version to 0.1.41 for wiz
Tankilevitch Jul 31, 2024
83ff254
add ci for testing integration builds
Tankilevitch Jul 31, 2024
f18ee46
build integrations images
Tankilevitch Jul 31, 2024
bf882a5
integrations to build
Tankilevitch Jul 31, 2024
1663cd6
remove login to docker
Tankilevitch Jul 31, 2024
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
104 changes: 104 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: Build integration images
on:
pull_request:
workflow_dispatch:

jobs:
prepare-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.prepare-matrix.outputs.INTEGRATIONS_MATRIX }}
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Prepare matrix
id: prepare-matrix
run: |
integrations_to_build=()
# Get the list of integrations
files=$(find integrations/*/.port -name "spec.yaml")
for file in $files; do
folder=$(dirname "$file")
type=$(grep -E '^name = ".*"' "$folder/../pyproject.toml" | cut -d'"' -f2)

# Get the version from pyproject.toml
version=$(grep -E '^version = ".*"' "$folder/../pyproject.toml" | cut -d'"' -f2)

# Check if the version exists in the ghcr.io registry
rc=0
docker manifest inspect ghcr.io/port-labs/port-ocean-$type:$version > /dev/null 2>&1 || rc=$?

if [ $rc -eq 0 ]; then
echo "Image already exists in $repository: port-ocean-$type:$version"
else
integrations_to_build+=($file)
fi
done
echo $(echo ${integrations_to_build[@]} | jq -R -c 'split(" ")')
echo "INTEGRATIONS_MATRIX=$(echo ${integrations_to_build[@]} | jq -R -c 'split(" ")')" >> $GITHUB_OUTPUT


build-integration:
runs-on: ubuntu-latest
if: needs.prepare-matrix.outputs.matrix != '[]'
outputs:
is_dev_version: ${{ steps.prepare_tags.outputs.is_dev_version }}
permissions:
contents: read
needs: [prepare-matrix]
strategy:
matrix:
integration: ${{fromJson(needs.prepare-matrix.outputs.matrix)}}
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: linux/amd64,linux/arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Prepare Docker images tags
id: prepare_tags
run: |
current_integration_spec=${{ matrix.integration }}

folder=$(dirname "$current_integration_spec")
context_dir=$(dirname "$folder")
echo "context_dir=$context_dir" >> $GITHUB_OUTPUT

version=$(grep -E '^version = ".*"' "$folder/../pyproject.toml" | cut -d'"' -f2)
type=$(grep -E '^name = ".*"' "$folder/../pyproject.toml" | cut -d'"' -f2)
echo "version=$version" >> $GITHUB_OUTPUT

dockerfile_path=integrations/_infra/Dockerfile
if test -e $folder/../Dockerfile; then
dockerfile_path=$folder/../Dockerfile
fi
echo "dockerfile_path=$dockerfile_path" >> $GITHUB_OUTPUT

# Check if the 'version' variable contains any character other than digits and "."
if [[ ! "$version" =~ ^[0-9.]+$ ]]; then
# If 'version' contains non-numeric and non-dot characters, skip building 'latest' tag
tags="ghcr.io/port-labs/port-ocean-$type:$version"
echo "tags=$tags" >> $GITHUB_OUTPUT
echo "is_dev_version=true" >> $GITHUB_OUTPUT
echo "Version contains non-numeric characters. Building without 'latest' tag."
else
# If 'version' contains only digits and dots, build with both 'latest' and version tags
tags="ghcr.io/port-labs/port-ocean-$type:$version,ghcr.io/port-labs/port-ocean-$type:latest"
echo "tags=$tags" >> $GITHUB_OUTPUT
echo "is_dev_version=false" >> $GITHUB_OUTPUT
fi

- name: Build
uses: docker/build-push-action@v6
with:
context: .
file: ${{ steps.prepare_tags.outputs.dockerfile_path }}
platforms: linux/amd64,linux/arm64
push: false
tags: ${{ steps.prepare_tags.outputs.tags }}
build-args: |
BUILD_CONTEXT=${{ steps.prepare_tags.outputs.context_dir }}
INTEGRATION_VERSION=${{ steps.prepare_tags.outputs.version }}
44 changes: 44 additions & 0 deletions .github/workflows/upgrade-integrations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Apply release

on:
workflow_dispatch:

jobs:
create_branch_and_open_pr:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install Poetry
uses: snok/install-poetry@v1

- name: Upgrade integrations
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"

./scripts/upgrade-integrations.sh


- name: Open pull request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.MACHINE_USER_TOKEN }}
title: ${{ steps.version.outputs.pr_name }}
branch: ${{ steps.version.outputs.branch_name }}
base: main
body: |
This PR was automatically created by a GitHub Action.

## What does this PR do?
Upgrade dependencies for all integrations

## How should this be manually tested?
./scripts/upgrade-integrations.sh
7 changes: 7 additions & 0 deletions integrations/argocd/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

<!-- towncrier release notes start -->

# Port_Ocean 0.1.70 (2024-07-31)

### Improvements

- Upgraded integration dependencies (#1)


# Port_Ocean 0.1.69 (2024-07-31)

### Improvements
Expand Down
Loading
Loading