Merge pull request #26 from teohhanhui/fix/shell-command-issues

Fix shell command issues
This commit is contained in:
Ibrahim Ali
2019-10-17 11:56:14 -07:00
committed by GitHub
2 changed files with 23 additions and 38 deletions

View File

@@ -1,12 +1,15 @@
# Codecov @codecov # Codecov @codecov
FROM ubuntu:latest FROM debian:stretch-slim
WORKDIR /app RUN apt-get update && apt-get install -y \
COPY . /app ca-certificates \
curl \
git \
mercurial \
--no-install-recommends && rm -r /var/lib/apt/lists/*
RUN apt update && apt install -y curl git mercurial COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
RUN chmod +x /app/entrypoint.sh ENTRYPOINT ["/entrypoint.sh"]
ENTRYPOINT [ "/app/entrypoint.sh" ]

44
entrypoint.sh Normal file → Executable file
View File

@@ -1,38 +1,20 @@
#!/bin/bash #!/bin/sh
# Codecov @codecov # Codecov @codecov
set -eu set -eu
if [ $# -eq 0 ] if [ "x$INPUT_FILE" != 'x' ]; then
then curl -s https://codecov.io/bash | bash -s -- \
echo "Please provide an upload token from codecov.io" -f "$INPUT_FILE" \
exit 1 -t "$INPUT_TOKEN" \
elif [ "x$INPUT_TOKEN" != "x" ] && [ "x$INPUT_FILE" != "x" ] && [ "x$INPUT_FLAGS" != "x" ] && [ "x$INPUT_NAME" != "x" ] -n "$INPUT_NAME" \
then -F "$INPUT_FLAGS" \
curl -s https://codecov.io/bash | bash -s -- -t $INPUT_TOKEN -f $INPUT_FILE -F $INPUT_FLAGS -n $INPUT_NAME -Z || echo 'Codecov upload failed'
elif [ "x$INPUT_TOKEN" != "x" ] && [ "x$INPUT_FILE" != "x" ] && [ "x$INPUT_FLAGS" != "x" ]
then
curl -s https://codecov.io/bash | bash -s -- -t $INPUT_TOKEN -f $INPUT_FILE -F $INPUT_FLAGS
elif [ "x$INPUT_TOKEN" != "x" ] && [ "x$INPUT_FILE" != "x" ] && [ "x$INPUT_NAME" != "x" ]
then
curl -s https://codecov.io/bash | bash -s -- -t $INPUT_TOKEN -f $INPUT_FILE -n $INPUT_NAME
elif [ "x$INPUT_TOKEN" != "x" ] && [ "x$INPUT_NAME" != "x" ] && [ "x$INPUT_FLAGS" != "x" ]
then
curl -s https://codecov.io/bash | bash -s -- -t $INPUT_TOKEN -n $INPUT_NAME -F $INPUT_FLAGS
elif [ "x$INPUT_TOKEN" != "x" ] && [ "x$INPUT_FILE" != "x" ]
then
curl -s https://codecov.io/bash | bash -s -- -t $INPUT_TOKEN -f $INPUT_FILE
elif [ "x$INPUT_TOKEN" != "x" ] && [ "x$INPUT_FLAGS" != "x" ]
then
curl -s https://codecov.io/bash | bash -s -- -t $INPUT_TOKEN -F $INPUT_FLAGS
elif [ "x$INPUT_TOKEN" != "x" ] && [ "x$INPUT_NAME" != "x" ]
then
curl -s https://codecov.io/bash | bash -s -- -t $INPUT_TOKEN -n $INPUT_NAME
elif [ "x$INPUT_TOKEN" != "x" ]
then
curl -s https://codecov.io/bash | bash -s -- -t $INPUT_TOKEN
else else
echo "Please provide an upload token from codecov.io with valid arguments" curl -s https://codecov.io/bash | bash -s -- \
exit 1 -t "$INPUT_TOKEN" \
-n "$INPUT_NAME" \
-F "$INPUT_FLAGS" \
-Z || echo 'Codecov upload failed'
fi fi