Skip to content

Commit

Permalink
Per #1546, added logic to update truth data volume on DockerHub for -…
Browse files Browse the repository at this point in the history
…ref branches
  • Loading branch information
georgemccabe committed Jan 25, 2022
1 parent 8f783d2 commit 088bcb1
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/jobs/Dockerfile.truth
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM centos:7
MAINTAINER George McCabe <mccabe@ucar.edu>

ENV OUTPUT_DIR /data/output
RUN mkdir -p ${OUTPUT_DIR}

ARG TRUTH_DIR

COPY ${TRUTH_DIR} ${OUTPUT_DIR}/

ARG TRUTH_DIR

# Define the volume mount point
VOLUME ${OUTPUT_DIR}/${TRUTH_DIR}

USER root
CMD ["true"]
10 changes: 10 additions & 0 deletions .github/jobs/create_docker_truth.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#! /bin/bash

source ${GITHUB_WORKSPACE}/.github/jobs/bash_functions.sh

image_name=dtcenter/met-data-output:${TRUTH_DATA_VERSION}

time_command docker build -t ${image_name} \
--build-arg TRUTH_DIR=met_test_truth \
-f ${GITHUB_WORKSPACE}/.github/jobs/Dockerfile.truth \
${RUNNER_WORKSPACE}
23 changes: 23 additions & 0 deletions .github/workflows/pr_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -320,3 +320,26 @@ jobs:
name: logs
path: ${{ runner.workspace }}/logs
if-no-files-found: ignore

update_truth:
name: Update Truth Data
runs-on: ubuntu-latest
needs: [job_control, unit_tests_1b, unit_tests_2b, unit_tests_3a]
if: ${{ needs.job_control.outputs.run_update_truth == 'true' }}
steps:
- uses: actions/checkout@v2

- name: Download data from previous jobs
uses: actions/download-artifact@v2

- name: Copy test output into single directory
run: |
mkdir ${RUNNER_WORKSPACE}/met_test_truth
cp -r unit_tests_*/* ${RUNNER_WORKSPACE}/met_test_truth/
- name: Create Docker Data Volume
run: .github/jobs/create_docker_truth.sh
env:
TRUTH_DATA_VERSION: develop
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

0 comments on commit 088bcb1

Please sign in to comment.