File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ PARENT_IMAGE_NAME="refinery-parent-images"
66RELEASE_TAG=" "
77DOCKER_REGISTRY=" kernai"
88DOCKERFILE=" Dockerfile"
9- HEAD_REF=" "
9+ HEAD_REF=" parent-image-updates "
1010
1111while getopts i:l:r:d:h: flag
1212do
2121
2222grep " ${DOCKER_REGISTRY} /${PARENT_IMAGE_NAME} " $DOCKERFILE | while read -r line ; do
2323 PI_EXISTING_TAG=$( echo $line | sed ' s|FROM ||g' | cut -d ' :' -f 2)
24- if [ -z $HEAD_REF ]; then
24+ ALREADY_UPDATED=$( echo $PI_EXISTING_TAG | grep $RELEASE_TAG || true)
25+
26+ if [ -z $ALREADY_UPDATED ] && [ -z $HEAD_REF ]; then
2527 PARENT_IMAGE_TYPE=$( echo $PI_EXISTING_TAG | cut -d ' -' -f 2-)
26- else
28+ elif [ -n $ALREADY_UPDATED ] && [ -z $HEAD_REF ]; then
29+ PARENT_IMAGE_TYPE=$( echo $PI_EXISTING_TAG | sed " s|${RELEASE_TAG} -||g" )
30+ elif [ -n $HEAD_REF ]; then
2731 PARENT_IMAGE_TYPE=$( echo $PI_EXISTING_TAG | sed " s|${HEAD_REF} -||g" )
32+ else
33+ echo " ::error::Failed to determine parent image type from tag: ${PI_EXISTING_TAG} "
34+ exit 1
2835 fi
36+
2937 PI_EXISTING_IMAGE=" ${DOCKER_REGISTRY} /${PARENT_IMAGE_NAME} :${PI_EXISTING_TAG} "
3038 PI_NEW_IMAGE=" ${DOCKER_REGISTRY} /${PARENT_IMAGE_NAME} :${RELEASE_TAG} -${PARENT_IMAGE_TYPE} "
3139
You can’t perform that action at this time.
0 commit comments