Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
argotest
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Reis
argotest
Commits
f7988505
Commit
f7988505
authored
Dec 14, 2018
by
Valentin Reis
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'pwd-oblivious' into 'master'
Make argotk $PWD-oblivious Closes
#3
See merge request argo/argotest!9
parents
839af082
01da3151
Pipeline
#4663
passed with stage
in 6 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
12 deletions
+20
-12
argotest/src/Argotest.hs
argotest/src/Argotest.hs
+2
-2
argotk.hs
argotk.hs
+14
-9
default.nix
default.nix
+4
-1
No files found.
argotest/src/Argotest.hs
View file @
f7988505
...
...
@@ -23,7 +23,7 @@ import Data.Text as Text hiding (empty)
import
Data.Text.IO
as
Text
data
StackArgs
=
StackArgs
{
dargs
::
[
Text
]
--"Daemon arguments. Properly quote this."
{
dargs
::
[
Text
]
--"Daemon arguments. Properly quote this."
,
app
::
Text
--"Target application call, sh+path valid"
,
manifest
::
FilePath
--"Input file, manifest."
,
cmd_out
::
FilePath
--"Output file, application stdout"
...
...
@@ -37,7 +37,7 @@ instance Default StackArgs where
def
=
StackArgs
{
dargs
=
[]
,
app
=
"echo
\"
HelloWorld
\"
"
,
manifest
=
"
manifests/
basic.json"
,
manifest
=
"basic.json"
,
cmd_out
=
"cmd_out.log"
,
cmd_err
=
"cmd_err.log"
,
daemon_out
=
"daemon_out.log"
...
...
argotk.hs
View file @
f7988505
...
...
@@ -9,32 +9,37 @@ import Argotest
import
Turtle
import
Data.Default
import
Control.Concurrent.Async
import
System.Environment
import
System.Console.ANSI
import
System.Console.ANSI.Types
(
Color
)
import
Options.Applicative
import
System.Posix.Signals
import
Control.Monad
import
System.Environment.FindBin
opts
::
Parser
(
IO
()
)
opts
=
subparser
(
command
"clean"
(
info
(
pure
$
runClean
def
)
opts
::
StackArgs
->
Parser
(
IO
()
)
opts
sa
=
subparser
(
command
"clean"
(
info
(
pure
$
runClean
sa
)
(
progDesc
"Clean sockets, logfiles."
))
<>
command
"daemon"
(
info
(
pure
$
runDaemon
def
)
<>
command
"daemon"
(
info
(
pure
$
runDaemon
sa
)
(
progDesc
"Set up and launch the daemon in synchronous mode,
\
\
with properly cleaned sockets, logfiles."
))
<>
command
"application"
(
info
(
runApp
<$>
argument
str
idm
)
<>
command
"application"
(
info
(
runApp
sa
<$>
argument
str
idm
)
(
progDesc
"Setup stack and run an arbitrary command in a container."
))
<>
command
"helloworld"
(
info
(
pure
$
runHelloWorld
def
)
<>
command
"helloworld"
(
info
(
pure
$
runHelloWorld
sa
)
(
progDesc
"Setup stack and check that hello world app sends
\
\
message back to cmd."
))
<>
help
"Type of action to run"
)
main
::
IO
()
main
=
join
$
execParser
(
info
(
opts
<**>
helper
)
idm
)
main
=
do
manifests
<-
getEnv
"MANIFESTS"
let
sa
=
def
{
manifest
=
decodeString
manifests
</>
manifest
def
}
join
$
execParser
(
info
(
opts
sa
<**>
helper
)
idm
)
runApp
::
Text
->
IO
()
runApp
app
=
runSimpleStack
$
def
{
app
=
app
}
runApp
::
StackArgs
->
Text
->
IO
()
runApp
sa
app
=
runSimpleStack
$
sa
{
app
=
app
}
runHelloWorld
::
StackArgs
->
IO
()
runHelloWorld
a
@
StackArgs
{
..
}
=
do
...
...
default.nix
View file @
f7988505
...
...
@@ -43,6 +43,7 @@ in rec
p
.
unix
p
.
system-filepath
p
.
async
p
.
FindBin
(
pkgs
.
haskell
.
lib
.
doJailbreak
p
.
panpipe
)
]))
containers
...
...
@@ -52,6 +53,7 @@ in rec
amg
nrm
];
MANIFESTS
=
./manifests
;
};
test
=
pkgs
.
stdenv
.
mkDerivation
rec
{
...
...
@@ -62,11 +64,12 @@ in rec
name
=
"env"
;
env
=
pkgs
.
buildEnv
{
name
=
name
;
paths
=
buildInputs
;
};
buildInputs
=
[
(
hpkgs
.
ghcWithPackages
(
p
:
[
p
.
argotest
]))
(
hpkgs
.
ghcWithPackages
(
p
:
[
p
.
argotest
p
.
FindBin
]))
containers
amg
nrm
];
MANIFESTS
=
./manifests
;
};
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment