Skip to content

Commit 0f7190b

Browse files
author
Greg Bowler
committed
Output to log file
1 parent e533cdc commit 0f7190b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

php-build.bash

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ base_repo="$1"
4848

4949
# We log into the Github docker repository on behalf of the user that is
5050
# running the action (this could be anyone, outside of the php-actions organisation).
51-
echo "${ACTION_TOKEN}" | docker login docker.pkg.github.com -u "${GITHUB_ACTOR}" --password-stdin
51+
echo "${ACTION_TOKEN}" | docker login docker.pkg.github.com -u "${GITHUB_ACTOR}" --password-stdin >> output.log 2>&1
5252

5353
# If there are any extensions to be installed, we do this using the
5454
# install-php-extensions tool. If there are not extensions required, we don't
@@ -87,22 +87,23 @@ echo "$docker_tag" > ./docker_tag
8787
# Attempt to pull the existing Docker image, if it exists. If the image has
8888
# been pushed previously, this image should take preference and a new image
8989
# will not need to be built.
90-
echo "Pulling $docker_tag"
90+
echo "Pulling $docker_tag" >> output.log 2>&1
9191

9292
# No need to continue building the image if the pull was successful.
9393
if docker pull "$docker_tag";
9494
then
9595
exit
9696
fi
9797

98+
echo "Building PHP $ACTION_PHP_VERSION with extensions: $ACTION_PHP_EXTENSIONS ..."
9899
# Save the dockerfile to a physical file on disk, then build the image, tagging
99100
# it with the unique tag. If the layers are already built, there should be no
100101
# need to re-build, and the `docker build` step should use the cached layers of
101102
# what has just been pulled.
102103
echo "$dockerfile" > Dockerfile
103-
echo "Dockerfile:"
104-
echo "$dockerfile"
105-
docker build --tag "$docker_tag" --cache-from "$docker_tag" .
104+
echo "Dockerfile:" >> output.log 2>&1
105+
echo "$dockerfile" >> output.log 2>&1
106+
docker build --tag "$docker_tag" --cache-from "$docker_tag" . >> output.log 2>&1
106107
# Update the user's repository with the customised docker image, ready for the
107108
# next Github Actions run.
108-
docker push "$docker_tag"
109+
docker push "$docker_tag" >> output.log 2>&1

0 commit comments

Comments
 (0)