-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
126 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
build/ | ||
jars/*.jar | ||
.gradle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
apply plugin: 'java' | ||
|
||
archivesBaseName = 'fuseless-template' | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
compile ( | ||
'com.amazonaws.serverless:aws-serverless-java-container-core:1.2', | ||
'javax.servlet.jsp:javax.servlet.jsp-api:2.3.1', | ||
'javax.el:javax.el-api:3.0.0', | ||
'com.amazonaws:aws-lambda-java-core:1.2.0', | ||
'com.amazonaws:aws-lambda-java-log4j:1.0.0', | ||
'org.slf4j:slf4j-log4j12:1.7.25' | ||
) | ||
compile fileTree(dir: 'jars', include: '*.jar') | ||
} | ||
|
||
task buildZip(type: Zip) { | ||
from compileJava | ||
from processResources | ||
from 'cfml/' | ||
into('lib') { | ||
from configurations.runtime | ||
} | ||
|
||
} | ||
|
||
build.dependsOn buildZip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
component { | ||
|
||
this.name="cfmlServerless"; | ||
this.sessionManagement=false; | ||
this.clientManagement=false; | ||
this.setClientCookies=false; | ||
|
||
public function onRequest(string path) { | ||
include arguments.path; | ||
} | ||
|
||
public function getLambdaContext() { | ||
//see https://docs.aws.amazon.com/lambda/latest/dg/java-context-object.html | ||
return getPageContext().getRequest().getAttribute("lambdaContext"); | ||
} | ||
|
||
public void function logger(string msg) { | ||
getLambdaContext().getLogger().log(arguments.msg); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<cfdump var="#server.lucee#" label="server.lucee Dump"> | ||
<cfdump var="#getLambdaContext()#" label="getLambdaContext()"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
if [[ !$LUCEE_VERSION ]]; then | ||
LUCEE_VERSION=5.3.1.87-RC | ||
fi | ||
|
||
if [[ !$FUSELESS_VERSION ]]; then | ||
FUSELESS_VERSION="0.0.6" | ||
fi | ||
|
||
if [ -f "jars/lucee-light-$LUCEE_VERSION.jar" ]; then | ||
echo "lucee-light-$LUCEE_VERSION.jar already in jars folder, skipping download" | ||
else | ||
#download lucee jar | ||
echo "Downloading lucee-light-$LUCEE_VERSION.jar" | ||
curl --location -o jars/lucee-light-$LUCEE_VERSION.jar https://cdn.lucee.org/lucee-light-$LUCEE_VERSION.jar | ||
fi | ||
|
||
|
||
if [ -f "jars/foundeo-fuseless-$FUSELESS_VERSION.jar" ]; then | ||
echo "foundeo-fuseless-$FUSELESS_VERSION.jar already in jars folder, skipping download" | ||
else | ||
#download lucee jar | ||
echo "Downloading foundeo-fuseless-$FUSELESS_VERSION.jar" | ||
curl --location -o jars/foundeo-fuseless-$FUSELESS_VERSION.jar https://github.com/foundeo/fuseless/releases/download/v$FUSELESS_VERSION/foundeo-fuseless-$FUSELESS_VERSION.jar | ||
fi | ||
|
||
echo "" | ||
echo "Jars are in place, next make sure you have gradle installed: https://gradle.org/install/" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
In this folder there should be at least two jar files: | ||
|
||
- lucee-version.jar [download](https://download.lucee.org/) | ||
|
||
- foundeo-fuseless-version.jar [download](https://github.com/foundeo/fuseless/releases/latest) | ||
|
||
You can run the `init.sh` script if you are on mac or linux and it will download the jars for you. | ||
|
||
You can add additional jars and they will be automatically added to the distribution. Or better yet modify the `../build.gradle` file to add your dependencies. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# FuseLess Template | ||
|
||
A Template for building CFML powered AWS Lambda Functions. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
AWSTemplateFormatVersion: 2010-09-09 | ||
Transform: AWS::Serverless-2016-10-31 | ||
|
||
Resources: | ||
FuselessTemplate: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
Handler: com.foundeo.fuseless.StreamLambdaHandler | ||
CodeUri: ./build/distributions/fuseless-template.zip | ||
Runtime: java8 | ||
Timeout: 10 | ||
MemorySize: 256 | ||
Events: | ||
GetResource: | ||
Type: Api | ||
Properties: | ||
Path: /{proxy+} | ||
Method: any | ||
Environment: | ||
Variables: | ||
FELIX_CACHE_BUFSIZE: 16384 | ||
|
||
|
||
|