Skip to content

Commit d7d7cfe

Browse files
refactor: Minimize the number of images and packages in build process (#458)
* refactor: Minimize the number of images and packages in build process * fix: failing flutter widget tests --------- Signed-off-by: Evgeniy Dikevich <[email protected]> Co-authored-by: Damian Molinski <[email protected]>
1 parent 3eb2f17 commit d7d7cfe

File tree

35 files changed

+212
-218
lines changed

35 files changed

+212
-218
lines changed

.config/dictionaries/project.dic

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ fontawesome
3838
fontconfig
3939
fontname
4040
forcelabels
41+
gdebi
4142
Geckodriver
4243
genpkey
4344
giga

Earthfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ IMPORT ./earthly/cspell AS cspell-ci
55
IMPORT ./earthly/bash AS bash-ci
66
IMPORT ./earthly/spectral AS spectral-ci
77
IMPORT ./earthly/python AS python-ci
8+
IMPORT ./earthly/debian AS debian
89

910
ARG --global REGISTRY="harbor.shared-services.projectcatalyst.io/dockerhub/library"
1011

@@ -23,7 +24,7 @@ markdown-check-fix:
2324

2425
# Make sure the project dictionary is properly sorted.
2526
clean-spelling-list:
26-
FROM ${REGISTRY}/debian:stable-slim
27+
FROM debian+debian-clean
2728
DO cspell-ci+CLEAN
2829

2930
# check-spelling Check spelling in this repo inside a container.
@@ -32,8 +33,6 @@ check-spelling:
3233

3334
# check-bash - test all bash files lint properly according to shellcheck.
3435
check-bash:
35-
FROM ${REGISTRY}/alpine:3.20.3
36-
3736
DO bash-ci+SHELLCHECK --src=.
3837

3938
# Internal: Reference to our repo root documentation used by docs builder.
@@ -66,4 +65,4 @@ edit-docs:
6665
# are linted equally.
6766
# Its also fast.
6867
check-python:
69-
DO python-ci+LINT_PYTHON
68+
DO python-ci+LINT_PYTHON

docs/Earthfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,8 @@ src:
2323
# Build the docs here.
2424
docs:
2525
FROM +src
26-
2726
DO docs-ci+BUILD
2827

29-
3028
# Make a docker image that can serve the docs for development purposes.
3129
# This target is only for local developer use.
3230
local:

docs/src/guides/languages/flutter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ In case you have unit tests in your project, you can run them with `unit-tests`
104104
unit-tests:
105105
FROM +builder
106106
107-
DO flutter-ci+UNIT_TEST
107+
DO flutter-ci+UNIT_TESTS
108108
```
109109

110110
### Build Flutter app for Web

earthly/bash/Earthfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ builder:
1616

1717
# Copy our common scripts so we can use them inside the container.
1818
# Internally in the repo we use a symlink to accomplish this, but Earthly
19-
# Will only copy the symlink and not what it references, so we need to
20-
# manually copy what it references. This enables the script to work
19+
# will only copy the symlink and not what it references, so we need to
20+
# manually copy what it references. This enables the script to work
2121
# both in-repo and in-ci here.
2222
DO scripts+ADD_BASH_SCRIPTS
2323

@@ -31,4 +31,3 @@ SHELLCHECK:
3131
COPY --dir $src /src
3232

3333
RUN ./check-all.sh /src
34-

earthly/cassandra/Earthfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ CQL_TO_D2:
3434
ARG --required input
3535
ARG --required output
3636

37-
COPY (+cql-to-d2/diagrams --input=$input) $output
37+
COPY (+cql-to-d2/diagrams --input=$input) $output

earthly/cddl/Earthfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ cddl-base:
66
ARG REGISTRY="harbor.shared-services.projectcatalyst.io/dockerhub/library"
77
FROM ${REGISTRY}/ruby:3.3.0-alpine
88

9-
RUN gem install cddlc
9+
RUN gem install cddlc

earthly/cue/Earthfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ ARG --global CUE_IMAGE="harbor.shared-services.projectcatalyst.io/dockerhub/cuel
99
INSTALL:
1010
FUNCTION
1111

12-
COPY +cue-bin/cue /usr/bin/cue
13-
12+
COPY +cue-bin/cue /usr/bin/cue
1413

1514
# Get cue binary
1615
cue-bin:
@@ -23,4 +22,4 @@ check-cue:
2322

2423
DO +INSTALL
2524

26-
RUN cue version
25+
RUN cue version

earthly/debian/Earthfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
VERSION 0.8
22

33
# Define a constant name for the container and its version.
4-
ARG --global DEBIAN_IMAGE="harbor.shared-services.projectcatalyst.io/dockerhub/library/debian:13.0-slim"
4+
ARG --global DEBIAN_IMAGE="harbor.shared-services.projectcatalyst.io/dockerhub/library/debian:stable-slim"
55

66
# Optimally install packages for debian
77
INSTALL:
@@ -23,10 +23,10 @@ INSTALL:
2323
debian-clean:
2424
FROM $DEBIAN_IMAGE
2525

26-
2726
# The current version of our base Debian Container.
2827
# Normally you want this because it has all the common tools
2928
# one would expect inside CI.
29+
# gdebi-core is used to more easily manage dependency conflicts.
3030
common:
3131
FROM +debian-clean
3232

@@ -35,16 +35,15 @@ common:
3535
apt-utils \
3636
git \
3737
curl \
38-
gzip \
3938
unzip \
4039
bzip2 \
41-
bash \
4240
jq \
4341
gpg \
4442
lcov \
45-
tar \
4643
wget \
47-
xz-utils
44+
build-essential \
45+
xz-utils \
46+
gdebi-core
4847
DO +INSTALL --packages=$PACKAGES
4948

5049
# Checks our debian container is basically usable, and nothing more.

earthly/docs/Earthfile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ deps:
2727
liblcms2-dev \
2828
libopenjp2-7-dev \
2929
tk-dev \
30-
tcl-dev \
30+
tcl-dev \
3131
make
3232
DO debian+INSTALL --packages=$PACKAGES
3333

@@ -52,7 +52,6 @@ deps:
5252
# Set working directory
5353
WORKDIR /docs
5454

55-
5655
# Documentation files used across all documentation builds.
5756
common:
5857
FROM scratch
@@ -91,8 +90,7 @@ SRC:
9190
# Any files which replace the standard files are copied here
9291
COPY --if-exists --dir includes macros overrides .
9392

94-
95-
# Build the docs - We always do this in a `docs` target.
93+
# Build the docs - We always do this in a `docs` target.
9694
# The only target that needs customizing is the `src` target.
9795
BUILD:
9896
FUNCTION
@@ -133,8 +131,7 @@ PACKAGE:
133131
# These steps are done outside the FUNCTION.
134132

135133
# Copy the static pages into the container like this...
136-
#COPY $docs /usr/share/nginx/html
134+
# COPY $docs /usr/share/nginx/html
137135

138136
# And then save the image
139137
# SAVE IMAGE image_name
140-

0 commit comments

Comments
 (0)