Skip to content

Commit ff241e3

Browse files
committed
fix: edit dockerfile for first-time updates
1 parent 50e74c2 commit ff241e3

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

.github/workflows/pi_build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ jobs:
242242
243243
gh pr create --draft \
244244
--title "test: parent image updates" \
245-
--body "${{ github.event.pull_request.body }}" \
245+
--body "Main PR: https://github.com/${{ github.repository_owner }}/refinery-submodule-parent-images/pull/${{ github.event.pull_request.number }}" \
246246
--base dev \
247247
--head ${{ env.HEAD_REF }} \
248248
--repo ${{ github.repository_owner }}/${{ matrix.app }} || true

pi/edit_dockerfile.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -e
44

55
PARENT_IMAGE_NAME="refinery-parent-images"
6-
RELEASE_TAG="parent-image-updates"
6+
RELEASE_TAG="v2.0.0"
77
DOCKER_REGISTRY="kernai"
88
DEV_REGISTRY="registry.dev.kern.ai/code-kern-ai"
99
DOCKERFILE="Dockerfile"
@@ -36,7 +36,10 @@ grep "${REGISTRY}/${PARENT_IMAGE_NAME}" $DOCKERFILE | while read -r line ; do
3636
PARENT_IMAGE_TYPE=$(echo $PI_EXISTING_TAG | sed "s|${image_version}-||g")
3737
elif [ -n "$ALREADY_UPDATED" ] && [ -z "$HEAD_REF" ]; then
3838
PARENT_IMAGE_TYPE=$(echo $PI_EXISTING_TAG | sed "s|${RELEASE_TAG}-||g")
39-
elif [ -n "$HEAD_REF" ]; then
39+
elif [ -z "$ALREADY_UPDATED" ] && [ -n "$HEAD_REF" ]; then
40+
image_version=$(echo $PI_EXISTING_TAG | cut -d '-' -f 1)
41+
PARENT_IMAGE_TYPE=$(echo $PI_EXISTING_TAG | sed "s|${image_version}-||g")
42+
elif [ -n "$ALREADY_UPDATED" ] && [ -n "$HEAD_REF" ]; then
4043
PARENT_IMAGE_TYPE=$(echo $PI_EXISTING_TAG | sed "s|${HEAD_REF}-||g")
4144
else
4245
echo "::error::Failed to determine parent image type from tag: ${PI_EXISTING_TAG}"

0 commit comments

Comments
 (0)