-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
#2016) Co-authored-by: Julie Prestopnik <jpresto@seneca.rap.ucar.edu> Co-authored-by: johnhg <johnhg@ucar.edu> Co-authored-by: Seth Linden <linden@kiowa.rap.ucar.edu> Co-authored-by: John Halley Gotway <johnhg@ucar.edu> Co-authored-by: j-opatz <59586397+j-opatz@users.noreply.github.com> Co-authored-by: Howard Soh <hsoh@kiowa.rap.ucar.edu> Co-authored-by: John Halley Gotway <johnhg@kiowa.rap.ucar.edu> Co-authored-by: jprestop <jpresto@ucar.edu> Co-authored-by: Seth Linden <linden@ucar.edu> Co-authored-by: hsoh-u <hsoh@ucar.edu> Co-authored-by: George McCabe <23407799+georgemccabe@users.noreply.github.com> Co-authored-by: John Halley Gotway <johnhg@seneca.rap.ucar.edu> Co-authored-by: MET Tools Test Account <met_test@seneca.rap.ucar.edu> Co-authored-by: mo-mglover <78152252+mo-mglover@users.noreply.github.com>
- Loading branch information
1 parent
fa61672
commit 90bea06
Showing
99 changed files
with
4,902 additions
and
990 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#! /bin/bash | ||
|
||
# utility function to run command get log the time it took to run | ||
function time_command { | ||
local start_seconds=$SECONDS | ||
echo "RUNNING: $*" | ||
"$@" | ||
local error=$? | ||
|
||
local duration=$(( SECONDS - start_seconds )) | ||
echo "TIMING: Command took `printf '%02d' $(($duration / 60))`:`printf '%02d' $(($duration % 60))` (MM:SS): '$*'" | ||
if [ ${error} -ne 0 ]; then | ||
echo "ERROR: '$*' exited with status = ${error}" | ||
fi | ||
return $error | ||
} | ||
|
||
prefix=refs/heads/ | ||
branch_name=${GITHUB_REF#"$prefix"} | ||
DOCKERHUB_TAG=dtcenter/met:${branch_name} | ||
|
||
DOCKERFILE_DIR=${GITHUB_WORKSPACE}/scripts/docker | ||
|
||
echo "::group::Docker Build Command" | ||
time_command docker build -t ${DOCKERHUB_TAG} \ | ||
--build-arg SOURCE_BRANCH=$branch_name \ | ||
$DOCKERFILE_DIR | ||
echo "::endgroup::" | ||
|
||
# skip docker push if credentials are not set | ||
if [ -z ${DOCKER_USERNAME+x} ] || [ -z ${DOCKER_PASSWORD+x} ]; then | ||
echo "DockerHub credentials not set. Skipping docker push" | ||
exit 0 | ||
fi | ||
|
||
echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin | ||
|
||
echo "::group::Docker Push Command" | ||
time_command docker push ${DOCKERHUB_TAG} | ||
echo "::endgroup::" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Build Docker Image and Trigger METplus Workflow | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
paths-ignore: | ||
- 'met/docs/**' | ||
|
||
jobs: | ||
build_met_docker: | ||
name: Handle Docker Image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build and Push Docker Image | ||
run: .github/jobs/build_and_push_docker_image.sh | ||
env: | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
trigger_metplus: | ||
name: Trigger METplus testing workflow | ||
runs-on: ubuntu-latest | ||
needs: build_met_docker | ||
steps: | ||
- name: Print GitHub values for reference | ||
env: | ||
GITHUB_CONTEXT: ${{ toJson(github) }} | ||
run: echo "$GITHUB_CONTEXT" | ||
- uses: actions/github-script@v5 | ||
with: | ||
github-token: ${{ secrets.METPLUS_BOT_TOKEN }} | ||
script: | | ||
await github.rest.actions.createWorkflowDispatch({ | ||
owner: 'dtcenter', | ||
repo: 'METplus', | ||
workflow_id: 'testing.yml', | ||
ref: 'develop', | ||
inputs: { | ||
repository: '${{ github.repository }}', | ||
ref: '${{ github.ref }}', | ||
actor: '${{ github.actor }}', | ||
sha: '${{ github.sha }}', | ||
pusher_email: '${{ github.event.pusher.email }}' | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ bin | |
share | ||
Makefile | ||
Makefile.in | ||
make.log | ||
|
||
# tilda files generated by emacs | ||
*~ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.