-
Notifications
You must be signed in to change notification settings - Fork 0
/
Earthfile
42 lines (32 loc) · 1.56 KB
/
Earthfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
VERSION --build-auto-skip 0.8
PROJECT earthly-technologies/core
FROM alpine
IMPORT ../../common AS common
ARG --global OS_IMAGE=ubuntu
ARG --global OS_VERSION=24.04
# renovate: datasource=github-releases depName=docker/docker
LET docker_package_version=26.1.1
ARG --global DOCKER_VERSION=5:$docker_package_version-1~ubuntu.$OS_VERSION~noble
# DIR_PATH is set to that common targets can call os specific targets. It should match the directory name this Earthfile is located in
ARG --global DIR_PATH=$OS_IMAGE-$OS_VERSION
# release builds the image using a new datetime as a suffix and run tests against the pushed image, then finally retag and push the image without the datetime suffix
release:
RUN --no-cache date --utc +%Y%m%d%H%M%S > datetime
LET datetime="$(cat datetime)"
WAIT
BUILD --pass-args common+build-and-test --SUFFIX=$datetime
END
COPY --dir --pass-args common+get-image-info/image-info .
LET image_tag="$(cat image-info/tag)-$datetime"
BUILD --pass-args common+push-new-tag-multi-platform --TAG_WITH_DATE=$image_tag
# test-build will build a test image that is pushed to a temporary registry and run tests against it
test-build:
BUILD --pass-args common+build-and-test --IMAGE_NAME="dindtest"
# build builds an dind:alpine image
build:
BUILD --pass-args --platform=linux/amd64 --platform=linux/arm64 common+build
# test runs test for a dind:alpine image
# this is primarly used to run against a newly, temporariy image build by +test-build
test:
BUILD --pass-args common+ubuntu-kind-test
BUILD --pass-args common+test