Skip to content

Commit a556ad7

Browse files
CI: Push docker images directly to registry (#16488)
Exporting docker images to disk and reimporting them in the next job is very expensive. It's more efficient to push them directly from the builder job to the registry. `dist_docs` implicitly pulls the image from the registry. Updates `distribution-scripts` dependency to crystal-lang/distribution-scripts@d1d8657 This includes the following changes: * crystal-lang/distribution-scripts#395
1 parent bc203cb commit a556ad7

File tree

1 file changed

+6
-31
lines changed

1 file changed

+6
-31
lines changed

.circleci/config.yml

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ parameters:
88
distribution-scripts-version:
99
description: "Git ref for version of https://github.com/crystal-lang/distribution-scripts/"
1010
type: string
11-
default: "b7af456b433ebf114769ad8eb4f2c51c56c26189"
11+
default: "d1d86577200f8a3d567bf83d911f60a05733c4b4"
1212
previous_crystal_base_url:
1313
description: "Prefix for URLs to Crystal bootstrap compiler"
1414
type: string
@@ -353,31 +353,14 @@ jobs:
353353
cd /tmp/workspace/distribution-scripts
354354
source build.env
355355
cd docker
356-
make all64 TARBALLS=/tmp/workspace/build/
357-
make smoke-all
358-
- persist_to_workspace:
359-
root: /tmp/workspace/distribution-scripts/docker/
360-
paths:
361-
- build
362-
363-
publish_docker:
364-
machine:
365-
image: default
366-
steps:
367-
- attach_workspace:
368-
at: /tmp/workspace
356+
make all TARBALLS=/tmp/workspace/build/ VERSION=${CRYSTAL_VERSION}
357+
make smoke-all VERSION=${CRYSTAL_VERSION}
369358
- run: |
370359
cd /tmp/workspace/distribution-scripts
371-
source ./build.env
372-
gunzip -c /tmp/workspace/build/docker-${CRYSTAL_VERSION}-ubuntu-x86_64.tar.gz | docker image load
373-
gunzip -c /tmp/workspace/build/docker-${CRYSTAL_VERSION}-ubuntu-x86_64-build.tar.gz | docker image load
374-
gunzip -c /tmp/workspace/build/docker-${CRYSTAL_VERSION}-alpine.tar.gz | docker image load
375-
gunzip -c /tmp/workspace/build/docker-${CRYSTAL_VERSION}-alpine-build.tar.gz | docker image load
360+
source build.env
361+
cd docker
376362
docker login -u ${DOCKER_USER} -p ${DOCKER_PASS}
377-
docker push ${DOCKER_REPOSITORY}:${DOCKER_TAG}
378-
docker push ${DOCKER_REPOSITORY}:${DOCKER_TAG}-build
379-
docker push ${DOCKER_REPOSITORY}:${DOCKER_TAG}-alpine
380-
docker push ${DOCKER_REPOSITORY}:${DOCKER_TAG}-alpine-build
363+
make push VERSION=${CRYSTAL_VERSION}
381364
382365
dist_snap:
383366
docker:
@@ -425,7 +408,6 @@ jobs:
425408
cd /tmp/workspace/distribution-scripts
426409
source build.env
427410
cd docs
428-
gunzip -c /tmp/workspace/build/docker-${CRYSTAL_VERSION}-ubuntu-x86_64-build.tar.gz | docker image load
429411
make CRYSTAL_DOCKER_IMAGE=${DOCKER_REPOSITORY}:${DOCKER_TAG}-build
430412
- store_artifacts:
431413
path: /tmp/workspace/distribution-scripts/docs/build
@@ -523,10 +505,6 @@ workflows:
523505
filters: *release
524506
requires:
525507
- dist_snap
526-
- publish_docker:
527-
filters: *release
528-
requires:
529-
- dist_docker
530508
- dist_docs:
531509
filters: *release
532510
requires:
@@ -578,9 +556,6 @@ workflows:
578556
- publish_snap:
579557
requires:
580558
- dist_snap
581-
- publish_docker:
582-
requires:
583-
- dist_docker
584559
- dist_docs:
585560
requires:
586561
- dist_docker

0 commit comments

Comments
 (0)