Skip to content

Commit

Permalink
Adding support for pipenv environments
Browse files Browse the repository at this point in the history
  • Loading branch information
stack72 committed Jan 12, 2021
1 parent 6756529 commit ba58c77
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ LABEL "homepage"="https://pulumi.com/docs/reference/cd-github-actions/"
RUN apt-get update -y && \
apt-get install -y jq

# Install pipenv incase the user is using that over virtualenv
RUN pip install pipenv

# Copy the entrypoint script.
COPY ./entrypoint.sh /usr/bin/pulumi-action

Expand Down
9 changes: 9 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,21 @@ if [ -e requirements.txt ]; then
$PULUMI_VENV/bin/python -m pip install --upgrade pip setuptools wheel
$PULUMI_VENV/bin/python -m pip install -r requirements.txt
fi
elif [ -e Pipfile.lock ]; then
pipenv install
PULUMI_PREFIX="pipenv run"
fi

# Now just pass along all arguments to the Pulumi CLI, sending the output to a file for
# later use. Note that we exit immediately on failure (under set -e), so we `tee` stdout, but
# allow errors to be surfaced in the Actions log.
# If there is a PULUMI_PREFIX then we can just prepend it to the pulumi command
PULUMI_COMMAND="pulumi $*"
if [ ! -z "$PULUMI_PREFIX" ]
then
PULUMI_COMMAND="$PULUMI_PREFIX pulumi $*"
fi

OUTPUT_FILE=$(mktemp)
echo "#### :tropical_drink: \`$PULUMI_COMMAND\`"
bash -c "$PULUMI_COMMAND" | tee $OUTPUT_FILE
Expand Down

0 comments on commit ba58c77

Please sign in to comment.