mirror of
https://github.com/openfaas/faas.git
synced 2025-06-08 16:26:47 +00:00
FaaS does Cobol :-)
This commit is contained in:
parent
42ce8ed0b3
commit
c05aee101c
15
sample-functions/BaseFunctions/cobol/Dockerfile
Normal file
15
sample-functions/BaseFunctions/cobol/Dockerfile
Normal file
@ -0,0 +1,15 @@
|
||||
FROM toricls/gnucobol:latest
|
||||
|
||||
ADD https://github.com/alexellis/faas/releases/download/0.5.1-alpha/fwatchdog /usr/bin
|
||||
RUN chmod +x /usr/bin/fwatchdog
|
||||
|
||||
WORKDIR /root/
|
||||
|
||||
COPY handler.cob .
|
||||
RUN cobc -x handler.cob
|
||||
ENV fprocess="./handler"
|
||||
|
||||
HEALTHCHECK --interval=1s CMD [ -e /tmp/.lock ] || exit 1
|
||||
|
||||
CMD ["fwatchdog"]
|
||||
|
4
sample-functions/BaseFunctions/cobol/build.sh
Executable file
4
sample-functions/BaseFunctions/cobol/build.sh
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "Building functions/base:cobol"
|
||||
docker build -t functions/base:cobol .
|
38
sample-functions/BaseFunctions/cobol/handler.cob
Normal file
38
sample-functions/BaseFunctions/cobol/handler.cob
Normal file
@ -0,0 +1,38 @@
|
||||
IDENTIFICATION DIVISION.
|
||||
PROGRAM-ID. APP.
|
||||
*> Example based upon http://stackoverflow.com/q/938760/1420197
|
||||
*> More on COBOL @ https://www.ibm.com/support/knowledgecenter/en/SS6SG3_3.4.0/com.ibm.entcobol.doc_3.4/tpbeg15.htm
|
||||
ENVIRONMENT DIVISION.
|
||||
INPUT-OUTPUT SECTION.
|
||||
FILE-CONTROL.
|
||||
SELECT SYSIN ASSIGN TO KEYBOARD ORGANIZATION LINE SEQUENTIAL.
|
||||
|
||||
DATA DIVISION.
|
||||
FILE SECTION.
|
||||
FD SYSIN.
|
||||
01 ln PIC X(64).
|
||||
88 EOF VALUE HIGH-VALUES.
|
||||
|
||||
WORKING-STORAGE SECTION.
|
||||
PROCEDURE DIVISION.
|
||||
|
||||
DISPLAY "Request data: "
|
||||
DISPLAY "------------"
|
||||
|
||||
OPEN INPUT SYSIN
|
||||
READ SYSIN
|
||||
AT END SET EOF TO TRUE
|
||||
END-READ
|
||||
PERFORM UNTIL EOF
|
||||
|
||||
|
||||
DISPLAY ln
|
||||
|
||||
READ SYSIN
|
||||
AT END SET EOF TO TRUE
|
||||
END-READ
|
||||
END-PERFORM
|
||||
CLOSE SYSIN
|
||||
|
||||
DISPLAY "------------"
|
||||
STOP RUN.
|
6
sample-functions/BaseFunctions/cobol/hello.cob
Normal file
6
sample-functions/BaseFunctions/cobol/hello.cob
Normal file
@ -0,0 +1,6 @@
|
||||
IDENTIFICATION DIVISION.
|
||||
PROGRAM-ID. HELLO-WORLD.
|
||||
PROCEDURE DIVISION.
|
||||
DISPLAY 'FaaS running COBOL in a container!'.
|
||||
STOP RUN.
|
||||
|
Loading…
x
Reference in New Issue
Block a user