Skip to content

Commit b33c45b

Browse files
committed
Initial commit of SDK
1 parent 81ab9f7 commit b33c45b

32 files changed

+2343
-1
lines changed

.editorconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = false
9+
indent_style = tab
10+
indent_size = 4
11+
tab_width = 4
12+
13+
[*.yml]
14+
indent_style = space
15+
indent_size = 2
16+
17+
[*.{md,markdown}]
18+
trim_trailing_whitespace = false
19+
insert_final_newline = false

.env.example

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CONNECTION_STRING=
2+
endpoint=
3+
AZURE_CLIENT_ID=
4+
AZURE_CLIENT_SECRET=
5+
AZURE_TENANT_ID=

.gitattributes

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,22 @@
11
# Auto detect text files and perform LF normalization
22
* text=auto
3+
4+
# Custom for Visual Studio
5+
*.cs diff=csharp
6+
*.sln merge=union
7+
*.csproj merge=union
8+
*.vbproj merge=union
9+
*.fsproj merge=union
10+
*.dbproj merge=union
11+
12+
# Standard to msysgit
13+
*.doc diff=astextplain
14+
*.DOC diff=astextplain
15+
*.docx diff=astextplain
16+
*.DOCX diff=astextplain
17+
*.dot diff=astextplain
18+
*.DOT diff=astextplain
19+
*.pdf diff=astextplain
20+
*.PDF diff=astextplain
21+
*.rtf diff=astextplain
22+
*.RTF diff=astextplain

.github/workflows/build.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: CI
4+
5+
# Controls when the action will run. Triggers the workflow on push or pull request
6+
# events but only for the master branch
7+
on:
8+
push:
9+
branches:
10+
- master
11+
- development
12+
pull_request:
13+
branches:
14+
- development
15+
16+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
17+
jobs:
18+
build:
19+
# The type of runner that the job will run on
20+
runs-on: ubuntu-latest
21+
env:
22+
MODULE_ID: blobstoragesdk
23+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
24+
25+
26+
steps:
27+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
28+
- uses: actions/checkout@v2
29+
30+
- name: Setup Java JDK
31+
uses: actions/[email protected]
32+
with:
33+
# The Java version to make available on the path. Takes a whole or semver Java version, or 1.x syntax (e.g. 1.8 => Java 8.x). Early access versions can be specified in the form of e.g. 14-ea, 14.0.0-ea, or 14.0.0-ea.28
34+
java-version: 11
35+
36+
- name: Install CommandBox
37+
run: |
38+
curl -fsSl https://downloads.ortussolutions.com/debs/gpg | sudo apt-key add -
39+
sudo echo "deb http://downloads.ortussolutions.com/debs/noarch /" | sudo tee -a /etc/apt/sources.list.d/commandbox.list
40+
sudo apt-get update && sudo apt-get --assume-yes install rsync jq commandbox
41+
box install commandbox-cfconfig,commandbox-dotenv,commandbox-docbox
42+
box config set endpoints.forgebox.APIToken=${{ secrets.FORGEBOX_API_KEY }} > /dev/null
43+
44+
45+
- name: Do Build
46+
run: |
47+
# Set Current Version
48+
TARGET_VERSION=`cat ${{github.workspace}}/box.json | jq '.version' -r`
49+
echo "::set-env name=TARGET_VERSION::$TARGET_VERSION"
50+
echo "Starting build for $MODULE_ID v$TARGET_VERSION"
51+
# Replace version so builder can issue it
52+
53+
box install
54+
55+
# move back to build dir to build it
56+
cd ${{github.workspace}}
57+
# Build Project
58+
box task run taskfile=build/Build target=run :version=$TARGET_VERSION :projectName=$MODULE_ID :buildID=${{github.run_number}} :branch=${{github.ref}}
59+
60+
- name: Upload Package to S3
61+
uses: jakejarvis/[email protected]
62+
if:
63+
contains('
64+
refs/heads/master
65+
refs/heads/development
66+
', github.ref)
67+
with:
68+
args: --acl public-read
69+
env:
70+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
71+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_SECRET }}
72+
AWS_S3_BUCKET: downloads.ortussolutions.com
73+
SOURCE_DIR: ${{github.workspace}}/.artifacts/$MODULE_ID
74+
DEST_DIR: ortussolutions/$MODULE_ID
75+
76+
- name: Upload API Docs to S3
77+
uses: jakejarvis/[email protected]
78+
if:
79+
contains('
80+
refs/heads/master
81+
refs/heads/development
82+
', github.ref)
83+
with:
84+
args: --acl public-read
85+
env:
86+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
87+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_SECRET }}
88+
AWS_S3_BUCKET: apidocs.ortussolutions.com
89+
SOURCE_DIR: ${{github.workspace}}/.tmp/apidocs
90+
DEST_DIR: $MODULE_ID/$TARGET_VERSION
91+
92+
- name: Publish to ForgeBox
93+
if:
94+
contains('
95+
refs/heads/master
96+
refs/heads/development
97+
', github.ref)
98+
run: |
99+
cd ${{github.workspace}}/.tmp/${MODULE_ID}
100+
cat box.json
101+
box config set ENDPOINTS.FORGEBOX.APITOKEN=${{ secrets.BOX_CONFIG_ENDPOINTS_FORGEBOX_APITOKEN }}
102+
box forgebox publish

.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.vscode
2+
3+
.artifacts/**
4+
.tmp/**
5+
6+
/test-harness/coldbox/**
7+
/test-harness/docbox/**
8+
/test-harness/testbox/**
9+
/test-harness/logs/**
10+
/test-harness/modules/**
11+
12+
# log files
13+
logs/**
14+
15+
16+
test-harness/.env
17+
/modules/
18+
/.project
19+
/lib/
20+
settings.xml
21+
/.env
22+
/test-harness/tests/results/coverageReport
23+
/.settings/

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Apache License
1+
Apache License
22
Version 2.0, January 2004
33
http://www.apache.org/licenses/
44

ModuleConfig.cfc

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
/**
2+
*********************************************************************************
3+
* Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp
4+
* www.ortussolutions.com
5+
* ---
6+
* Module Config.
7+
*/
8+
component {
9+
10+
// Module Properties
11+
this.title = 'BlobStorageSDK';
12+
this.author = 'Brad Wood';
13+
this.version = '@build.version@[email protected]@';
14+
this.cfmapping = 'blobstoragesdk';
15+
16+
function configure(){
17+
settings = {
18+
endpoint : '',
19+
containerName : '',
20+
overwrite : false,
21+
maxDownloadRetries : 0,
22+
/*
23+
Credential Types and value option used for each:
24+
25+
- type : "connectionString"
26+
- connectionString
27+
- type : "default"
28+
- authorityHost
29+
- tenantId
30+
- maxRetry
31+
- tokenRefreshOffsetSeconds
32+
- type : "ClientSecret"
33+
- authorityHost
34+
- tenantId
35+
- clientId
36+
- clientSecret
37+
- maxRetry
38+
- tokenRefreshOffsetSeconds
39+
- enablePersistentCache
40+
- type : "ClientCertificate"
41+
- authorityHost
42+
- tenantId
43+
- clientId
44+
- pemCertificatePath (mutex with pfxCertificatePath)
45+
- pfxCertificatePath (mutex with pemCertificatePath)
46+
- certificatePassword (only used for pfx)
47+
- maxRetry
48+
- tokenRefreshOffsetSeconds
49+
- enablePersistentCache
50+
*/
51+
credentials : {
52+
type : 'connectionString', // connectionString, default, ClientSecret, ClientCertificate
53+
connectionString : '',
54+
authorityHost : '',
55+
tenantId : '',
56+
clientId : '',
57+
clientSecret : '',
58+
pemCertificatePath : '',
59+
pfxCertificatePath : '',
60+
certificatePassword : '',
61+
maxRetry : 3,
62+
tokenRefreshOffsetSeconds : 0,
63+
enablePersistentCache : false
64+
}
65+
};
66+
67+
}
68+
69+
function onLoad(){
70+
}
71+
72+
function onUnload(){
73+
}
74+
75+
}

0 commit comments

Comments
 (0)