Skip to content

Commit

Permalink
Move Connector Runtime to bundle mono repo (#493)
Browse files Browse the repository at this point in the history
  • Loading branch information
chillleader committed May 2, 2023
1 parent e5a6c37 commit 86752e3
Show file tree
Hide file tree
Showing 87 changed files with 4,372 additions and 46 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/DEPLOY.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ jobs:
- name: Lint Connector Bundle Dockerfile - SaaS
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: bundle/mvn/camunda-saas-bundle/Dockerfile
dockerfile: bundle/camunda-saas-bundle/Dockerfile

- name: Lint Connector Bundle Dockerfile - default-bundle
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: bundle/mvn/default-bundle/Dockerfile
dockerfile: bundle/default-bundle/Dockerfile

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
Expand All @@ -86,7 +86,7 @@ jobs:
- name: Build and Push Docker Image tag SNAPSHOT - bundle-default
uses: docker/build-push-action@v4
with:
context: bundle/mvn/default-bundle/
context: bundle/default-bundle/
push: ${{ github.ref == 'refs/heads/main' }}
tags: camunda/connectors-bundle:SNAPSHOT
platforms: linux/amd64,linux/arm64
Expand All @@ -95,7 +95,7 @@ jobs:
- name: Build and Push Docker Image tag SNAPSHOT - bundle-saas
uses: docker/build-push-action@v4
with:
context: bundle/mvn/camunda-saas-bundle/
context: bundle/camunda-saas-bundle/
push: ${{ github.ref == 'refs/heads/main' }}
tags: camunda/connectors-bundle-saas:SNAPSHOT
platforms: linux/amd64,linux/arm64
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/RELEASE.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ jobs:
- name: Build and Push Docker Image tag ${{ github.event.inputs.version }} - bundle-default
uses: docker/build-push-action@v4
with:
context: bundle/mvn/default-bundle/
context: bundle/default-bundle/
push: ${{ github.ref == 'refs/heads/main' }}
tags: camunda/connectors-bundle:${{ github.event.inputs.version }}
platforms: linux/amd64,linux/arm64
Expand All @@ -150,17 +150,17 @@ jobs:
- name: Build and Push Docker Image tag ${{ github.event.inputs.version }}-focal - bundle-default
uses: docker/build-push-action@v4
with:
context: bundle/mvn/default-bundle/
context: bundle/default-bundle/
push: ${{ github.ref == 'refs/heads/main' }}
tags: camunda/connectors-bundle:${{ github.event.inputs.version }}-focal
platforms: linux/amd64,linux/arm64
provenance: false
file: bundle/mvn/default-bundle/Dockerfile-focal
file: bundle/default-bundle/Dockerfile-focal

- name: Build and Push Docker Image tag ${{ github.event.inputs.version }} - bundle-saas
uses: docker/build-push-action@v4
with:
context: bundle/mvn/camunda-saas-bundle/
context: bundle/camunda-saas-bundle/
push: ${{ github.ref == 'refs/heads/main' }}
tags: camunda/connectors-bundle-saas:${{ github.event.inputs.version }}
platforms: linux/amd64,linux/arm64
Expand All @@ -172,7 +172,7 @@ jobs:
if: ${{ steps.check_prerelease.outputs.isPreRelease == 'false' }}
uses: docker/build-push-action@v4
with:
context: bundle/mvn/default-bundle/
context: bundle/default-bundle/
push: ${{ github.ref == 'refs/heads/main' }}
tags: camunda/connectors-bundle:latest
platforms: linux/amd64,linux/arm64
Expand All @@ -182,7 +182,7 @@ jobs:
if: ${{ steps.check_prerelease.outputs.isPreRelease == 'false' }}
uses: docker/build-push-action@v4
with:
context: bundle/mvn/camunda-saas-bundle/
context: bundle/camunda-saas-bundle/
push: ${{ github.ref == 'refs/heads/main' }}
tags: camunda/connectors-bundle-saas:latest
platforms: linux/amd64,linux/arm64
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/TEST.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ jobs:
- name: Lint Connector Bundle Dockerfile - SaaS
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: bundle/mvn/camunda-saas-bundle/Dockerfile
dockerfile: bundle/camunda-saas-bundle/Dockerfile

- name: Lint Connector Bundle Dockerfile - default-bundle
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: bundle/mvn/default-bundle/Dockerfile
dockerfile: bundle/default-bundle/Dockerfile
23 changes: 23 additions & 0 deletions .github/workflows/mvn-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Build via Maven and run tests

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
- name: Build with Maven
run: mvn --batch-mode --update-snapshots package
56 changes: 56 additions & 0 deletions .github/workflows/mvn-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# If this workflow is triggered by a push to $default_branch, it
# deploys a SNAPSHOT
# If this workflow is triggered by publishing a Release, it
# deploys a RELEASE with the selected version
# updates the project version by incrementing the patch version
# commits the version update change to the repository's default branch.
name: Deploy artifacts with Maven

on:
push:
branches:
- main
release:
types: [ published ]
jobs:
publish:
runs-on: ubuntu-20.04
steps:

- name: Check out code
uses: actions/checkout@v3

- name: Set up Java environment
uses: actions/setup-java@v3
with:
java-version: 17
distribution: zulu
cache: maven
gpg-private-key: ${{ secrets.MAVEN_CENTRAL_GPG_SIGNING_KEY_SEC }}
gpg-passphrase: MAVEN_CENTRAL_GPG_PASSPHRASE

- name: Deploy SNAPSHOT / Release
uses: camunda-community-hub/community-action-maven-release@v1
with:
release-version: ${{ github.event.release.tag_name }}
maven-url: s01.oss.sonatype.org
nexus-usr: ${{ secrets.NEXUS_USR }}
nexus-psw: ${{ secrets.NEXUS_PSW }}
maven-usr: ${{ secrets.MAVEN_CENTRAL_DEPLOYMENT_USR }}
maven-psw: ${{ secrets.MAVEN_CENTRAL_DEPLOYMENT_PSW }}
maven-additional-options: -U
maven-gpg-passphrase: ${{ secrets.MAVEN_CENTRAL_GPG_SIGNING_KEY_PASSPHRASE }}
maven-auto-release-after-close: true
github-token: ${{ secrets.GITHUB_TOKEN }}
id: release

- if: github.event.release
name: Attach artifacts to GitHub Release (Release only)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ steps.release.outputs.artifacts_archive_path }}
asset_name: ${{ steps.release.outputs.artifacts_archive_path }}
asset_content_type: application/zip
Binary file added .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
1 change: 1 addition & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.2/apache-maven-3.5.2-bin.zip
6 changes: 3 additions & 3 deletions bundle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The Connectors Bundle contains all out-of-the-box Connectors for Camunda 8. It's

The bundle contains the following components

| Component | Version | License |
| Component | Version | License |
|--------------------------------|---------|----------------------------------------------|
| [Connector Runtime] | 0.8.1 | [Apache 2.0] |
| Asana Connector | 0.18.2 | [Camunda Platform Self-Managed Free Edition] |
Expand All @@ -31,14 +31,14 @@ The bundle contains the following components
| Slack Connector | 0.18.2 | [Camunda Platform Self-Managed Free Edition] |
| UiPath Connector | 0.18.2 | [Camunda Platform Self-Managed Free Edition] |

**Note:**
**Note:**
- This list only includes Camunda 8 out-of-the-box Connectors that have their own implementation.
Some of these Connectors are **Protocol Connectors**, which means they are compatible with more than one element template.
- Some out-of-the-box Connectors in Camunda 8 only exist in the form of element-template for Protocol Connectors.
Such template-only Connectors are also compatible with this bundle.


The [`Dockerfile`](./mvn/default-bundle/Dockerfile) provides an image including the [Connector Runtime]
The [`Dockerfile`](./default-bundle/Dockerfile) provides an image including the [Connector Runtime]
and all [out-of-the-box Connectors](https://docs.camunda.io/docs/components/connectors/out-of-the-box-connectors/available-connectors-overview/)
provided by Camunda. The image starts the Connector Runtime with all `jar`
files provided in the `/opt/app` directory as classpath.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ RUN mkdir /opt/app
COPY target/*-with-dependencies.jar /opt/app/

# Using entry point to allow downstream images to add JVM arguments using CMD
ENTRYPOINT ["java", "-cp", "/opt/app/*", "io.camunda.connector.runtime.SaaSConnectorRuntimeApplication"]
ENTRYPOINT ["java", "-cp", "/opt/app/*", "io.camunda.connector.runtime.saas.SaaSConnectorRuntimeApplication"]
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ Needs:

Run

* io.camunda.connector.runtime.SaaSConnectorRuntimeApplication
* io.camunda.connector.runtime.saas.SaaSConnectorRuntimeApplication
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<configuration>
<mainClass>io.camunda.connector.runtime.SaaSConnectorRuntimeApplication</mainClass>
<mainClass>io.camunda.connector.runtime.saas.SaaSConnectorRuntimeApplication</mainClass>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -98,7 +98,7 @@
<resource>META-INF/io.netty.versions.properties</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>io.camunda.connector.runtime.SaaSConnectorRuntimeApplication</mainClass>
<mainClass>io.camunda.connector.runtime.saas.SaaSConnectorRuntimeApplication</mainClass>
</transformer>
</transformers>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.camunda.connector.runtime;
package io.camunda.connector.runtime.saas;

import io.camunda.connector.api.secret.SecretProvider;
import io.camunda.connector.runtime.cloud.GcpSecretManagerSecretProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.camunda.connector.runtime;
package io.camunda.connector.runtime.saas;

import io.camunda.zeebe.spring.client.EnableZeebeClient;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;

@SpringBootApplication
@EnableScheduling
@EnableZeebeClient
public class SaaSConnectorRuntimeApplication {

public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.camunda.connector.runtime;
package io.camunda.connector.runtime.saas;

import io.camunda.connector.api.secret.SecretProvider;
import io.camunda.operate.CamundaOperateClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.camunda.connector.runtime.security;
package io.camunda.connector.runtime.saas.security;

import org.springframework.security.oauth2.core.OAuth2Error;
import org.springframework.security.oauth2.core.OAuth2TokenValidator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.camunda.connector.runtime.security;
package io.camunda.connector.runtime.saas.security;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/
package io.camunda.connector.runtime;

import io.camunda.connector.runtime.saas.SaaSConnectorRuntimeApplication;
import org.springframework.boot.SpringApplication;

public class LocalConnectorRuntime {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/
package io.camunda.connector.runtime;

import io.camunda.connector.runtime.saas.SaaSConnectorRuntimeApplication;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
Expand Down
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion bundle/mvn/README.md → bundle/default-bundle/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

Run via Maven / IDE:

Run `LocalConnectorRuntime` class via your favorite IDE.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

<dependencies>
<dependency>
<groupId>io.camunda.spring</groupId>
<artifactId>spring-zeebe-connector-runtime</artifactId>
<groupId>io.camunda.connector</groupId>
<artifactId>spring-boot-starter-camunda-connectors</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
* under one or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information regarding copyright
* ownership. Camunda licenses this file to you under the Apache License,
* Version 2.0; you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.camunda.connector.runtime;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class ConnectorRuntimeApplication {

public static void main(String[] args) {
SpringApplication.run(ConnectorRuntimeApplication.class, args);
}
}
13 changes: 13 additions & 0 deletions bundle/default-bundle/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
camunda.connector.polling.enabled=true
camunda.connector.polling.interval=5000

camunda.connector.webhook.enabled=true
#spring.main.web-application-type=none

# uncomment to activate inbound and adjust operate config if necessary
#operate.client.enabled=true
# Operate config for use with docker-compose-core.yml
#camunda.operate.client.url=http://localhost:8081
#camunda.operate.client.username=demo
#camunda.operate.client.password=demo
#camunda.connector.webhook.enabled=true
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@
*/
package io.camunda.connector.bundle;

import io.camunda.connector.runtime.ConnectorRuntimeApplication;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class LocalConnectorRuntime {

public static void main(String[] args) {
SpringApplication.run(ConnectorRuntimeApplication.class, args);
SpringApplication.run(LocalConnectorRuntime.class, args);
}
}
19 changes: 19 additions & 0 deletions bundle/default-bundle/src/test/resources/application.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Configuration for running connectors locally in bundle with connector-runtime
server.port=9898
zeebe.broker.gateway-address=localhost:26500
zeebe.client.security.plaintext=true

management.server.port=9080
management.context-path=/actuator
management.endpoints.web.exposure.include=metrics,health,prometheus

camunda.connector.polling.enabled=true
camunda.connector.polling.interval=5000
operate.client.enabled=true
# Operate config for use with docker-compose-core.yml
camunda.operate.client.url=http://localhost:8081
camunda.operate.client.username=demo
camunda.operate.client.password=demo
camunda.connector.webhook.enabled=true

logging.level.io.camunda.connector=trace
File renamed without changes.
Loading

0 comments on commit 86752e3

Please sign in to comment.