Skip to content

Commit 6f264e9

Browse files
committed
Merge branch 'development'
2 parents e4e7913 + b4b642a commit 6f264e9

29 files changed

+933
-638
lines changed

.cfformat.json

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
{
22
"array.empty_padding": false,
33
"array.padding": true,
4-
"array.multiline.min_length": 40,
4+
"array.multiline.min_length": 50,
55
"array.multiline.element_count": 2,
66
"array.multiline.leading_comma.padding": true,
77
"array.multiline.leading_comma": false,
88
"alignment.consecutive.assignments": true,
99
"alignment.consecutive.properties": true,
1010
"alignment.consecutive.params": true,
11+
"alignment.doc_comments" : true,
1112
"brackets.padding": true,
1213
"comment.asterisks": "align",
1314
"binary_operators.padding": true,
@@ -19,20 +20,20 @@
1920
"function_call.casing.userdefined": "camel",
2021
"function_call.multiline.element_count": 3,
2122
"function_call.multiline.leading_comma": false,
22-
"function_call.multiline.min_length": 40,
23+
"function_call.multiline.min_length": 50,
2324
"function_declaration.padding": true,
2425
"function_declaration.empty_padding": false,
2526
"function_declaration.multiline.leading_comma": false,
2627
"function_declaration.multiline.leading_comma.padding": true,
2728
"function_declaration.multiline.element_count": 3,
28-
"function_declaration.multiline.min_length": 40,
29-
"function_declaration.group_to_block_spacing": "spaced",
29+
"function_declaration.multiline.min_length": 50,
30+
"function_declaration.group_to_block_spacing": "compact",
3031
"function_anonymous.empty_padding": false,
31-
"function_anonymous.group_to_block_spacing": "spaced",
32+
"function_anonymous.group_to_block_spacing": "compact",
3233
"function_anonymous.multiline.element_count": 3,
3334
"function_anonymous.multiline.leading_comma": false,
3435
"function_anonymous.multiline.leading_comma.padding": true,
35-
"function_anonymous.multiline.min_length": 40,
36+
"function_anonymous.multiline.min_length": 50,
3637
"function_anonymous.padding": true,
3738
"indent_size": 4,
3839
"keywords.block_to_keyword_spacing": "spaced",
@@ -41,22 +42,22 @@
4142
"keywords.spacing_to_block": "spaced",
4243
"keywords.spacing_to_group": true,
4344
"keywords.empty_group_spacing": false,
44-
"max_columns": 120,
45+
"max_columns": 115,
4546
"metadata.multiline.element_count": 3,
46-
"metadata.multiline.min_length": 40,
47+
"metadata.multiline.min_length": 50,
48+
"method_call.chain.multiline" : 3,
4749
"newline":"\n",
4850
"property.multiline.element_count": 3,
49-
"property.multiline.min_length": 40,
51+
"property.multiline.min_length": 30,
5052
"parentheses.padding": true,
5153
"strings.quote": "double",
52-
"strings.convertNestedQuotes": false,
5354
"strings.attributes.quote": "double",
5455
"struct.separator": " : ",
5556
"struct.padding": true,
5657
"struct.empty_padding": false,
5758
"struct.multiline.leading_comma": false,
5859
"struct.multiline.leading_comma.padding": true,
5960
"struct.multiline.element_count": 2,
60-
"struct.multiline.min_length": 40,
61+
"struct.multiline.min_length": 60,
6162
"tab_indent": true
6263
}

.cflintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
{ "code": "AVOID_USING_CFINSERT_TAG" },
1212
{ "code": "AVOID_USING_CFUPDATE_TAG" },
1313
{ "code": "ARG_VAR_CONFLICT" },
14+
{ "code": "ARG_VAR_MIXED" },
1415
{ "code": "ARG_HINT_MISSING" },
1516
{ "code": "ARG_HINT_MISSING_SCRIPT" },
1617
{ "code" : "ARGUMENT_INVALID_NAME" },
@@ -58,4 +59,4 @@
5859
"parameters": {
5960
"TooManyFunctionsChecker.maximum" : 20
6061
}
61-
}
62+
}

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ indent_size = 2
1717

1818
[*.{md,markdown}]
1919
trim_trailing_whitespace = false
20-
insert_final_newline = false
20+
insert_final_newline = false

.github/FUNDING.YML

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
patreon: ortussolutions

.github/workflows/ci.yml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
name: Module CI
2+
3+
# Only on Development we build snapshots
4+
on:
5+
push:
6+
branches:
7+
- development
8+
- master
9+
10+
# UPDATE WITH THE RIGHT MODULE NAME
11+
env:
12+
MODULE_ID: cbjavaloader
13+
14+
jobs:
15+
#############################################
16+
# Tests First baby! We fail, no build :(
17+
#############################################
18+
tests:
19+
uses: ./.github/workflows/tests.yml
20+
secrets:
21+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
22+
23+
#############################################
24+
# Build Module
25+
#############################################
26+
build:
27+
name: Build & Publish
28+
needs: tests
29+
runs-on: ubuntu-20.04
30+
steps:
31+
- name: Checkout Repository
32+
uses: actions/checkout@v2
33+
with:
34+
fetch-depth: 0
35+
36+
- name: Setup Java
37+
uses: actions/setup-java@v2
38+
with:
39+
distribution: "adopt"
40+
java-version: "11"
41+
42+
#- name: Setup nodejs
43+
# uses: actions/setup-node@v2
44+
# with:
45+
# node-version: 12.x
46+
47+
- name: Cache CommandBox Dependencies
48+
uses: actions/cache@v1
49+
if: ${{ true }}
50+
with:
51+
path: ~/.CommandBox/artifacts
52+
key: ${{ runner.OS }}-commandbox-cache-${{ hashFiles( 'box.json' ) }}-${{ hashFiles( 'test-harness/box.json' ) }}
53+
restore-keys: |
54+
${{ runner.OS }}-commandbox-cache-${{ hashFiles( 'box.json' ) }}-${{ hashFiles( 'test-harness/box.json' ) }}
55+
56+
- name: Setup CommandBox
57+
uses: Ortus-Solutions/setup-commandbox@main
58+
with:
59+
forgeboxAPIKey: ${{ secrets.FORGEBOX_TOKEN }}
60+
61+
- name: Setup Environment Variables For Build Process
62+
id: current_version
63+
run: |
64+
echo "VERSION=`cat box.json | jq '.version' -r`" >> $GITHUB_ENV
65+
66+
# master or snapshot
67+
echo "Github Ref is $GITHUB_REF"
68+
echo "BRANCH=master" >> $GITHUB_ENV
69+
if [ $GITHUB_REF == 'refs/heads/development' ]
70+
then
71+
echo "BRANCH=development" >> $GITHUB_ENV
72+
fi
73+
74+
- name: Build ${{ env.MODULE_ID }}
75+
run: |
76+
#npm i npm@latest -g
77+
#npm install
78+
#npm run prod
79+
#rm -Rf node_modules
80+
box install commandbox-docbox
81+
box task run taskfile=build/Build target=run :version=${{ env.VERSION }} :projectName=${{ env.MODULE_ID }} :buildID=${{ github.run_number }} :branch=${{ env.BRANCH }}
82+
83+
- name: Upload Build Artifacts
84+
if: success()
85+
uses: actions/upload-artifact@v2
86+
with:
87+
name: ${{ env.MODULE_ID }}
88+
path: |
89+
.artifacts/**/*
90+
91+
- name: Upload Binaries to S3
92+
uses: jakejarvis/s3-sync-action@master
93+
with:
94+
args: --acl public-read
95+
env:
96+
AWS_S3_BUCKET: "downloads.ortussolutions.com"
97+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
98+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_SECRET }}
99+
SOURCE_DIR: ".artifacts/${{ env.MODULE_ID }}"
100+
DEST_DIR: "ortussolutions/coldbox-modules/${{ env.MODULE_ID }}"
101+
102+
- name: Upload API Docs to S3
103+
uses: jakejarvis/s3-sync-action@master
104+
with:
105+
args: --acl public-read
106+
env:
107+
AWS_S3_BUCKET: "apidocs.ortussolutions.com"
108+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
109+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_SECRET }}
110+
SOURCE_DIR: ".tmp/apidocs"
111+
DEST_DIR: "coldbox-modules/${{ env.MODULE_ID }}/${{ env.VERSION }}"
112+
113+
- name: Publish To ForgeBox
114+
run: |
115+
cd .tmp/${{ env.MODULE_ID }}
116+
cat box.json
117+
box forgebox publish
118+
119+
- name: Inform Slack
120+
if: ${{ always() }}
121+
uses: rtCamp/action-slack-notify@v2
122+
env:
123+
SLACK_CHANNEL: coding
124+
SLACK_COLOR: ${{ job.status }} # or a specific color like 'green' or '#ff00ff'
125+
SLACK_ICON_EMOJI: ":bell:"
126+
SLACK_MESSAGE: '${{ env.MODULE_ID }} Built with ${{ job.status }}!'
127+
SLACK_TITLE: "${{ env.MODULE_ID }} Build"
128+
SLACK_USERNAME: CI
129+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}

.github/workflows/pr.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Pull Requests
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- "main"
7+
- "master"
8+
- "development"
9+
pull_request:
10+
branches:
11+
- development
12+
13+
jobs:
14+
# UPDATE TO THE MODULE REPO SO PR'S CAN REUSE IT
15+
tests:
16+
uses: coldbox-modules/cbjavaloader/.github/workflows/tests.yml@development
17+
18+
# Format PR
19+
format:
20+
name: Format
21+
runs-on: ubuntu-20.04
22+
steps:
23+
- name: Checkout Repository
24+
uses: actions/checkout@v2
25+
26+
- uses: Ortus-Solutions/[email protected]
27+
with:
28+
cmd: run-script format
29+
30+
- name: Commit Format Changes
31+
uses: stefanzweifel/git-auto-commit-action@v4
32+
with:
33+
commit_message: Apply cfformat changes

.github/workflows/tests.yml

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
name: Test Suites
2+
3+
# We are a reusable Workflow only
4+
on:
5+
workflow_call:
6+
secrets:
7+
SLACK_WEBHOOK_URL:
8+
required: true
9+
10+
jobs:
11+
tests:
12+
name: Tests
13+
runs-on: ubuntu-20.04
14+
env:
15+
DB_USER: root
16+
DB_PASSWORD: root
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
cfengine: [ "lucee@5", "adobe@2016", "adobe@2018", "adobe@2021" ]
21+
steps:
22+
- name: Checkout Repository
23+
uses: actions/checkout@v2
24+
25+
# Not Needed in this module
26+
#- name: Setup Database and Fixtures
27+
# run: |
28+
# sudo /etc/init.d/mysql start
29+
# mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} -e 'CREATE DATABASE coolblog;'
30+
# mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} < test-harness/tests/resources/coolblog.sql
31+
32+
- name: Setup Java
33+
uses: actions/setup-java@v2
34+
with:
35+
distribution: "adopt"
36+
java-version: "11"
37+
38+
- name: Setup CommandBox CLI
39+
uses: Ortus-Solutions/setup-commandbox@main
40+
41+
# Not Needed in this module
42+
#- name: Setup Environment For Testing Process
43+
# working-directory: ./test-harness
44+
# run: |
45+
# # Setup .env
46+
# touch .env
47+
# # ENV
48+
# printf "DB_HOST=localhost\n" >> .env
49+
# printf "DB_USER=${{ env.DB_USER }}\n" >> .env
50+
# printf "DB_PASSWORD=${{ env.DB_PASSWORD }}\n" >> .env
51+
# printf "DB_CLASS=com.mysql.cj.jdbc.Driver\n" >> .env
52+
# printf "DB_BUNDLEVERSION=8.0.19\n" >> .env
53+
# printf "DB_BUNDLENAME=com.mysql.cj\n" >> .env
54+
55+
- name: Cache CommandBox Dependencies
56+
uses: actions/cache@v1
57+
if: ${{ true }}
58+
with:
59+
path: ~/.CommandBox/artifacts
60+
key: ${{ runner.OS }}-commandbox-cache-${{ hashFiles( 'box.json' ) }}-${{ hashFiles( 'test-harness/box.json' ) }}
61+
restore-keys: |
62+
${{ runner.OS }}-commandbox-cache-${{ hashFiles( 'box.json' ) }}-${{ hashFiles( 'test-harness/box.json' ) }}
63+
64+
- name: Install Test Harness Dependencies
65+
working-directory: ./test-harness
66+
run: |
67+
box install
68+
69+
- name: Start ${{ matrix.cfengine }} Server
70+
run: |
71+
box server start serverConfigFile="server-${{ matrix.cfengine }}.json" --noSaveSettings --debug
72+
# Install Adobe 2021 cfpm modules
73+
if [[ "${{ matrix.cfengine }}" == "adobe@2021" ]] ; then
74+
box run-script install:2021
75+
fi
76+
curl http://127.0.0.1:60299
77+
78+
- name: Run Tests
79+
run: |
80+
mkdir -p test-harness/tests/results
81+
box testbox run --verbose outputFile=test-harness/tests/results/test-results outputFormats=json,antjunit
82+
83+
- name: Publish Test Results
84+
uses: EnricoMi/publish-unit-test-result-action@v1
85+
if: always()
86+
with:
87+
files: test-harness/tests/results/**/*.xml
88+
check_name: "${{ matrix.cfengine }} Test Results"
89+
90+
- name: Upload Test Results to Artifacts
91+
if: always()
92+
uses: actions/upload-artifact@v2
93+
with:
94+
name: test-results-${{ matrix.cfengine }}
95+
path: |
96+
test-harness/tests/results/**/*
97+
98+
- name: Show Server Log On Failures
99+
if: ${{ failure() }}
100+
run: |
101+
box server log serverConfigFile="server-${{ matrix.cfengine }}.json"
102+
103+
- name: Upload Debug Logs To Artifacts
104+
if: ${{ failure() }}
105+
uses: actions/upload-artifact@v2
106+
with:
107+
name: Failure Debugging Info - ${{ matrix.cfengine }}
108+
path: |
109+
.engine/**/logs/*
110+
.engine/**/WEB-INF/cfusion/logs/*
111+
112+
- name: Slack Notifications
113+
# Only on failures and NOT in pull requests
114+
if: ${{ failure() && !startsWith( 'pull_request', github.event_name ) }}
115+
uses: rtCamp/action-slack-notify@v2
116+
env:
117+
SLACK_CHANNEL: coding
118+
SLACK_COLOR: ${{ job.status }} # or a specific color like 'green' or '#ff00ff'
119+
SLACK_ICON_EMOJI: ":bell:"
120+
SLACK_MESSAGE: '${{ env.MODULE_ID }} tests failed :cry:'
121+
SLACK_TITLE: ${{ env.MODULE_ID }} Tests For ${{ matrix.cfengine }} failed
122+
SLACK_USERNAME: CI
123+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
.artifacts/**
44
.tmp/**
55

6+
.engine/**
67
test-harness/.engine/**
78
test-harness/coldbox/**
89
test-harness/docbox/**
@@ -11,4 +12,4 @@ test-harness/logs/**
1112
test-harness/modules/**
1213

1314
# log files
14-
logs/**
15+
logs/**

0 commit comments

Comments
 (0)