Skip to content

Commit 0915e08

Browse files
committed
p: fix push
1 parent b6599be commit 0915e08

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/env.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,11 @@ _init() {
253253

254254
_tag() {
255255
TARGET_TAG="$1"
256+
if [ -z "$TARGET_TAG" ]; then
257+
echo "docker-env: Missing tag argument" >&2
258+
echo " Usage: ./docker/env.sh tag TARGET_TAG"
259+
exit 1
260+
fi
256261

257262
DEV_IMAGES="$({
258263
docker image ls --format "{{.Repository}}:{{.Tag}}" \
@@ -266,6 +271,13 @@ _tag() {
266271
done
267272
}
268273

274+
_push() {
275+
docker image ls --format "{{.Repository}}" \
276+
| grep "-env" \
277+
| sort -u \
278+
| xargs docker image push --all-tags
279+
}
280+
269281
COMMAND="${1:---help}"
270282
if [ "$DOCKER_ENV" ]; then
271283
case "$COMMAND" in
@@ -349,7 +361,7 @@ else
349361

350362
push)
351363
shift
352-
_compose push "$@"
364+
_push "$@"
353365
;;
354366

355367
tag)

0 commit comments

Comments
 (0)