@@ -26,15 +26,19 @@ source "$(dirname "${BASH_SOURCE[0]}")/includer.sh"
2626
2727function docker::cmd() {
2828 @doc Smart command for docker.
29- $( commands::use docker) " $@ "
29+ if [ -z " $SIMULATE " ]; then
30+ $( commands::use docker) " $@ "
31+ else
32+ echo " $( commands::use docker) " " $@ "
33+ fi
3034}
3135
3236function docker::pull() {
3337 @doc pull the specified image
3438 @arg _1_ the full image url to pull
3539 local image=${1:? }
3640 log::info " Pulling $image "
37- exec::hide docker::cmd pull -q " $image "
41+ docker::cmd pull -q " $image "
3842}
3943
4044function docker::tag() {
@@ -43,15 +47,15 @@ function docker::tag() {
4347 @arg _2_ the desired final url
4448 local from=${1:? }
4549 local to=${2:? }
46- exec::hide docker::cmd tag " $from " " $to "
50+ docker::cmd tag " $from " " $to "
4751}
4852
4953function docker::push() {
5054 @doc push the specified image
5155 @arg _1_ the full image url to push
5256 local image=${1:? }
5357 log::info " Pushing $image "
54- exec::hide docker::cmd push " $image "
58+ docker::cmd push " $image "
5559}
5660
5761function docker::cp() {
@@ -131,7 +135,6 @@ function docker::promote_latest() {
131135 local organization=${1:? }
132136 local registry=${2:? }
133137 local target_tag=${3:? }
134- local simulate=${SIMULATE:- " " }
135138 shift 3
136139
137140 for repo in $( docker::list_repositories " $registry " |
@@ -143,28 +146,14 @@ function docker::promote_latest() {
143146 log::warn " $repo has no official version in $target_tag "
144147 continue
145148 fi
146- if [ -z " $simulate " ]; then
147- docker::cp " $registry /$repo :$src_version " " $registry /$repo :$target_tag "
148- else
149- log::notice " Would copy $registry /$repo :$src_version to $registry /$repo :$target_tag "
150- fi
149+ docker::cp " $registry /$repo :$src_version " " $registry /$repo :$target_tag "
151150 for extra_registry in " $@ " ; do
152- if [ -z " $simulate " ]; then
153- docker::tag " $registry /$repo :$src_version " " $extra_registry /$repo :$src_version "
154- docker::tag " $registry /$repo :$target_tag " " $extra_registry /$repo :$target_tag "
155- else
156- log::notice " Would tag $registry /$repo :$src_version as $extra_registry /$repo :$src_version "
157- log::notice " Would tag $registry /$repo :$target_tag as $extra_registry /$repo :$target_tag "
158- fi
151+ docker::tag " $registry /$repo :$src_version " " $extra_registry /$repo :$src_version "
152+ docker::tag " $registry /$repo :$target_tag " " $extra_registry /$repo :$target_tag "
159153 done
160154 for extra_registry in " $@ " ; do
161- if [ -z " $simulate " ]; then
162- docker::push " $extra_registry /$repo :$src_version "
163- docker::push " $extra_registry /$repo :$target_tag "
164- else
165- log::notice " Would push $extra_registry /$repo :$src_version "
166- log::notice " Would push $extra_registry /$repo :$target_tag "
167- fi
155+ docker::push " $extra_registry /$repo :$src_version "
156+ docker::push " $extra_registry /$repo :$target_tag "
168157 done
169158 done
170159}
0 commit comments