Skip to content

Instantly share code, notes, and snippets.

View recursivecodes's full-sized avatar
💯
Living the dream

Todd Sharp recursivecodes

💯
Living the dream
View GitHub Profile
@recursivecodes
recursivecodes / create-fn-response.json
Last active April 1, 2022 17:10
create-fn-response.json
{
"data": {
"application-id": "ocid1.fnapp.oc1.phx...",
"compartment-id": "ocid1.compartment.oc1...",
"config": {},
"defined-tags": {
"Oracle-Tags": {
"CreatedBy": "[redacted]",
"CreatedOn": "2022-03-29T17:10:35.939Z"
}
@recursivecodes
recursivecodes / build.gradle
Created March 30, 2022 19:13
build.gradle
graalvmNative {
binaries.configureEach {
buildArgs.addAll(
"-H:+StaticExecutableWithDynamicLibC",
"-Dfn.handler=atp.auto.wallet.fn.Function::handleRequest",
"--initialize-at-build-time=atp.auto.wallet.fn"
)
}
}
@recursivecodes
recursivecodes / build.gradle
Created March 30, 2022 19:13
build.gradle
version = "0.2"
@recursivecodes
recursivecodes / create-fn.sh
Created March 30, 2022 19:13
create-fn.sh
$ oci fn function create \
--application-id=ocid1.fnapp.oc1.phx... \
--display-name=atp-auto-wallet-fn \
--memory-in-mbs=2048 \
--image=phx.ocir.io/toddrsharp/atp-auto-wallet/atp-auto-wallet-fn:0.1
@recursivecodes
recursivecodes / FunctionTest.java
Created March 30, 2022 19:13
FunctionTest.java
public class FunctionTest {
@Test
public void testFunction() {
FnTestingRule rule = FnTestingRule.createDefault();
rule.givenEvent().enqueue();
rule.thenRun(Function.class, "handleRequest");
String result = rule.getOnlyResult().getBodyAsString();
assertNotNull(result);
}
}
@recursivecodes
recursivecodes / build-push.sh
Created March 30, 2022 19:13
build-push.sh
$ ./gradlew dockerBuild
$ ./gradlew dockerPush
$ oci fn function invoke \
--function-id=ocid1.fnfunc.oc1.phx... \
--body="" \
--file -
@recursivecodes
recursivecodes / run-test.sh
Created March 30, 2022 19:13
run-test.sh
$ ./gradlew test
@recursivecodes
recursivecodes / build.gradle
Created March 30, 2022 19:13
build.gradle
graalvmNative {
binaries.configureEach {
buildArgs.addAll(
"-H:+StaticExecutableWithDynamicLibC",
"-Dfn.handler=atp.auto.wallet.fn.Function::handleRequest",
"--initialize-at-build-time=atp.auto.wallet.fn",
"-H:ReflectionConfigurationFiles=/home/app/resources/reflectionconfig.json"
)
}
}
@recursivecodes
recursivecodes / application.yml
Created March 30, 2022 19:13
application.yml
micronaut:
application:
name: atpAutoWalletFn
datasources:
default:
dialect: ORACLE
username: ${ATP_USER}
password: ${ATP_PASSWORD}
ocid: ${ATP_OCID}
walletPassword: ${ATP_WALLET_PASSWORD}