-
Notifications
You must be signed in to change notification settings - Fork 1
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
12 changed files
with
163 additions
and
115 deletions.
There are no files selected for viewing
Empty file.
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,15 +1,8 @@ | ||
FROM alpine/git as Build | ||
|
||
RUN mkdir -p /app/leonardo | ||
RUN git clone --depth=1 https://github.com/jolie/leonardo.git /app/leonardo | ||
RUN rm -rf /app/leonardo/docker | ||
RUN rm -rf /app/leonardo/.git | ||
|
||
# Start from scratch, copy leonardo | ||
FROM jolielang/jolie | ||
WORKDIR / | ||
COPY --from=Build /app /app | ||
|
||
WORKDIR /app/leonardo/cmd/leonardo | ||
COPY . /leonardo | ||
RUN rm -rf /leonardo/docker | ||
RUN rm -rf /leonardo/.git | ||
|
||
WORKDIR /leonardo | ||
CMD ["jolie","main.ol"] |
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 |
---|---|---|
@@ -1,15 +1,8 @@ | ||
FROM alpine/git as Build | ||
|
||
RUN mkdir -p /app/leonardo | ||
RUN git clone --depth=1 https://github.com/jolie/leonardo.git /app/leonardo | ||
RUN rm -rf /app/leonardo/docker | ||
RUN rm -rf /app/leonardo/.git | ||
|
||
# Start from scratch, copy leonardo | ||
FROM jolielang/jolie:jre | ||
WORKDIR / | ||
COPY --from=Build /app /app | ||
|
||
WORKDIR /app/leonardo/cmd/leonardo | ||
COPY . /leonardo | ||
RUN rm -rf /leonardo/docker | ||
RUN rm -rf /leonardo/.git | ||
|
||
WORKDIR /leonardo | ||
CMD ["jolie","main.ol"] |
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
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 |
---|---|---|
@@ -1,12 +1,30 @@ | ||
include "../../types/PostResponseHookIface.iol" | ||
/* | ||
Copyright 2018-2020 Fabrizio Montesi <famontesi@gmail.com> | ||
execution { concurrent } | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
inputPort Input { | ||
Location: "local" | ||
Interfaces: PostResponseHookIface | ||
} | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
from ...hooks import PostResponseHookIface | ||
|
||
service DefaultPostResponseHook { | ||
execution: concurrent | ||
|
||
inputPort Input { | ||
location: "local" | ||
interfaces: PostResponseHookIface | ||
} | ||
|
||
main { | ||
run(mesg)() | ||
main { | ||
run( mesg )() | ||
} | ||
} |
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 |
---|---|---|
@@ -1,13 +1,30 @@ | ||
include "../../types/PreResponseHookIface.iol" | ||
/* | ||
Copyright 2018-2020 Fabrizio Montesi <famontesi@gmail.com> | ||
execution { concurrent } | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
inputPort Input { | ||
Location: "local" | ||
Interfaces: PreResponseHookIface | ||
} | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
from ...hooks import PreResponseHookIface | ||
|
||
service DefaultPreResponseHook { | ||
execution: concurrent | ||
|
||
inputPort Input { | ||
location: "local" | ||
interfaces: PreResponseHookIface | ||
} | ||
|
||
main | ||
{ | ||
run(mesg)(mesg.content) | ||
main { | ||
run( mesg )( mesg.content ) | ||
} | ||
} |
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,43 @@ | ||
/* | ||
Copyright 2020 Fabrizio Montesi <famontesi@gmail.com> | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
from runtime import Runtime | ||
|
||
service Launcher { | ||
embed Runtime as Runtime | ||
main { | ||
if ( is_defined( args[0] ) ) { | ||
dir = args[0] | ||
} else { | ||
getenv@Runtime( "LEONARDO_WWW" )( dir ) | ||
} | ||
|
||
if( !(dir instanceof void) ) { | ||
config.wwwDir = dir | ||
} | ||
|
||
config.location = "socket://localhost:8080" | ||
config.defaultPage = "index.html" | ||
|
||
loadEmbeddedService@Runtime( { | ||
filepath = "main.ol" | ||
service = "Leonardo" | ||
params -> config | ||
} )() | ||
|
||
linkIn( Shutdown ) | ||
} | ||
} |
Oops, something went wrong.