Skip to content

v0.8.0

Compare
Choose a tag to compare
@littleredcorvette littleredcorvette released this 22 Jan 19:03
c23e273

This version promotes a number of features that have been previously in Experimental and Beta status. To make use of
the features in this version you need to declare VERSION 0.8 at the top of your Earthfile.

Migrating from 0.7

If you are using Earthly 0.7, follow the following steps to migrate:

  1. If you are still using VERSION 0.5, upgrade those Earthfiles to VERSION 0.6 or VERSION 0.7.
  2. Upgrade your Earthly binary to 0.8 in CI and across your team. The Earthly 0.8 binary can run both VERSION 0.6 and VERSION 0.7 Earthfiles (but VERSION 0.5 support has been dropped).
  3. Once everyone is using the Earthly 0.8 binary, upgrade your Earthfiles one by one to VERSION 0.8. It is ok to have a mix of VERSION 0.6, VERSION 0.7 and VERSION 0.8 Earthfiles in the same project. Earthly handles that gracefully. See changes below for information on backwards incompatible changes when migrating from VERSION 0.7 to VERSION 0.8.

This process helps manage the backward breaking changes with minimal disruption.

Summary

Declaring VERSION 0.8 is equivalent to

VERSION \
  --arg-scope-and-set \
  --cache-persist-option \
  --git-refs \
  --global-cache \
  --no-network \
  --pass-args \
  --use-docker-ignore \
  --use-function-keyword \
  --use-visited-upfront-hash-collection \
  0.7

For more information on the individual Earthfile feature flags see the Earthfile version-specific features page.

It should be noted that some of these features break backwards compatibility. See below.

Changed

  • Redeclaring an ARG in the same scope as a previous declaration is now an error.
  • ARGs inside of targets will no longer have their default value overridden by global ARGs.
  • Declaring a CACHE ... in a target will no longer be copied to children targets when referenced via a FROM +...; to persist the contents of the cache, it is now required to use the CACHE --persist ... flag.
  • The COMMAND keyword has been renamed to FUNCTION.

Added

  • LET - Allows declaring a local variable. This command works similarly to ARG except that it cannot be overridden from the CLI. LET variables are allowed to shadow ARG variables, which allows you to promote an ARG to a local variable so that it may be used with SET.
  • SET - a new command that allows changing the value of variables declared with LET.
  • Outputting images from a remote runner has improved performance as it no longer transfers layers that are already present locally.
  • Auto-skip has been promoted to beta status.
  • RUN --network=none allows running a command without network access.
  • .dockerignore files are now used in FROM DOCKERFILE targets.
  • DO --pass-args, BUILD --pass-args etc allow passing all build arguments to external Earthfiles.
  • CACHE --id=... and RUN --mount type=cache,id=... allows setting a custom cache mount ID, thus allowing sharing cache mounts globally across different targets.
  • New satellite sizes: 2xlarge, 3xlarge, 4xlarge
  • New experimental wildcard-based builds, e.g. BUILD ./services/*+test which would call ./services/foo+test, and ./services/bar+test (assuming two services foo and bar, both having a test target in their respective Earthfile) #3582.

Removed

  • VERSION 0.5 is now obsolete. Declaring VERSION 0.5 is no longer supported, and will now raise an error.

Fixed

  • Parallelism is improved when running the same target with different arguments in certain cases (e.g. the target uses WITH DOCKER).
  • Fixed a log sharing upload-resumption bug
  • Fixed multiple issues with the lexer failing to parse certain characters in shell command substitution ($()) and single quoted strings.
    • Some escaped characters, like \#, were failing to parse when used inside shell expressions. Example: $(echo "a#b#c" | cut -f2 -d\#) #3475
    • Some characters, like #, were failing to parse when used inside single-quoted strings: Example: 'this is a # string' #1280
  • Fixed an issue where some escaped ARG shell expressions were being incorrectly preprocessed. Example: $(echo "\"") became $(echo """) #3131
  • The --pass-args feature was not passing active arguments which were set via a default value.
  • SAVE ARTIFACT --if-exists was not saving files based on a wildcard glob pattern. #1679
  • BUILD was not expanding --platform argument values.

Additional Info

  • This release includes changes to buildkit