diff --git a/.env b/.env new file mode 100644 index 0000000..4b85a30 --- /dev/null +++ b/.env @@ -0,0 +1,47 @@ +SECRET_KEY_BASE=euciey3AitaevohReel3yee3AihoeSagroongaiAhaighoh2vahdee3ahsah6fu8baes4kee6zieTae6oz + +TZ=Europe/Moscow + +#homs +HOMS_URL=http://homs:3000/api +HOMS_PORT=3000 +HOMS_LOG_LEVEL=debug +HOMS_USER=user@example.com +HOMS_PASSWORD=changeme +HOMS_TOKEN=ycgx-Zi2ahrohiegae5ne4hb +HOMS_SSL=false +HOMS_TIMEOUT=30000 +HOMS_DB_HOST=postgres-homs +HOMS_DB_PORT=5432 +HOMS_DB_NAME=homs +HOMS_DB_USER=homs +HOMS_DB_PASSWORD=aen4EepheemeiChohquoomie +HOMS_DB_SEED=true + +#camunda +BPM_URL=http://bpm:8080/engine-rest +BPM_HOST=bpm +BPM_PROTOCOL=HTTP +BPM_PORT=8080 +BPM_USER=user@example.com +BPM_PASSWORD=changeme +BPM_DB_HOST=postgres-bpm +BPM_DB_PORT=5432 +BPM_DB_NAME=camunda +BPM_DB_USER=camunda +BPM_DB_PASSWORD=Beevo1UK1athev3p +BPM_DB_DRIVER=org.postgresql.Driver +BPM_DB_SEED=true +BPM_HISTORY_LEVEL=full +BPM_LOG_LEVEL=debug +HTTP_CONNECT_TIMEOUT_SEC=2400 +HTTP_READ_TIMEOUT_SEC=2400 +HTTP_WRITE_TIMEOUT_SEC=2400 + +#minio +MINIO_HOST=http://minio +MINIO_PORT=10000 +MINIO_BUCKET_NAME=homs +MINIO_ACCESS_KEY=ees5vu5Ohk3eed2aizoo4Iqu7Ai8poo9 +MINIO_SECRET_KEY=aezeib3Eik2xageep8biequah3lahhahMee5ahgai3zeeZohr3ea0boocheiW8ae +MINIO_SSL=false diff --git a/Dockerfile b/Dockerfile old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 index 2f27db8..8e087ba --- a/README.md +++ b/README.md @@ -1,31 +1,25 @@ # Camunda Extensions -## Requirements +Camunda-ext-2-lite is an open source part of the camunda-ext-2 library used to relief integration of business process with Hydra components and other systems. +Camunda-ext-2-lite includes the only connector - Hydra OMS connector, all other connects should be designed in the same way. -* [Kotlin](https://kotlinlang.org/docs/getting-started.html) `1.4.31` +### Requirements +* [Docker](https://docker.com/) +* [docker-compose](https://docs.docker.com/compose/install/) +* [Gradle](https://gradle.org/) `1.4.31` -## Building +### Compatibility +* [Camunda 7.14.0 compatible](https://docs.camunda.org/manual/7.14/introduction/) PostgreSQL 9.4 / 9.6 / 10 / 11 / 12 +* [Hydra OMS](https://hub.docker.com/r/latera/homs) 2.7.0 and later +* [Minio](https://github.com/minio/minio/releases/tag/RELEASE.2021-06-17T00-10-46Z) -``` -./gradlew clean build -``` +### Resources +* Documentation: https://github.com/hydra-billing/camunda-ext-2-lite/tree/master/docs +* Tickets/Issues: https://github.com/hydra-billing/camunda-ext-2-lite/issues +* Hydra OMS: https://github.com/hydra-billing/homs -## Testing +## Installation +Edit `.env` file if needed, then run +`docker-compose up -d` -Run all tests with: -``` -./gradlew cleanTest test -``` - -Run a single suite using filtering: -``` -./gradlew cleanTest test --tests OrderTest -``` - -## Documentation - -Generate documentation manually: -``` -./gradlew dokkaGfm -``` -You can read the documentation [here](docs). +Ports and credentials for Camunda, Minio, Hydra OMS are set in `env`. diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..4581f63 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,114 @@ +version: '2' +services: + db_bpm: + image: postgres:12-alpine + container_name: postgres-bpm + restart: always + env_file: ".env" + environment: + POSTGRES_DB: $BPM_DB_NAME + POSTGRES_USER: $BPM_DB_USER + POSTGRES_PASSWORD: $BPM_DB_PASSWORD + volumes: + - ./data/camunda/postgresql:/var/lib/postgresql/data + networks: + - postgres-bpm + db_homs: + image: postgres:12-alpine + container_name: postgres-homs + restart: always + env_file: ".env" + environment: + POSTGRES_DB: $HOMS_DB_NAME + POSTGRES_USER: $HOMS_DB_USER + POSTGRES_PASSWORD: $HOMS_DB_PASSWORD + volumes: + - ./data/homs/postgresql:/var/lib/postgresql/data + networks: + - postgres-homs + minio: + image: minio/minio + container_name: minio + restart: always + command: server /opt/minio --console-address "0.0.0.0:9001" + env_file: ".env" + environment: + - TZ=${TZ} + volumes: + - ./data/minio:/var/minio + ports: + - $MINIO_PORT:9001 + networks: + - default + - minio + homs: + image: latera/homs:2.7.0 + container_name: homs + restart: always + env_file: ".env" + environment: + - TZ=${TZ} + - RAILS_ENV=production + - SEED_DB=${HOMS_DB_SEED} + - LOG_LEVEL=${HOMS_LOG_LEVEL} + - ADMIN_EMAIL=${HOMS_USER} + - ADMIN_PASSWORD=${HOMS_PASSWORD} + - ADMIN_API_TOKEN=${HOMS_TOKEN} + - REDIS_URL=redis://redis + depends_on: + - db_homs + ports: + - $HOMS_PORT:3000 + networks: + - default + - postgres-homs + - bpm + - homs + - redis + - minio + bpm: + image: latera/camunda-ext-2-lite:6.0 + container_name: bpm + restart: always + env_file: ".env" + environment: + DB_USERNAME: $BPM_DB_USER + DB_PASSWORD: $BPM_DB_PASSWORD + WAIT_FOR: "${BPM_DB_HOST}:${BPM_DB_PORT}" + WAIT_FOR_TIMEOUT: 120 + ports: + - $BPM_PORT:8080 + depends_on: + - db_bpm + networks: + - default + - postgres-bpm + - homs + - minio + redis: + image: healthcheck/redis + container_name: redis + restart: always + environment: + - TZ=${TZ} + networks: + - redis +networks: + postgres-bpm: + internal: true + name: postgres-bpm + postgres-homs: + internal: true + name: postgres-homs + bpm: + internal: true + name: bpm + homs: + internal: true + name: homs + minio: + internal: true + name: minio + redis: + internal: true + name: redis diff --git a/docker/Dockerfile b/docker/Dockerfile index 8ef7f85..e9a9540 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -# build camunda-ext-2 +# build camunda-ext-2-lite FROM gradle:7.1.1 as camunda-ext-2-lite COPY ./lib ./gradle ./gradlew ./settings.gradle ./gradlew.bat /app/ diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7454180..e708b1c 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 69a9715..2a56324 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 744e882..4f906e0 100755 --- a/gradlew +++ b/gradlew @@ -72,7 +72,7 @@ case "`uname`" in Darwin* ) darwin=true ;; - MSYS* | MINGW* ) + MINGW* ) msys=true ;; NONSTOP* ) diff --git a/gradlew.bat b/gradlew.bat old mode 100644 new mode 100755 diff --git a/lib/gradle.lockfile b/lib/gradle.lockfile deleted file mode 100644 index 6470f3b..0000000 --- a/lib/gradle.lockfile +++ /dev/null @@ -1,113 +0,0 @@ -# This is a Gradle generated file for dependency locking. -# Manual edits can break the build and are not advised. -# This file is expected to be part of source control. -ch.qos.logback:logback-classic:1.2.3=compileClasspath,testCompileClasspath,testRuntimeClasspath -ch.qos.logback:logback-core:1.2.3=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-annotations:2.12.6=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-core:2.12.6=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-databind:2.12.6=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.12.6=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:2.12.6=compileClasspath -com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:2.12.6=compileClasspath -com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.12.6=compileClasspath -com.fasterxml.jackson.module:jackson-module-kotlin:2.12.6=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson:jackson-bom:2.12.6=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.github.shyiko.klob:klob:0.2.1=ktlint -com.google.code.gson:gson:2.8.6=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.pinterest.ktlint:ktlint-core:0.41.0=ktlint -com.pinterest.ktlint:ktlint-reporter-baseline:0.41.0=ktlint -com.pinterest.ktlint:ktlint-reporter-checkstyle:0.41.0=ktlint -com.pinterest.ktlint:ktlint-reporter-html:0.41.0=ktlint -com.pinterest.ktlint:ktlint-reporter-json:0.41.0=ktlint -com.pinterest.ktlint:ktlint-reporter-plain:0.41.0=ktlint -com.pinterest.ktlint:ktlint-ruleset-experimental:0.41.0=ktlint -com.pinterest.ktlint:ktlint-ruleset-standard:0.41.0=ktlint -com.pinterest.ktlint:ktlint-ruleset-test:0.41.0=ktlint -com.pinterest:ktlint:0.41.0=ktlint -commons-codec:commons-codec:1.10=compileClasspath,testCompileClasspath,testRuntimeClasspath -commons-fileupload:commons-fileupload:1.3.3=compileClasspath -commons-io:commons-io:2.2=compileClasspath -commons-logging:commons-logging:1.2=compileClasspath,testCompileClasspath,testRuntimeClasspath -info.picocli:picocli:3.9.6=ktlint -io.ktor:ktor-client-apache:1.5.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.ktor:ktor-client-auth-basic-jvm:1.5.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.ktor:ktor-client-auth-basic:1.5.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.ktor:ktor-client-auth-jvm:1.5.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.ktor:ktor-client-auth:1.5.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.ktor:ktor-client-core-jvm:1.5.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.ktor:ktor-client-core:1.5.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.ktor:ktor-client-gson:1.5.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.ktor:ktor-client-json-jvm:1.5.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.ktor:ktor-client-json:1.5.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.ktor:ktor-client-mock-jvm:1.5.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.ktor:ktor-client-mock:1.5.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.ktor:ktor-client:1.5.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.ktor:ktor-http-cio-jvm:1.5.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.ktor:ktor-http-cio:1.5.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.ktor:ktor-http-jvm:1.5.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.ktor:ktor-http:1.5.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.ktor:ktor-io-jvm:1.5.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.ktor:ktor-io:1.5.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.ktor:ktor-network-jvm:1.5.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.ktor:ktor-network:1.5.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.ktor:ktor-utils-jvm:1.5.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.ktor:ktor-utils:1.5.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -javax.servlet:javax.servlet-api:3.1.0=compileClasspath -joda-time:joda-time:2.1=compileClasspath -org.apache.httpcomponents:httpasyncclient:4.1.4=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.apache.httpcomponents:httpclient:4.5.6=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.apache.httpcomponents:httpcore-nio:4.4.10=compileClasspath,testCompileClasspath -org.apache.httpcomponents:httpcore-nio:4.4.13=testRuntimeClasspath -org.apache.httpcomponents:httpcore:4.4.10=compileClasspath,testCompileClasspath -org.apache.httpcomponents:httpcore:4.4.13=testRuntimeClasspath -org.apiguardian:apiguardian-api:1.1.0=testCompileClasspath,testRuntimeClasspath -org.assertj:assertj-core:3.18.1=testCompileClasspath,testRuntimeClasspath -org.camunda.bpm.dmn:camunda-engine-dmn:7.14.0=compileClasspath -org.camunda.bpm.dmn:camunda-engine-feel-api:7.14.0=compileClasspath -org.camunda.bpm.dmn:camunda-engine-feel-juel:7.14.0=compileClasspath -org.camunda.bpm.dmn:camunda-engine-feel-scala:7.14.0=compileClasspath -org.camunda.bpm.model:camunda-bpmn-model:7.14.0=compileClasspath -org.camunda.bpm.model:camunda-cmmn-model:7.14.0=compileClasspath -org.camunda.bpm.model:camunda-dmn-model:7.14.0=compileClasspath -org.camunda.bpm.model:camunda-xml-model:7.14.0=compileClasspath -org.camunda.bpm.webapp:camunda-webapp:7.14.0=compileClasspath -org.camunda.bpm:camunda-bom:7.14.0=compileClasspath -org.camunda.bpm:camunda-engine-rest-core:7.14.0=compileClasspath -org.camunda.bpm:camunda-engine-rest:7.14.0=compileClasspath -org.camunda.bpm:camunda-engine:7.14.0=compileClasspath -org.camunda.commons:camunda-commons-logging:1.9.0=compileClasspath -org.camunda.commons:camunda-commons-typed-values:7.14.0=compileClasspath -org.camunda.commons:camunda-commons-utils:1.9.0=compileClasspath -org.camunda.connect:camunda-connect-core:1.5.0=compileClasspath -org.ec4j.core:ec4j-core:0.3.0=ktlint -org.jetbrains.intellij.deps:trove4j:1.0.20181211=kotlinCompilerClasspath,ktlint -org.jetbrains.kotlin:kotlin-compiler-embeddable:1.4.31=kotlinCompilerClasspath,ktlint -org.jetbrains.kotlin:kotlin-daemon-embeddable:1.4.31=kotlinCompilerClasspath,ktlint -org.jetbrains.kotlin:kotlin-reflect:1.4.31=compileClasspath,kotlinCompilerClasspath,ktlint,testCompileClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-script-runtime:1.4.31=kotlinCompilerClasspath,kotlinCompilerPluginClasspath,ktlint,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-scripting-common:1.4.31=kotlinCompilerPluginClasspath -org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.4.31=kotlinCompilerPluginClasspath -org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.4.31=kotlinCompilerPluginClasspath -org.jetbrains.kotlin:kotlin-scripting-jvm:1.4.31=kotlinCompilerPluginClasspath -org.jetbrains.kotlin:kotlin-stdlib-common:1.4.31=compileClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspath,ktlint,testCompileClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.21=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.31=ktlint -org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.31=ktlint -org.jetbrains.kotlin:kotlin-stdlib:1.4.31=compileClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspath,ktlint,testCompileClasspath,testRuntimeClasspath -org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.4.2-native-mt=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.8=kotlinCompilerPluginClasspath -org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2-native-mt=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.jetbrains:annotations:13.0=compileClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspath,ktlint,testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-api:5.7.0=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-engine:5.7.0=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-commons:1.7.0=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-engine:1.7.0=testCompileClasspath,testRuntimeClasspath -org.junit:junit-bom:5.7.0=testCompileClasspath,testRuntimeClasspath -org.mybatis:mybatis:3.5.3=compileClasspath -org.opentest4j:opentest4j:1.2.0=testCompileClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:1.7.30=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework:spring-beans:5.2.8.RELEASE=compileClasspath -org.springframework:spring-core:5.2.8.RELEASE=compileClasspath -org.springframework:spring-jcl:5.2.8.RELEASE=compileClasspath -org.yaml:snakeyaml:1.27=compileClasspath,testCompileClasspath,testRuntimeClasspath -empty=ktlintReporter,ktlintRuleset diff --git a/settings.gradle b/settings.gradle old mode 100644 new mode 100755