Skip to content

Commit

Permalink
Hard-wire base image in lib
Browse files Browse the repository at this point in the history
  • Loading branch information
JonJagger committed Feb 2, 2025
1 parent bb87ac5 commit 6843a50
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/base_image_trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ on:
workflow_dispatch:
inputs:
base_image_tag:
description: "Image-Tag for cyberdojo/sinatra (short commit SHA - first 7 digits), eg edb2887"
description: "Image-Tag for cyberdojo/sinatra-base (short commit SHA - first 7 digits), eg edb2887"
required: true
base_image_digest:
description: "Image-Digest for cyberdojo/sinatra, eg ddab9080c..."
description: "Image-Digest for cyberdojo/sinatra-base, eg ddab9080c..."
required: true


Expand Down
4 changes: 2 additions & 2 deletions bin/build_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ build_image()
echo
echo "Building with --build-args"
echo " COMMIT_SHA=${COMMIT_SHA}"
echo " BASE_IMAGE=${CYBER_DOJO_SAVER_BASE_IMAGE}"
echo " BASE_IMAGE=${BASE_IMAGE}"
echo "To change this run:"
echo "$ COMMIT_SHA=... CYBER_DOJO_SAVER_BASE_IMAGE=cyberdojo/sinatra-base:... make image_${type}"
echo "$ COMMIT_SHA=... BASE_IMAGE=cyberdojo/saver:559d354@sha256:ddab9080... make image_${type}"
echo

docker compose build server
Expand Down
10 changes: 5 additions & 5 deletions bin/lib.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

echo_base_image()
{
local -r json="$(curl --fail --silent --request GET https://beta.cyber-dojo.org/saver/base_image)"
echo "${json}" | jq -r '.base_image'
# echo cyberdojo/sinatra-base:edb2887@sha256:d40099e71ac46310a58cea1640f5fb842dbaadc148e4973bfb8d2092516370a1
# local -r json="$(curl --fail --silent --request GET https://beta.cyber-dojo.org/saver/base_image)"
# echo "${json}" | jq -r '.base_image'
echo cyberdojo/sinatra-base:559d354@sha256:ddab9080cd0bbd8e976a18bdd01b37b66e47fe83b0db396e65dc3014bad17fd3
}

echo_env_vars()
Expand All @@ -17,8 +17,8 @@ echo_env_vars()
# There are none

# Set env-vars for this repos runner service
if [[ ! -v CYBER_DOJO_SAVER_BASE_IMAGE ]] ; then
echo CYBER_DOJO_SAVER_BASE_IMAGE="$(echo_base_image)" # --build-arg
if [[ ! -v BASE_IMAGE ]] ; then
echo BASE_IMAGE="$(echo_base_image)" # --build-arg
fi
if [[ ! -v COMMIT_SHA ]] ; then
local -r sha="$(cd "${ROOT_DIR}" && git rev-parse HEAD)"
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
context: source/client
args:
- COMMIT_SHA
- BASE_IMAGE=${CYBER_DOJO_SAVER_BASE_IMAGE}
- BASE_IMAGE=${BASE_IMAGE}
image: ${CYBER_DOJO_SAVER_CLIENT_IMAGE}:${CYBER_DOJO_SAVER_TAG}
user: ${CYBER_DOJO_SAVER_CLIENT_USER}
container_name: ${CYBER_DOJO_SAVER_CLIENT_CONTAINER_NAME}
Expand All @@ -27,7 +27,7 @@ services:
context: .
args:
- COMMIT_SHA
- BASE_IMAGE=${CYBER_DOJO_SAVER_BASE_IMAGE}
- BASE_IMAGE=${BASE_IMAGE}
image: ${CYBER_DOJO_SAVER_IMAGE}:${CYBER_DOJO_SAVER_TAG}
user: ${CYBER_DOJO_SAVER_SERVER_USER}
container_name: ${CYBER_DOJO_SAVER_SERVER_CONTAINER_NAME}
Expand Down

0 comments on commit 6843a50

Please sign in to comment.