bootstrap: library
from: alpine:3.11.5

%help
This is a e2e test container used for testing the 'inspect'
command. This container "inspector_container.sif" should be placed
in the "e2e/testdata" directory of Singularity.

%labels
MAINTAINER "WestleyK <westley@sylabs.io>"
e2e awesome
E2E AWESOME
hi "hello world"
HI "HELLO WORLD"

%post
echo "export hello=\"world\"" >> $SINGULARITY_ENVIRONMENT
# add labels from post section
k=first; echo "$k.build.labels  $k" >> $SINGULARITY_LABELS
k=second; echo "$k.build.labels $k" >> $SINGULARITY_LABELS

%test
ls /
test -d /
test -d /etc

%environment
export test="testing"
export e2e="e2e testing"

%runscript
cat /.singularity.d/runscript.help

%startscript
exec "$@"

%apprun hello
echo "hello"

%appstart hello
exec "$@"

%apphelp hello
This is the help for hello!

%applabels hello
HELLOTHISIS hello

%appenv hello
HELLOTHISIS=hello
export HELLOTHISIS

%apptest hello
echo "THIS IS A HELLO TEST"

%apprun world
echo "world"
