File tree Expand file tree Collapse file tree 4 files changed +43
-1
lines changed Expand file tree Collapse file tree 4 files changed +43
-1
lines changed Original file line number Diff line number Diff line change 73
73
push : true
74
74
tags : ${{ steps.meta.outputs.tags }}
75
75
labels : ${{ steps.meta.outputs.labels }}
76
+ target : main
76
77
deploy :
77
78
runs-on : ubuntu-latest
78
79
if : |
Original file line number Diff line number Diff line change 1
- FROM caddy
1
+ FROM caddy as web
2
2
COPY . .
3
3
RUN echo ":8000" > /etc/caddy/Caddyfile
4
4
RUN echo "rewrite /repl /repl.html" >> /etc/caddy/Caddyfile
5
5
RUN echo "rewrite /compilerepl /compilerepl.html" >> /etc/caddy/Caddyfile
6
6
RUN echo "log" >> /etc/caddy/Caddyfile
7
7
RUN echo "file_server" >> /etc/caddy/Caddyfile
8
+
9
+ FROM alpine:latest as build
10
+ RUN printf -- '-m\n scrapscript\n ...' > .args
11
+ RUN wget https://cosmo.zip/pub/cosmos/bin/assimilate
12
+ RUN wget https://cosmo.zip/pub/cosmos/bin/ape-x86_64.elf
13
+ RUN wget https://cosmo.zip/pub/cosmos/bin/python
14
+ RUN wget https://cosmo.zip/pub/cosmos/bin/zip
15
+ RUN chmod +x assimilate
16
+ RUN chmod +x ape-x86_64.elf
17
+ RUN chmod +x python
18
+ RUN chmod +x zip
19
+ RUN mkdir Lib
20
+ COPY scrapscript.py Lib/
21
+ COPY compiler.py Lib/
22
+ COPY runtime.c Lib/
23
+ COPY cli.c Lib/
24
+ RUN ./ape-x86_64.elf ./python -m compileall -b Lib/scrapscript.py Lib/compiler.py
25
+ RUN mv python scrapscript.com
26
+ RUN ./ape-x86_64.elf ./zip -r scrapscript.com Lib .args
27
+ RUN ./ape-x86_64.elf ./assimilate ./scrapscript.com
28
+ RUN echo "Testing..."
29
+ RUN ./scrapscript.com apply "1+2"
30
+
31
+ # Set up the container
32
+ FROM scratch as main
33
+ COPY --from=build scrapscript.com .
34
+ ENTRYPOINT ["./scrapscript.com" ]
Original file line number Diff line number Diff line change @@ -40,6 +40,19 @@ or with [Cosmopolitan](https://justine.lol/cosmopolitan/index.html):
40
40
(if you have an exec format error and use Zsh, either upgrade Zsh or prefix
41
41
with ` sh ` )
42
42
43
+ or with Docker:
44
+
45
+ ``` bash
46
+ # With a file (mount your local directory)
47
+ docker run --mount type=bind,source=" $( pwd) " ,target=/mnt -i -t ghcr.io/tekknolagi/scrapscript:trunk eval /mnt/examples/0_home/factorial.scrap
48
+
49
+ # With a string literal
50
+ docker run -i -t ghcr.io/tekknolagi/scrapscript:trunk apply " 1 + 2"
51
+
52
+ # With a REPL
53
+ docker run -i -t ghcr.io/tekknolagi/scrapscript:trunk repl
54
+ ```
55
+
43
56
### The experimental compiler:
44
57
45
58
#### Normal ELF
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ app = "scrapscript"
7
7
primary_region = " ewr"
8
8
9
9
[build ]
10
+ build-target = " web"
10
11
11
12
[http_service ]
12
13
internal_port = 8000
You can’t perform that action at this time.
0 commit comments