diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 59e30b0a244..aa086715b1a 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,6 +8,10 @@ updates: day: "saturday" time: "01:00" directory: "/" + allow: + # Allow updates for crane and squirrel....moose is updated through CIVET + - dependency-name: "crane" + - dependency-name: "squirrel" # Maintain dependencies for GitHub Actions once a month - package-ecosystem: "github-actions" schedule: diff --git a/doc/content/development/zapdos_developer_info.md b/doc/content/development/zapdos_developer_info.md index 7ec7dba57be..5273b425c06 100644 --- a/doc/content/development/zapdos_developer_info.md +++ b/doc/content/development/zapdos_developer_info.md @@ -7,13 +7,10 @@ is desired, please refer to the [moose_developer_info.md] page. ## Update and Build a New Docker Container !style halign=left -The Zapdos docker container image should be updated whenever Zapdos source code or submodules (CRANE, -Squirrel, or MOOSE) are updated and those changes are merged into the master branch. Whenever the -MOOSE submodule is updated, in particular, the submodule git commit hash must be copied and entered -into the `Dockerfile` so that the proper MOOSE docker image can be used with the Zapdos image. - -To build a new docker container, first fetch the most up-to-date version of the Zapdos master branch. -Assuming that Zapdos is stored in `~/projects/` and that your `upstream` remote is referencing +The Zapdos docker container image should be updated whenever Zapdos source code or that of submodules +(CRANE, Squirrel, or MOOSE) are updated and those changes are merged into the master branch. To build +a new docker container, first fetch the most up-to-date version of the Zapdos master branch. Assuming +that Zapdos is stored in `~/projects/` and that your `upstream` remote is referencing [shannon-lab/zapdos](https://github.com/shannon-lab/zapdos.git): ```bash @@ -68,7 +65,3 @@ INFO: Push to Docker Hub disabled. If desired in the future, run this script docker push shannonlab/zapdos:2c4a214d4d55106ac6c8c9058e3b224a46ba416d docker push shannonlab/zapdos:latest ``` - - - - diff --git a/Dockerfile b/scripts/Dockerfile similarity index 60% rename from Dockerfile rename to scripts/Dockerfile index d65d37e2d7f..c4d331b724f 100644 --- a/Dockerfile +++ b/scripts/Dockerfile @@ -1,5 +1,5 @@ -# DON'T FORGET: Modify this hash to be consistent with the MOOSE submodule! -FROM idaholab/moose:5e60aeb38c948f5db9e98b2080724b87188f5ee2 +# Template variable is replaced with hash when build_docker.sh is run! +FROM idaholab/moose:{{MOOSE_HASH}} WORKDIR /opt diff --git a/scripts/build_docker.sh b/scripts/build_docker.sh index 20c44ec95aa..c2658e41b5a 100755 --- a/scripts/build_docker.sh +++ b/scripts/build_docker.sh @@ -32,7 +32,6 @@ fi # Enter Zapdos source location, checkout master branch, and save latest git commit hash cd $ZAPDOS_DIR git checkout master -DOCKERFILE_HASH=$(cat Dockerfile | grep "FROM idaholab/moose:" | cut -d: -f2) ZAPDOS_MASTER_HASH=$(git rev-parse master) # Get MOOSE submodule hash and compare to Dockerfile to make sure it has been updated @@ -40,14 +39,10 @@ git submodule update --init moose cd moose MOOSE_HASH=$(git rev-parse HEAD) -if [[ ! $DOCKERFILE_HASH == $MOOSE_HASH ]]; then - echo "" - echo "ERROR: Dockerfile has not been updated to be consistent with the MOOSE submodule!" - echo " Aborting docker build!" - exit 1 -fi +cd $ZAPDOS_DIR/scripts -cd $ZAPDOS_DIR +# Use sed to find and replace MOOSE submodule hash into Dockerfile +sed -i '' "s/{{MOOSE_HASH}}/$MOOSE_HASH/g" Dockerfile # Build docker container and tag it with master git hash docker build -t shannonlab/zapdos:"$ZAPDOS_MASTER_HASH" . || exit $? @@ -55,6 +50,9 @@ docker build -t shannonlab/zapdos:"$ZAPDOS_MASTER_HASH" . || exit $? # Retag newly built container to make a second one with the tag "latest" docker tag shannonlab/zapdos:"$ZAPDOS_MASTER_HASH" shannonlab/zapdos:latest +# Restore Dockerfile to un-modified state so that branch is clean +git restore Dockerfile + # Push both containers to Docker Hub, if enabled. If not, display a notice to the screen with more info if [[ $PUSH == 1 ]]; then docker push shannonlab/zapdos:$ZAPDOS_MASTER_HASH