forked from aaubry/YamlDotNet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docker wrappers of a few YAML parsers for easy testing
- Loading branch information
Showing
6 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
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,8 @@ | ||
|
||
dir -Attributes Directory | % { | ||
docker build $_.Name -t "aaubry/yaml-$($_.Name)" | ||
} | ||
|
||
dir -Attributes Directory | % { | ||
Write-Host "echo a:b | docker run --rm -i aaubry/yaml-$($_.Name)" | ||
} |
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,7 @@ | ||
FROM ubuntu:20.04 | ||
|
||
RUN apt-get update && apt-get install -y libyaml-pp-perl | ||
COPY parse.pl /app/ | ||
WORKDIR /app | ||
|
||
ENTRYPOINT [ "/usr/bin/perl", "-w", "/app/parse.pl" ] |
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,9 @@ | ||
use YAML::PP qw/ Load Dump /; | ||
|
||
my $input; | ||
while(<>) { | ||
$input .= $_; | ||
} | ||
|
||
my $doc = Load($input); | ||
print(Dump($doc)); |
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,6 @@ | ||
FROM ubuntu:20.04 | ||
|
||
RUN apt-get update && apt-get install -y python3 python3-yaml | ||
WORKDIR /app | ||
|
||
ENTRYPOINT [ "/usr/bin/python3", "-c", "import sys, yaml, json; print(json.dumps(yaml.load(sys.stdin.read(), Loader=yaml.SafeLoader)))" ] |
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,13 @@ | ||
FROM ubuntu:20.04 | ||
|
||
WORKDIR /app | ||
|
||
RUN apt-get update && apt-get install -y cabal-install git | ||
RUN cabal update | ||
RUN git clone https://github.com/orenbenkiki/yamlreference.git . | ||
RUN cabal install --only-dependencies | ||
RUN cabal configure | ||
RUN cabal build | ||
COPY run.sh /app/ | ||
|
||
ENTRYPOINT [ "/usr/bin/bash", "/app/run.sh" ] |
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,7 @@ | ||
|
||
if [ "$1" == "--html" ]; then | ||
/app/dist/build/yaml2yeast/yaml2yeast <&0 | /app/yeast2html | ||
else | ||
echo "Use --html for HTML output" | ||
/app/dist/build/yaml2yeast/yaml2yeast <&0 | grep --color -E '^!.*|$' | ||
fi |