Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* adding start to testing, needs a lot more work, just saving in case my computer explodes Signed-off-by: Vanessa Sochat <vsochat@stanford.edu> * adding tests for collection (still more to go!) Signed-off-by: Vanessa Sochat <vsochat@stanford.edu> * typo in config Signed-off-by: Vanessa Sochat <vsochat@stanford.edu> * adding all the tests! Signed-off-by: Vanessa Sochat <vsochat@stanford.edu> * rename container diff to not have extension Signed-off-by: Vanessa Sochat <vsochat@stanford.edu> * try moving to /usr/local/bin Signed-off-by: Vanessa Sochat <vsochat@stanford.edu> * adding container-diff to path Signed-off-by: Vanessa Sochat <vsochat@stanford.edu> * containerdiff version Signed-off-by: Vanessa Sochat <vsochat@stanford.edu> * try including Dockerfiles Signed-off-by: Vanessa Sochat <vsochat@stanford.edu> * need to include Dockerfile with tests Signed-off-by: Vanessa Sochat <vsochat@stanford.edu> * forgot to add Dockerfile" Signed-off-by: Vanessa Sochat <vsochat@stanford.edu> * mising http.server Signed-off-by: Vanessa Sochat <vsochat@stanford.edu> * python2 being used Signed-off-by: Vanessa Sochat <vsochat@stanford.edu> * ensure python3 being used Signed-off-by: Vanessa Sochat <vsochat@stanford.edu> * need to bump version Signed-off-by: Vanessa Sochat <vsochat@stanford.edu> * separate tests for python2/3 Signed-off-by: Vanessa Sochat <vsochat@stanford.edu> * updating links to python 3 Signed-off-by: Vanessa Sochat <vsochat@stanford.edu> * version 2 deps Signed-off-by: Vanessa Sochat <vsochat@stanford.edu>
- Loading branch information
Showing
20 changed files
with
929 additions
and
45 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
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
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
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
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
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,49 @@ | ||
FROM golang:1.11.3-stretch | ||
MAINTAINER vsochat@stanford.edu | ||
|
||
# docker build -f docker/Dockerfile -t singularityhub/container-tree . | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
ENV LC_ALL C.UTF-8 | ||
ENV LANG C.UTF-8 | ||
|
||
LABEL "com.github.actions.name"="container-tree GitHub Action" | ||
LABEL "com.github.actions.description"="use Container-Tree in Github Actions Workflows" | ||
LABEL "com.github.actions.icon"="eye" | ||
LABEL "com.github.actions.color"="green" | ||
|
||
LABEL "repository"="https://www.github.com/singularityhub/container-tree" | ||
LABEL "homepage"="https://www.github.com/singularityhub/container-tree" | ||
LABEL "maintainer"="@vsoch" | ||
|
||
RUN apt-get update && \ | ||
apt-get -y install vim jq aria2 nginx python3 python3-dev \ | ||
automake git locales && \ | ||
wget https://bootstrap.pypa.io/get-pip.py && \ | ||
python3 get-pip.py | ||
|
||
# Install Container-Diff | ||
RUN go get github.com/GoogleContainerTools/container-diff && \ | ||
cd ${GOPATH}/src/github.com/GoogleContainerTools/container-diff && \ | ||
go get && \ | ||
make && \ | ||
go install && \ | ||
mkdir -p /code && \ | ||
apt-get autoremove && \ | ||
mkdir -p /root/.docker && \ | ||
echo {} > /root/.docker/config.json | ||
|
||
# Clean up | ||
RUN apt-get autoremove -y && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
RUN mkdir -p /code | ||
ADD . /code | ||
WORKDIR /code | ||
RUN python3 setup.py install && \ | ||
chmod u+x /code/docker/entrypoint.sh | ||
|
||
EXPOSE 9779 | ||
|
||
ENTRYPOINT ["/code/docker/entrypoint.sh"] |
Empty file.
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,25 @@ | ||
runTest() { | ||
|
||
# The first argument is the code we should get | ||
ERROR="${1:-}" | ||
shift | ||
OUTPUT=${1:-} | ||
shift | ||
|
||
"$@" > "${OUTPUT}" 2>&1 | ||
RETVAL="$?" | ||
|
||
if [ "$ERROR" = "0" -a "$RETVAL" != "0" ]; then | ||
echo "$@ (retval=$RETVAL) ERROR" | ||
cat ${OUTPUT} | ||
echo "Output in ${OUTPUT}" | ||
exit 1 | ||
elif [ "$ERROR" != "0" -a "$RETVAL" = "0" ]; then | ||
echo "$@ (retval=$RETVAL) ERROR" | ||
echo "Output in ${OUTPUT}" | ||
cat ${OUTPUT} | ||
exit 1 | ||
else | ||
echo "$@ (retval=$RETVAL) OK" | ||
fi | ||
} |
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,37 @@ | ||
#!/bin/bash | ||
|
||
# Include help functions | ||
. helpers.sh | ||
|
||
echo | ||
echo "************** START: test_client.sh **********************" | ||
|
||
# Create temporary testing directory | ||
echo "Creating temporary directory to work in." | ||
tmpdir=$(mktemp -d) | ||
output=$(mktemp ${tmpdir:-/tmp}/containertree_test.XXXXXX) | ||
|
||
echo "Testing help commands..." | ||
|
||
runTest 0 $output containertree --help | ||
for command in templates generate; | ||
do | ||
runTest 0 $output containertree $command --help | ||
done | ||
|
||
echo "Testing version command..." | ||
runTest 0 $output containertree --version | ||
|
||
echo "#### Testing generate command" | ||
runTest 0 $output containertree generate --output $tmpdir vanessa/salad | ||
runTest 0 $output test -f "$tmpdir/index.html" | ||
runTest 0 $output test -f "$tmpdir/data.json" | ||
runTest 0 $output containertree generate vanessa/salad --print index.html | ||
runTest 0 $output containertree generate vanessa/salad --print data.json | ||
|
||
echo "#### Testing templates command" | ||
runTest 0 $output containertree templates | ||
runTest 0 $output containertree generate --output $tmpdir vanessa/salad --template tree | ||
|
||
echo "Finish testing basic client" | ||
rm -rf ${tmpdir} |
Oops, something went wrong.