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

Restructure repo #86

Merged
merged 8 commits into from
Sep 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ name: Java CI with Maven

on:
push:
branches: [ "main" ]
branches: [ "main" , "develop" ]
pull_request:
branches: [ "main" ]

Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,5 @@ build/
.vscode/

# environment
docker/.env
request*.json
/.local/
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM maven:3.9.3-eclipse-temurin-17 as DEPS
WORKDIR /opt/app
COPY connector-aws-s3/pom.xml connector-aws-s3/pom.xml
COPY connector-aws-s3-example/pom.xml connector-aws-s3-example/pom.xml
COPY connector-file-api/pom.xml connector-file-api/pom.xml
COPY pom.xml .

RUN mvn -B -e -C org.apache.maven.plugins:maven-dependency-plugin:3.1.2:go-offline -DexcludeArtifactIds=connector-file-api,connector-aws-s3-example

FROM maven:3.9.3-eclipse-temurin-17 as BUILDER
WORKDIR /opt/app
COPY --from=DEPS /root/.m2 /root/.m2
COPY --from=DEPS /opt/app/ /opt/app
COPY connector-aws-s3/src /opt/app/connector-aws-s3/src
COPY connector-aws-s3-example/src /opt/app/connector-aws-s3-example/src
COPY connector-file-api/src /opt/app/connector-file-api/src

RUN mvn -B -e clean install -DskipTests=true

FROM arm64v8/openjdk:17
WORKDIR /opt/app
COPY --from=BUILDER /opt/app/connector-aws-s3/target/connector-aws-s3-1.1.0-SNAPSHOT.jar /connector.jar
ENV AWS_ACCESS_KEY=xxx
ENV AWS_SECRET_KEY=xxx
CMD [ "java", "-jar", "/connector.jar" ]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ NOTE: This behaviour will most likely be improved in the future

## FileAdapter

The connector has two file adapters:
The connector uses two file adapters:

- *cloud file adapter* to S3
- *local file adapter* to the local file system
Expand Down
38 changes: 38 additions & 0 deletions connector-aws-s3-example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr

### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/

### Mac OS ###
.DS_Store
39 changes: 39 additions & 0 deletions connector-aws-s3-example/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>de.novatec.bpm.camunda.connector</groupId>
<artifactId>connector-aws-s3-parent</artifactId>
<version>1.1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<groupId>de.novatec.bpm</groupId>
<artifactId>connector-aws-s3-example</artifactId>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>de.novatec.bpm</groupId>
<artifactId>connector-aws-s3</artifactId>
<version>1.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>de.novatec.bpm</groupId>
<artifactId>connector-file-api</artifactId>
<version>1.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.camunda.spring</groupId>
<artifactId>spring-boot-starter-camunda</artifactId>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package de.novatec.bpm.camunda.connector.aws.s3;

import de.novatec.bpm.camunda.connector.aws.s3.adapter.in.process.MyJobWorker;
import de.novatec.bpm.camunda.connector.file.api.LocalFileCommand;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AppConfiguration {

@Bean
MyJobWorker jobWorker(LocalFileCommand localFileCommand) {
return new MyJobWorker(localFileCommand);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package de.novatec.bpm.camunda.connector.aws.s3;

import io.camunda.zeebe.spring.client.annotation.Deployment;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
@Deployment(resources = "bpmn/example.bpmn")
public class MyProcessApplication {

public static void main(String[] args) {
SpringApplication.run(MyProcessApplication.class, args);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package de.novatec.bpm.camunda.connector.aws.s3.adapter.in.process;

import de.novatec.bpm.camunda.connector.aws.s3.usecase.out.LocalFileCommand;
import de.novatec.bpm.camunda.connector.file.api.LocalFileCommand;
import io.camunda.zeebe.client.api.response.ActivatedJob;
import io.camunda.zeebe.spring.client.annotation.JobWorker;
import io.camunda.zeebe.spring.client.annotation.Variable;
Expand Down
38 changes: 38 additions & 0 deletions connector-aws-s3/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr

### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/

### Mac OS ###
.DS_Store
113 changes: 113 additions & 0 deletions connector-aws-s3/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>de.novatec.bpm.camunda.connector</groupId>
<artifactId>connector-aws-s3-parent</artifactId>
<version>1.1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<licenses>
<license>
<name>Camunda Platform Self-Managed Free Edition license</name>
<url>
https://camunda.com/legal/terms/cloud-terms-and-conditions/camunda-cloud-self-managed-free-edition-terms/
</url>
</license>
<license>
<name>Camunda Platform Self-Managed Enterprise Edition license</name>
</license>
</licenses>

<name>connector-aws-s3</name>
<description>AWS S3 connector for Camunda 8</description>
<groupId>de.novatec.bpm</groupId>
<artifactId>connector-aws-s3</artifactId>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>de.novatec.bpm</groupId>
<artifactId>connector-file-api</artifactId>
<version>1.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>s3</artifactId>
</dependency>
<dependency>
<groupId>io.camunda.connector</groupId>
<artifactId>connector-core</artifactId>
</dependency>
<dependency>
<groupId>io.camunda.connector</groupId>
<artifactId>connector-validation</artifactId>
</dependency>
<dependency>
<groupId>io.camunda.connector</groupId>
<artifactId>connector-test</artifactId>
</dependency>
<dependency>
<groupId>io.camunda.connector</groupId>
<artifactId>spring-boot-starter-camunda-connectors</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>


<!-- test dependencies -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package de.novatec.bpm.camunda.connector.aws.s3.common;
package de.novatec.bpm.camunda.connector.aws.s3;

import de.novatec.bpm.camunda.connector.aws.s3.adapter.in.process.ConnectorAdapter;
import de.novatec.bpm.camunda.connector.aws.s3.adapter.in.process.MyJobWorker;
import de.novatec.bpm.camunda.connector.aws.s3.adapter.out.cloud.CloudClientFactory;
import de.novatec.bpm.camunda.connector.aws.s3.adapter.out.cloud.CloudFileAdapter;
import de.novatec.bpm.camunda.connector.aws.s3.adapter.out.local.LocalFileAdapter;
import de.novatec.bpm.camunda.connector.aws.s3.domain.CloudFileService;
import de.novatec.bpm.camunda.connector.aws.s3.usecase.in.FileCommand;
import de.novatec.bpm.camunda.connector.aws.s3.usecase.out.CloudFileCommand;
import de.novatec.bpm.camunda.connector.aws.s3.usecase.out.LocalFileCommand;
import de.novatec.bpm.camunda.connector.file.api.CloudFileCommand;
import de.novatec.bpm.camunda.connector.file.api.FileCommand;
import de.novatec.bpm.camunda.connector.file.api.LocalFileCommand;
import de.novatec.bpm.camunda.connector.file.api.impl.CloudFileService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

Expand All @@ -19,7 +18,7 @@
public class ConnectorConfiguration {

@Bean
CloudFileCommand s3Command(CloudClientFactory clientFactory) {
CloudFileCommand cloudFileCommand(CloudClientFactory clientFactory) {
return new CloudFileAdapter(clientFactory);
}

Expand All @@ -42,9 +41,4 @@ FileCommand fileCommand(CloudFileCommand cloudFileCommand, LocalFileCommand loca
ConnectorAdapter connector(FileCommand fileCommand) {
return new ConnectorAdapter(fileCommand);
}

@Bean
MyJobWorker jobWorker(LocalFileCommand localFileCommand) {
return new MyJobWorker(localFileCommand);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import de.novatec.bpm.camunda.connector.aws.s3.adapter.in.process.model.ConnectorRequest;
import de.novatec.bpm.camunda.connector.aws.s3.adapter.in.process.model.ConnectorResponse;
import de.novatec.bpm.camunda.connector.aws.s3.domain.model.RequestData;
import de.novatec.bpm.camunda.connector.aws.s3.usecase.in.FileCommand;
import de.novatec.bpm.camunda.connector.file.api.FileCommand;
import de.novatec.bpm.camunda.connector.file.api.impl.model.RequestData;
import io.camunda.connector.api.annotation.OutboundConnector;
import io.camunda.connector.api.outbound.OutboundConnectorContext;
import io.camunda.connector.api.outbound.OutboundConnectorFunction;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package de.novatec.bpm.camunda.connector.aws.s3.adapter.in.process;

import de.novatec.bpm.camunda.connector.aws.s3.adapter.in.process.model.ConnectorRequest;
import de.novatec.bpm.camunda.connector.aws.s3.domain.model.RequestData;
import de.novatec.bpm.camunda.connector.file.api.impl.model.RequestData;

import java.util.Objects;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package de.novatec.bpm.camunda.connector.aws.s3.adapter.in.process.model;

import de.novatec.bpm.camunda.connector.aws.s3.domain.model.RequestData;
import de.novatec.bpm.camunda.connector.file.api.impl.model.RequestData;
import lombok.Data;
import lombok.NoArgsConstructor;

Expand Down
Loading