Skip to content

Commit

Permalink
per #1546, pipe docker build output to log file and make log availabl…
Browse files Browse the repository at this point in the history
…e as artifact on failure
  • Loading branch information
georgemccabe committed Jan 20, 2022
1 parent 0327436 commit 2bdefad
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/jobs/build_docker_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ DOCKERHUB_TAG=dtcenter/met:${SOURCE_BRANCH}

DOCKERFILE_PATH=${GITHUB_WORKSPACE}/scripts/docker/Dockerfile.copy

LOG_FILE=${GITHUB_WORKSPACE}/docker_build.log
echo "Logging to ${LOG_FILE}"

time_command docker build -t ${DOCKERHUB_TAG} \
--build-arg SOURCE_BRANCH \
--build-arg MET_BASE_IMAGE \
-f $DOCKERFILE_PATH ${GITHUB_WORKSPACE}
-f $DOCKERFILE_PATH ${GITHUB_WORKSPACE} \
&> ${LOG_FILE}
7 changes: 7 additions & 0 deletions .github/workflows/test_compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,10 @@ jobs:
env:
SOURCE_BRANCH: ${{ steps.get_branch_name.outputs.branch_name }}
MET_BASE_IMAGE: minimum

- name: Upload logs as artifact
uses: actions/upload-artifact@v2
if: failure()
with:
name: build_log
path: ${GITHUB_WORKSPACE}/docker_build.log

0 comments on commit 2bdefad

Please sign in to comment.