File tree Expand file tree Collapse file tree 2 files changed +17
-13
lines changed Expand file tree Collapse file tree 2 files changed +17
-13
lines changed Original file line number Diff line number Diff line change @@ -64,26 +64,25 @@ function image-build() {
64
64
local tag=$1
65
65
local dir=$2
66
66
local dest=" ${tag} "
67
+ local extra=
67
68
if [[ ! " ${tag} " == * " :" * ]]; then
68
69
dest=" ${tag} :latest"
70
+ # tag to release commit unless we specified a hardcoded tag
71
+ extra=" ${tag} :${OS_RELEASE_COMMIT} "
69
72
fi
70
73
71
74
local STARTTIME
72
75
local ENDTIME
73
76
STARTTIME=" $( date +%s) "
74
77
75
78
# build the image
76
- if ! os::build::image " ${dir} " " ${dest} " ; then
79
+ if ! os::build::image " ${dir} " " ${dest} " " " " ${extra} " ; then
77
80
os::log::warning " Retrying build once"
78
- if ! os::build::image " ${dir} " " ${dest} " ; then
81
+ if ! os::build::image " ${dir} " " ${dest} " " " " ${extra} " ; then
79
82
return 1
80
83
fi
81
84
fi
82
85
83
- # tag to release commit unless we specified a hardcoded tag
84
- if [[ ! " ${tag} " == * " :" * ]]; then
85
- docker tag " ${dest} " " ${tag} :${OS_RELEASE_COMMIT} "
86
- fi
87
86
# ensure the temporary contents are cleaned up
88
87
git clean -fdx " ${dir} "
89
88
@@ -151,11 +150,6 @@ image openshift/deployment-example:v1 examples/deployment
151
150
ln_or_cp " ${imagedir} /deployment" examples/deployment/bin
152
151
image openshift/deployment-example:v2 examples/deployment examples/deployment/Dockerfile.v2
153
152
154
- echo
155
- echo
156
- echo " ++ Active images"
157
-
158
- docker images | grep openshift/ | grep ${OS_RELEASE_COMMIT} | sort
159
153
echo
160
154
161
155
ret=$? ; ENDTIME=$( date +%s) ; echo " $0 took $(( $ENDTIME - $STARTTIME )) seconds" ; exit " $ret "
Original file line number Diff line number Diff line change @@ -726,16 +726,20 @@ function os::build::image() {
726
726
local directory=$1
727
727
local tag=$2
728
728
local dockerfile=" ${3-} "
729
+ local extra_tag=" ${4-} "
729
730
local options=" ${OS_BUILD_IMAGE_ARGS-} "
730
731
local mode=" ${OS_BUILD_IMAGE_TYPE:- imagebuilder} "
731
732
732
733
if [[ " ${mode} " == " imagebuilder" ]]; then
733
734
if os::util::find::system_binary ' imagebuilder' ; then
735
+ if [[ -n " ${extra_tag} " ]]; then
736
+ extra_tag=" -t '${extra_tag} '"
737
+ fi
734
738
if [[ -n " ${dockerfile} " ]]; then
735
- eval " imagebuilder -f '${dockerfile} ' -t '${tag} ' ${options} '${directory} '"
739
+ eval " imagebuilder -f '${dockerfile} ' -t '${tag} ' ${extra_tag} ${ options} '${directory} '"
736
740
return $?
737
741
fi
738
- eval " imagebuilder -t '${tag} ' ${options} '${directory} '"
742
+ eval " imagebuilder -t '${tag} ' ${extra_tag} ${ options} '${directory} '"
739
743
return $?
740
744
fi
741
745
@@ -746,9 +750,15 @@ function os::build::image() {
746
750
747
751
if [[ -n " ${dockerfile} " ]]; then
748
752
eval " docker build -f '${dockerfile} ' -t '${tag} ' ${options} '${directory} '"
753
+ if [[ -n " ${extra_tag} " ]]; then
754
+ docker tag " ${tag} " " ${extra_tag} "
755
+ fi
749
756
return $?
750
757
fi
751
758
eval " docker build -t '${tag} ' ${options} '${directory} '"
759
+ if [[ -n " ${extra_tag} " ]]; then
760
+ docker tag " ${tag} " " ${extra_tag} "
761
+ fi
752
762
return $?
753
763
}
754
764
readonly -f os::build::image
You can’t perform that action at this time.
0 commit comments