Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ IMPORT ./earthly/cspell AS cspell-ci
IMPORT ./earthly/bash AS bash-ci
IMPORT ./earthly/spectral AS spectral-ci
IMPORT ./earthly/python AS python-ci
IMPORT ./earthly/debian AS debian

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

Expand All @@ -23,7 +24,8 @@ markdown-check-fix:

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

# check-spelling Check spelling in this repo inside a container.
Expand All @@ -32,7 +34,7 @@ check-spelling:

# check-bash - test all bash files lint properly according to shellcheck.
check-bash:
FROM ${REGISTRY}/alpine:3.20.3
# FROM ${REGISTRY}/alpine:3.20.3

DO bash-ci+SHELLCHECK --src=.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/guides/languages/flutter.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ In case you have unit tests in your project, you can run them with `unit-tests`
unit-tests:
FROM +builder

DO flutter-ci+UNIT_TEST
DO flutter-ci+UNIT_TESTS
```

### Build Flutter app for Web
Expand Down
4 changes: 2 additions & 2 deletions earthly/cue/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ARG --global CUE_IMAGE="harbor.shared-services.projectcatalyst.io/dockerhub/cuel
INSTALL:
FUNCTION

COPY +cue-bin/cue /usr/bin/cue
COPY +cue-bin/cue /usr/bin/cue


# Get cue binary
Expand All @@ -23,4 +23,4 @@ check-cue:

DO +INSTALL

RUN cue version
RUN cue version
6 changes: 2 additions & 4 deletions earthly/debian/Earthfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VERSION 0.8

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

# Optimally install packages for debian
INSTALL:
Expand Down Expand Up @@ -35,15 +35,13 @@ common:
apt-utils \
git \
curl \
gzip \
unzip \
bzip2 \
bash \
jq \
gpg \
lcov \
tar \
wget \
build-essential \
xz-utils
DO +INSTALL --packages=$PACKAGES

Expand Down
35 changes: 20 additions & 15 deletions earthly/flutter/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ VERSION 0.8
# cspell: words noninteractive

IMPORT ./installer AS installer
IMPORT ../debian AS debian

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

Expand Down Expand Up @@ -39,27 +40,30 @@ INSTALL_FLUTTER:

# flutter-base installs required tools and packages.
flutter-base:
FROM ${REGISTRY}/debian:bookworm-20250203-slim
# FROM ${REGISTRY}/debian:bookworm-20250203-slim
FROM debian+common

ENV DEBIAN_FRONTEND=noninteractive

# Update and install as same command so if either fails, the whole step fails and is not cached.
# sqlite3 and libsqlite3-dev are required for running db tests in CI
# RUN apt-get update --fix-missing && \
# apt-get install -y \
# apt-utils \
# git \
# curl \
# gzip \
# unzip \
# bzip2 \
# jq \
# gpg \
# lcov \
# wget \
# xz-utils \
# sqlite3 \
# libsqlite3-dev
RUN apt-get update --fix-missing && \
apt-get install -y \
apt-utils \
git \
curl \
gzip \
unzip \
bzip2 \
bash \
jq \
gpg \
lcov \
tar \
wget \
xz-utils \
sqlite3 \
libsqlite3-dev

Expand Down Expand Up @@ -142,7 +146,8 @@ FORMAT:
RUN melos run format-check
ELSE
RUN echo "Running flutter format"
RUN flutter format --set-exit-if-changed .
# RUN flutter format --set-exit-if-changed .
RUN dart format --output=none --set-exit-if-changed .
END

# Dry-runs the publish script for publishable packages.
Expand Down
98 changes: 60 additions & 38 deletions earthly/flutter/installer/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,51 @@ INSTALL_CHROME_LINUX64:
# You must provide it as ARG, e.g., `ARG TARGETARCH` in your function to use it.
# Read more about it here: https://docs.earthly.dev/docs/earthfile/builtin-args#platform-related-args
IF [ "$TARGETARCH" = "amd64" ]
# RUN printf "${BLUE} Installing Google Chrome..." \
# && curl -sSL -o /opt/chrome.zip "${BASE_URL}/chrome/chrome_amd64.zip" \
# && unzip /opt/chrome.zip -d /opt/chrome \
# && dpkg -i /opt/chrome/chrome_amd64/google-chrome-stable_current_amd64.deb || true \
# && dpkg -i /opt/chrome/chrome_amd64/*.deb || true \
# && echo "Check and fix missing dependencies..." \
# && apt-get update --fix-missing \
# && apt-get install -f -y \
# && rm -rf /opt/chrome.zip /opt/chrome
# RUN google-chrome --version
# DO +PATCH_CHROME --BIN_TO_PATCH="google-chrome"

# RUN printf "${BLUE} Installing Chromedriver..." \
# && mkdir -p /opt/chromedriver \
# && curl -L "${BASE_URL}/chrome/chromedriver-linux64.zip" \
# -o /opt/chromedriver/chromedriver.zip \
# && unzip -j /opt/chromedriver/chromedriver.zip -d /usr/local/bin/
# RUN chromedriver --version

RUN printf "${BLUE} Installing Google Chrome..." \
&& curl -sSL -o /opt/chrome.zip "${BASE_URL}/chrome/chrome_amd64.zip" \
&& unzip /opt/chrome.zip -d /opt/chrome \
&& dpkg -i /opt/chrome/chrome_amd64/google-chrome-stable_current_amd64.deb || true \
&& dpkg -i /opt/chrome/chrome_amd64/*.deb || true \
&& curl -sSL -o /opt/chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
&& dpkg -i /opt/chrome.deb || true \
&& echo "Check and fix missing dependencies..." \
&& apt-get update --fix-missing \
&& apt-get install -f -y \
&& rm -rf /opt/chrome.zip /opt/chrome
&& apt-get install -f -y \
&& rm -rf /opt/chrome.deb
RUN google-chrome --version
DO +PATCH_CHROME --BIN_TO_PATCH="google-chrome"

RUN printf "${BLUE} Installing Chromedriver..." \
&& mkdir -p /opt/chromedriver \
&& curl -L "${BASE_URL}/chrome/chromedriver-linux64.zip" \
&& CHROME_VERSION=$(google-chrome --version | cut -d' ' -f3) \
&& curl -L "https://storage.googleapis.com/chrome-for-testing-public/${CHROME_VERSION}/linux64/chromedriver-linux64.zip" \
-o /opt/chromedriver/chromedriver.zip \
&& unzip -j /opt/chromedriver/chromedriver.zip -d /usr/local/bin/
RUN chromedriver --version

ELSE
DO +INSTALL_CHROMIUM --PACKAGE_TYPE="chromium" --DOWNLOAD_URL="${BASE_URL}/chrome/chromium.zip"
# DO +INSTALL_CHROMIUM --PACKAGE_TYPE="chromium" --DOWNLOAD_URL="${BASE_URL}/chrome/chromium.zip"
RUN apt-get update --fix-missing \
&& apt-get install -y chromium chromium-driver
RUN chromium --version
DO +PATCH_CHROME --BIN_TO_PATCH="chromium"

DO +INSTALL_CHROMIUM --PACKAGE_TYPE="chromium-driver" --DOWNLOAD_URL="${BASE_URL}/chrome/chromium-driver.zip"
# DO +INSTALL_CHROMIUM --PACKAGE_TYPE="chromium-driver" --DOWNLOAD_URL="${BASE_URL}/chrome/chromium-driver.zip"
RUN chromedriver --version
END

Expand All @@ -68,16 +88,18 @@ INSTALL_FIREFOX_LINUX64:

IF [ "$TARGETARCH" = "amd64" ]
SET PLATFORM = "linux64"
LET FIREFOX_URL = "${BASE_URL}/firefox/firefox-esr_115.15.0esr-1~deb12u1_amd64.deb"
# LET FIREFOX_URL = "${BASE_URL}/firefox/firefox-esr_115.15.0esr-1~deb12u1_amd64.deb"
ELSE
SET PLATFORM = "linux-aarch64"
LET FIREFOX_URL = "${BASE_URL}/firefox/firefox-esr_115.15.0esr-1~deb12u1_arm64.deb"
# LET FIREFOX_URL = "${BASE_URL}/firefox/firefox-esr_115.15.0esr-1~deb12u1_arm64.deb"
END

RUN curl -L ${FIREFOX_URL} -o /tmp/firefox.deb \
&& apt-get update --fix-missing \
&& apt-get --fix-broken install -y /tmp/firefox.deb \
&& rm /tmp/firefox.deb
# RUN curl -L ${FIREFOX_URL} -o /tmp/firefox.deb \
# && apt-get update --fix-missing \
# && apt-get --fix-broken install -y /tmp/firefox.deb \
# && rm /tmp/firefox.deb
RUN apt-get update --fix-missing \
&& apt-get --fix-broken install -y firefox-esr

RUN firefox --version

Expand Down Expand Up @@ -118,29 +140,29 @@ INSTALL_EDGE_LINUX64:
END

# Installs the Chromium or Chromium driver.
INSTALL_CHROMIUM:
FUNCTION

ARG --required PACKAGE_TYPE
ARG --required DOWNLOAD_URL
LET BLUE='\033[0;34m'

RUN printf "${BLUE} Installing the latest ${PACKAGE_TYPE} version...\n" \
&& echo "Downloading ${PACKAGE_TYPE} and dependencies from: ${DOWNLOAD_URL}" \
&& curl -sSL -o /opt/${PACKAGE_TYPE}.zip ${DOWNLOAD_URL} \
&& echo "Downloaded file information:" \
&& ls -lh /opt/${PACKAGE_TYPE}.zip \
&& echo "Unzipping ${PACKAGE_TYPE} packages..." \
&& unzip /opt/${PACKAGE_TYPE}.zip -d /opt/${PACKAGE_TYPE} \
&& echo "Contents of /opt/${PACKAGE_TYPE} after unzipping:" \
&& ls -lh /opt/${PACKAGE_TYPE}/${PACKAGE_TYPE} \
&& echo "Installing ${PACKAGE_TYPE} and dependencies..." \
&& dpkg -i /opt/${PACKAGE_TYPE}/${PACKAGE_TYPE}/*.deb || true \
&& echo "Checking for missing dependencies..." \
&& echo "Cleaning up..." \
&& rm /opt/${PACKAGE_TYPE}.zip \
&& rm -r /opt/${PACKAGE_TYPE} \
&& echo "${PACKAGE_TYPE} installation completed."
# INSTALL_CHROMIUM:
# FUNCTION

# ARG --required PACKAGE_TYPE
# ARG --required DOWNLOAD_URL
# LET BLUE='\033[0;34m'

# RUN printf "${BLUE} Installing the latest ${PACKAGE_TYPE} version...\n" \
# && echo "Downloading ${PACKAGE_TYPE} and dependencies from: ${DOWNLOAD_URL}" \
# && curl -sSL -o /opt/${PACKAGE_TYPE}.zip ${DOWNLOAD_URL} \
# && echo "Downloaded file information:" \
# && ls -lh /opt/${PACKAGE_TYPE}.zip \
# && echo "Unzipping ${PACKAGE_TYPE} packages..." \
# && unzip /opt/${PACKAGE_TYPE}.zip -d /opt/${PACKAGE_TYPE} \
# && echo "Contents of /opt/${PACKAGE_TYPE} after unzipping:" \
# && ls -lh /opt/${PACKAGE_TYPE}/${PACKAGE_TYPE} \
# && echo "Installing ${PACKAGE_TYPE} and dependencies..." \
# && dpkg -i /opt/${PACKAGE_TYPE}/${PACKAGE_TYPE}/*.deb || true \
# && echo "Checking for missing dependencies..." \
# && echo "Cleaning up..." \
# && rm /opt/${PACKAGE_TYPE}.zip \
# && rm -r /opt/${PACKAGE_TYPE} \
# && echo "${PACKAGE_TYPE} installation completed."

PATCH_CHROME:
FUNCTION
Expand Down
23 changes: 12 additions & 11 deletions earthly/flutter_rust_bridge/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,26 @@ VERSION 0.8

IMPORT ../flutter AS flutter-ci
IMPORT ../rust AS rust-ci
IMPORT ../debian AS debian

# This will be refactored in the future
# TODO(bkioshn): https://github.com/input-output-hk/catalyst-ci/issues/322
# builder: Setup necessary tools for `flutter_rust_bridge`
builder:
FROM harbor.shared-services.projectcatalyst.io/dockerhub/library/debian:stable-slim
# FROM harbor.shared-services.projectcatalyst.io/dockerhub/library/debian:stable-slim
FROM debian+common

WORKDIR /work

RUN apt-get update \
&& apt-get install -y \
apt-utils \
wget \
tar \
xz-utils \
git \
build-essential \
curl \
unzip
# RUN apt-get update \
# && apt-get install -y \
# apt-utils \
# wget \
# xz-utils \
# git \
# build-essential \
# curl \
# unzip

DO flutter-ci+INSTALL_FLUTTER
DO rust-ci+INSTALL_RUST
Expand Down
6 changes: 4 additions & 2 deletions earthly/go/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ GO_WASM_TOOL:

# Install tinygo
LET path = "https://github.com/tinygo-org/tinygo/releases/download/v${tinygo_version}/tinygo_${tinygo_version}_${TARGETARCH}.deb"
RUN wget $path
RUN dpkg -i tinygo_${tinygo_version}_${TARGETARCH}.deb
# RUN wget $path
# RUN dpkg -i tinygo_${tinygo_version}_${TARGETARCH}.deb

RUN wget $path && dpkg -i tinygo_${tinygo_version}_${TARGETARCH}.deb

# Install go tools needed for go WASM binding
go-wasm-builder:
Expand Down
6 changes: 3 additions & 3 deletions earthly/mdlint/Earthfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
VERSION 0.8

ARG --global IMAGE="harbor.shared-services.projectcatalyst.io/dockerhub/davidanson/markdownlint-cli2-rules:v0.14.0"
# cspell: words markdownlint

MDLINT_LOCALLY:
Expand Down Expand Up @@ -35,7 +36,7 @@ MDLINT_LOCALLY:
RUN docker run \
--rm \
-v $src:/workdir \
davidanson/markdownlint-cli2-rules:v0.14.0 \
$IMAGE \
"**/*.md" \
--config $cfg_file \
$fix
Expand All @@ -60,9 +61,8 @@ CHECK:

# Unlikely this ever needs to be changed.
ARG cfg_file=.markdownlint-cli2.jsonc
ARG REGISTRY="harbor.shared-services.projectcatalyst.io/dockerhub"

FROM ${REGISTRY}/davidanson/markdownlint-cli2-rules:v0.14.0
FROM $IMAGE

# Status line for what we are about to do.
RUN echo Linting Markdown Recursively from: $src
Expand Down
2 changes: 1 addition & 1 deletion earthly/playwright/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SETUP:
FROM mcr.microsoft.com/playwright:v1.48.0-noble
WORKDIR $workdir

RUN apt-get update --fix-missing && apt-get install -y apt-utils curl unzip
RUN apt-get update --fix-missing && apt-get install -y apt-utils unzip

DO flutter-installer+INSTALL_CHROME_LINUX64

Expand Down
9 changes: 6 additions & 3 deletions earthly/postgresql/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ VERSION 0.8
IMPORT ../rust/tools AS rust-tools
IMPORT ../../utilities/scripts AS scripts
IMPORT ../java AS java
IMPORT ../graphviz AS graphviz

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

Expand Down Expand Up @@ -101,9 +102,11 @@ DOCS:

FROM +postgres-base

RUN apt-get update && apt-get install -y \
graphviz \
wget
# RUN apt-get update && apt-get install -y \
# graphviz \
# wget

DO graphviz+INSTALL

# Use the cached java installation from the java Earthfile
DO java+COPY_DEPS
Expand Down
Loading
Loading