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

add camunda-modeler-deployment-plugin project #67

Merged
merged 19 commits into from
Nov 28, 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
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,24 @@ updates:
- dependency-name: "react*"
open-pull-requests-limit: 10

- package-ecosystem: "npm"
directory: "/camunda-modeler-formio-plugin"
schedule:
interval: "weekly"
allow:
# Allow updates for React and any packages starting "react"
- dependency-name: "react*"
open-pull-requests-limit: 10

- package-ecosystem: "npm"
directory: "/camunda-modeler-deployment-plugin"
schedule:
interval: "weekly"
allow:
# Allow updates for React and any packages starting "react"
- dependency-name: "react*"
open-pull-requests-limit: 10

- package-ecosystem: "github-actions"
# Workflow files stored in the
# default location of `.github/workflows`
Expand Down
101 changes: 88 additions & 13 deletions .github/workflows/build-test-and-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,28 +123,97 @@ jobs:
zip -r -l ~/formio-plugin.zip ./
env:
NODE_OPTIONS: "--openssl-legacy-provider"
- name: install modeller
- name: Upload build results
uses: actions/upload-artifact@v3
with:
name: plugin
path: ~/formio-plugin.zip
retention-days: 1
build-deployment-plugin:
name: Build Camunda Modeler Deployment Plugin
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 18
- name: build plugin
run: |
wget https://downloads.camunda.cloud/release/camunda-modeler/5.12.1/camunda-modeler-5.12.1-linux-x64.tar.gz
tar -xvf camunda-modeler*.tar.gz
mkdir -p ~/.config/camunda-modeler/plugins
cp -R ./camunda-modeler-formio-plugin/resources/plugins/formio-plugin ~/.config/camunda-modeler/plugins
cd ./camunda-modeler-deployment-plugin
chmod +x ./install.sh
export MODELER_DIR=$(pwd)
npm install -f
npm run build
cd ${MODELER_DIR}/resources/plugins/deploy-plugin
zip -r -l ~/deploy-plugin.zip ./
env:
NODE_OPTIONS: "--openssl-legacy-provider"
- name: Upload build results
uses: actions/upload-artifact@v3
with:
name: deploy-plugin
path: ~/deploy-plugin.zip
retention-days: 1
run-modeler-tests:
name: Run modeler tests
needs:
- build-plugin
- build-deployment-plugin
- build-maven
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "17"
- uses: actions/download-artifact@v3
with:
name: plugin
path: ./
- uses: actions/download-artifact@v3
with:
name: deploy-plugin
path: ./
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GH_TOKEN }}
- name: run services
env:
CR_PAT: ${{ secrets.GH_TOKEN }}
run: |
sed -i -e "s/IMAGE_TAG=.*/IMAGE_TAG=${{ needs.build-maven.outputs.tag }}/" ./.env
docker compose pull
docker compose -f "docker-compose.yml" up -d --no-build
- name: install modeller
run: |
wget https://downloads.camunda.cloud/release/camunda-modeler/5.16.0/camunda-modeler-5.16.0-linux-x64.tar.gz
tar -xvf camunda-modeler*.tar.gz
mkdir -p ~/.config/camunda-modeler/plugins
unzip formio-plugin.zip -d ~/.config/camunda-modeler/plugins/formio-plugin
unzip deploy-plugin.zip -d ~/.config/camunda-modeler/plugins/deploy-plugin
cd ./cucumber-tests
chmod +x ./healthcheck.sh
./healthcheck.sh
- name: Run Camunda Modeler test
uses: coactions/setup-xvfb@v1.0.1
with:
run: mvn clean verify -ntp -Dcucumber.filter.tags="@modeler"
working-directory: ./cucumber-tests
options: #optional
- name: Upload build results
uses: actions/upload-artifact@v3
with:
name: plugin
path: ~/formio-plugin.zip
retention-days: 1
run-tests:
name: Run Tests
needs: [ build-maven ]
Expand Down Expand Up @@ -201,6 +270,8 @@ jobs:
needs:
- build-maven
- build-plugin
- build-deployment-plugin
- run-modeler-tests
- run-tests
runs-on: ubuntu-latest
steps:
Expand All @@ -222,6 +293,10 @@ jobs:
with:
name: plugin
path: ./
- uses: actions/download-artifact@v3
with:
name: deploy-plugin
path: ./
- name: MVN set version
run: |
mvn versions:set -DnewVersion=$NEW_VERSION
Expand All @@ -240,7 +315,7 @@ jobs:
- name: Release it
run: |
export PREV_VERSION=$(gh release list | grep Latest | awk '{print $3}')
gh release create v$NEW_VERSION --title v$NEW_VERSION --notes-start-tag $PREV_VERSION --generate-notes --latest ./formio-plugin.zip
gh release create v$NEW_VERSION --title v$NEW_VERSION --notes-start-tag $PREV_VERSION --generate-notes --latest ./formio-plugin.zip ./deploy-plugin.zip
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NEW_VERSION: ${{ needs.build-maven.outputs.version }}
3 changes: 3 additions & 0 deletions .github/workflows/codacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Codacy Security Scan

on:
push:
branches:
- main
- 0.0.x
schedule:
- cron: '0 0 * * 0'

Expand Down
2 changes: 1 addition & 1 deletion camunda-formio-bpmn/simple-task.bpmn
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,4 @@ print('Variable: ' + execution.getVariable("action"));</bpmn:script>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>
</bpmn:definitions>
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,19 @@

import jakarta.annotation.PostConstruct;
import java.util.AbstractMap;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import lombok.SneakyThrows;
import org.camunda.bpm.engine.ProcessEngine;
import org.camunda.bpm.engine.RepositoryService;
import org.camunda.bpm.engine.impl.context.Context;
import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity;
import org.camunda.bpm.engine.impl.pvm.process.ActivityImpl;
import org.camunda.bpm.engine.variable.value.IntegerValue;
import org.softcannery.formio.model.FormKey;
import org.softcannery.formio.model.SubmissionEntity;
import org.softcannery.formio.model.SubmissionValue;
import org.softcannery.formio.repository.SubmissionHistoryRepository;
Expand Down
6 changes: 3 additions & 3 deletions camunda-formio-react-app/src/components/Footer.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React, { Component } from "react";
import { Menu } from "semantic-ui-react";
import React, {Component} from "react";
import {Menu} from "semantic-ui-react";

export default class Footer extends Component {
render() {
return (
<footer className="footer">
<Menu inverted fluid widths={1}>
<Menu.Item>Caledo Process Forms React Application</Menu.Item>
<Menu.Item>Camunda Process Form.io Application</Menu.Item>
</Menu>
</footer>
);
Expand Down
29 changes: 29 additions & 0 deletions camunda-modeler-deployment-plugin/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"plugins": [
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-proposal-class-properties"
],
"presets": [
[
"@babel/preset-env", {
"modules": false,
"targets": {
"chrome": "78"
}
}
],
"@babel/preset-react"
],
"env": {
"coverage": {
"plugins": [
[ "istanbul", {
"exclude": [
"**/__tests__/**",
"**/test/**"
]
} ]
]
}
}
}
57 changes: 57 additions & 0 deletions camunda-modeler-deployment-plugin/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#
# Camunda Platform Accelerator for Form.io Community License v1.0
#
# This Camunda Platform Accelerator for Form.io Community License v1.0 (“this Agreement”) sets
# forth the terms and conditions on which Soft Cannery LTD. (“the Licensor”) makes available
# this software (“the Software”). BY INSTALLING, DOWNLOADING, ACCESSING, USING OR DISTRIBUTING
# THE SOFTWARE YOU INDICATE YOUR ACCEPTANCE TO, AND ARE ENTERING INTO A CONTRACT WITH,
# THE LICENSOR ON THE TERMS SET OUT IN THIS AGREEMENT. IF YOU DO NOT AGREE TO THESE TERMS,
# YOU MUST NOT USE THE SOFTWARE. IF YOU ARE RECEIVING THE SOFTWARE ON BEHALF OF A LEGAL ENTITY,
# YOU REPRESENT AND WARRANT THAT YOU HAVE THE ACTUAL AUTHORITY TO AGREE TO THE TERMS AND
# CONDITIONS OF THIS AGREEMENT ON BEHALF OF SUCH ENTITY. “Licensee” means you, an individual,
# or the entity on whose behalf you are receiving the Software.
#
# Permission is hereby granted, free of charge, to the Licensee obtaining a copy of this
# Software and associated documentation files, to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge, publish, distribute,
# sublicense, and/or sell copies of the Software, and to permit persons to whom the Software
# is furnished to do so, subject in each case to the following conditions:
#
# Condition 1: If the Licensee distributes the Software or any derivative works of the Software,
# the Licensee must attach this Agreement.
#
# Condition 2: Without limiting other conditions in this Agreement, the grant of rights under
# this Agreement does not include the right to provide Commercial Product or Service. Written
# permission from the Licensor is required to provide Commercial Product or Service.
#
# A “Commercial Product or Service” is software or service intended for or directed towards
# commercial advantage or monetary compensation for the provider of the product or service
# enabling parties to deploy and/or execute Commercial Product or Service.
#
# If the Licensee is in breach of the Conditions, this Agreement, including the rights granted
# under it, will automatically terminate with immediate effect.
#
# SUBJECT AS SET OUT BELOW, THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
# NOTHING IN THIS AGREEMENT EXCLUDES OR RESTRICTS A PARTY’S LIABILITY FOR (A) DEATH OR PERSONAL
# INJURY CAUSED BY THAT PARTY’S NEGLIGENCE, (B) FRAUD, OR (C) ANY OTHER LIABILITY TO THE EXTENT
# THAT IT CANNOT BE LAWFULLY EXCLUDED OR RESTRICTED.
#

root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
2 changes: 2 additions & 0 deletions camunda-modeler-deployment-plugin/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
dist/
10 changes: 10 additions & 0 deletions camunda-modeler-deployment-plugin/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"env": {
"browser": true,
"es6": true
},
"extends": [
"plugin:bpmn-io/es6",
"plugin:bpmn-io/jsx"
]
}
66 changes: 66 additions & 0 deletions camunda-modeler-deployment-plugin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next

.DS_Store
dist/

.idea/
3 changes: 3 additions & 0 deletions camunda-modeler-deployment-plugin/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
language: node_js

node_js: '10'
Loading