File tree Expand file tree Collapse file tree 2 files changed +18
-16
lines changed Expand file tree Collapse file tree 2 files changed +18
-16
lines changed Original file line number Diff line number Diff line change @@ -309,6 +309,8 @@ steps:
309
309
310
310
Specifying your own tags makes it easy to reuse the image later in the pipeline.
311
311
312
+ These tags are applied each time the plugin runs, whether the image is newly built or already exists and was pulled.
313
+
312
314
# ## AWS ECR specific configuration
313
315
314
316
# ### Specifying an ECR repository name
Original file line number Diff line number Diff line change @@ -71,26 +71,26 @@ if ! docker pull "${image}:${tag}"; then
71
71
docker " ${image_build_args[@]} " ${BUILDKITE_PLUGIN_DOCKER_ECR_CACHE_ADDITIONAL_BUILD_ARGS:- } " ${context} " ||
72
72
log_fatal " ^^^ +++" 1
73
73
74
- echo " --- Pushing tags"
75
- echo " - ${tag} "
76
- docker push " ${image} :${tag} "
74
+ docker tag " ${image} :${tag} " " ${image} :latest"
77
75
78
- results=()
79
- read_list_property ' TAGS'
80
- if [ " ${# result[*]} " == " 0" ]; then
81
- echo " - latest"
82
- docker tag " ${image} :${tag} " " ${image} :latest"
83
- docker push " ${image} :latest"
84
- else
85
- for other_tag in ${result[@]+" ${result[@]} " } ; do
86
- echo " - ${other_tag} "
87
- docker tag " ${image} :${tag} " " ${image} :${other_tag} "
88
- docker push " ${image} :${other_tag} "
89
- done
90
- fi
76
+ echo " --- Pushing tag ${tag} "
77
+ docker push " ${image} :${tag} "
91
78
79
+ echo " --- Pushing tag latest"
80
+ docker push " ${image} :latest"
92
81
fi || echo " Not found"
93
82
83
+ results=()
84
+ read_list_property ' TAGS'
85
+ if [ " ${# result[*]} " != " 0" ]; then
86
+ for extra_tag in ${result[@]+" ${result[@]} " } ; do
87
+ echo " --- Pushing extra tags"
88
+ echo " - ${extra_tag} "
89
+ docker tag " ${image} :${tag} " " ${image} :${extra_tag} "
90
+ docker push " ${image} :${extra_tag} "
91
+ done
92
+ fi
93
+
94
94
# Support using https://github.com/buildkite-plugins/docker-buildkite-plugin without an image by default
95
95
export ${export_env_variable} =" ${image} :${tag} "
96
96
You can’t perform that action at this time.
0 commit comments