Skip to content

Commit

Permalink
Merge pull request #16 from Avinya-Foundation/choreo-90ee30d0-a47e-46…
Browse files Browse the repository at this point in the history
…43-b2e2-f2a85ce85e4d

Add Choreo related template and config files
  • Loading branch information
rukmal authored Sep 15, 2022
2 parents f0c2bed + 6909058 commit ec9e3c1
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 0 deletions.
46 changes: 46 additions & 0 deletions api/.choreo/config-schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"avinyafoundation": {
"type": "object",
"properties": {
"global_data_api": {
"type": "object",
"properties": {
"USER": {
"type": "string",
"description": ""
},
"PASSWORD": {
"type": "string",
"description": ""
},
"HOST": {
"type": "string",
"description": ""
},
"PORT": {
"type": "integer",
"description": ""
},
"DATABASE": {
"type": "string",
"description": ""
}
},
"additionalProperties": false,
"required": [
"USER",
"PASSWORD",
"HOST",
"PORT",
"DATABASE"
]
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
2 changes: 2 additions & 0 deletions api/.choreo/log
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Thu Sep 15 03:46:05 UTC 2022
Git PR Commit: f0c2bed3c94bfebabcac5c869dbe116f52dafe85
1 change: 1 addition & 0 deletions api/.choreo/syntax-tree.json

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions api/.githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

#!/bin/bash

cd api
BASE_FOLDER_NAME="api"

APP_NAME=$(cat Ballerina.toml | grep -e "name =" -e "name=" | cut -d"=" -f2- | sed 's/"//g; s/ //g')
if [ -z "$APP_NAME" ]
then
APP_NAME=$BASE_FOLDER_NAME
fi
rm -rf .choreo/build
mkdir -p .choreo/build
bal build --sticky --export-openapi --generate-config-schema --observability-included --target-dir .choreo/build || { echo 'Ballerina Build Failed' ; exit 1; }
mv .choreo/build/bin/config-schema.json .choreo/
unzip -p .choreo/build/bin/$(echo $APP_NAME).jar syntax-tree/syntax-tree.json > .choreo/syntax-tree.json
rm -rf .choreo/build
git add .choreo

0 comments on commit ec9e3c1

Please sign in to comment.