From 18087b637f95f5c3c5a39007f884fb0e80cbc204 Mon Sep 17 00:00:00 2001 From: Egor Krasnov Date: Fri, 28 Oct 2022 14:30:55 +0300 Subject: [PATCH] Add README and docker-compose for rasy installation --- .env | 47 ++++++++++++++++ .github/workflows/ci.yml | 6 +-- README.md | 42 +++++++-------- docker-compose.yml | 114 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 182 insertions(+), 27 deletions(-) create mode 100644 .env create mode 100644 docker-compose.yml 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/.github/workflows/ci.yml b/.github/workflows/ci.yml index d407f1a..a3aecab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ on: - '**' env: - DOCKER_IMAGE: "latera/camunda-ext2-lite" + DOCKER_IMAGE: "latera/camunda-ext-2-lite" jobs: build: @@ -36,7 +36,7 @@ jobs: docker login -u ${{ secrets.DOCKER_HUB_USER }} -p ${{ secrets.DOCKER_HUB_PASSWORD }} docker push "${DOCKER_IMAGE}:${{ env.VERSION }}" docker create --name jar "${DOCKER_IMAGE}:${{ env.VERSION }}" - docker cp jar:/camunda/lib/camunda-7.14-ext-2-${{ env.VERSION }}.jar ./ + docker cp jar:/camunda/lib/camunda-7.14-ext-2-lite-${{ env.VERSION }}.jar ./ if: github.event.inputs.version != '' - name: create release uses: softprops/action-gh-release@v1 @@ -44,5 +44,5 @@ jobs: name: ${{ env.VERSION }} tag_name: ${{ env.VERSION }} target_commitish: ${{ github.sha }} - files: camunda-7.14-ext-2-${{ env.VERSION }}.jar + files: camunda-7.14-ext-2-lite-${{ env.VERSION }}.jar if: github.event.inputs.version != '' diff --git a/README.md b/README.md index 2f27db8..8e087ba 100755 --- 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