Warning, /frameworks/syntax-highlighting/autotests/input/Earthfile is written in an unsupported language. File is not indexed.
0001 # kate: hl earthfile;
0002
0003 VERSION --shell-out-anywhere 0.6
0004
0005 # BEGIN Global parameters
0006 ARG DEVTOOLSET_VERSION = 11
0007 ARG DEVTOOLSET = devtoolset-${DEVTOOLSET_VERSION}
0008 # END Global parameters
0009
0010 ARG param_1 = "String w/ variable interpolation ${DEVTOOLSET}"
0011 ARG param_2 = 'String w/o variable interpolation ${DEVTOOLSET}'
0012 # Run shell command
0013 ARG param_3 = $(echo "String w/ variable interpolation ${DEVTOOLSET}")
0014
0015 sample-target:
0016 FROM alpine
0017 ARG stage
0018 COPY --if-exists files/${stage}/ /files/
0019 SAVE ARTIFACT --keep-ts /files /share
0020
0021 repos-conf-apt:
0022 ARG image
0023 ARG ppa
0024
0025 FROM ${image}
0026
0027 ENV DEBIAN_FRONTEND=noninteractive
0028 ENV DEBCONF_NONINTERACTIVE_SEEN=true
0029
0030 IF [ "${ppa}" != '' ]
0031 ARG _more_cmds = add-apt-repository -y -n ppa:${ppa}/ppa
0032 ELSE
0033 ARG _more_cmds = :
0034 END
0035
0036 RUN --mount type=secret,id=+secrets/repo_gpg_key,target=/run/secrets/private-archive-keyring.gpg \
0037 --mount type=cache,target=/var/cache/apt/archives \
0038 --mount type=cache,target=/var/lib/apt/lists \
0039 set -x; \
0040 debconf-set-selections /tmp/debconf-preset.txt \
0041 && rm -rf /etc/apt/apt.conf.d/docker-clean \
0042 && apt-get update \
0043 && apt-get install -y software-properties-common \
0044 && add-apt-repository --remove multiverse \
0045 && gpg -v --dearmor - </run/secrets/private-archive-keyring.gpg > /usr/share/keyrings/private-archive-keyring.gpg \
0046 && ${_more_cmds}
0047
0048 SAVE ARTIFACT /etc/apt/sources.list /sources.list
0049 SAVE ARTIFACT /usr/share/keyrings/private-archive-keyring.gpg /private-archive-keyring.gpg
0050
0051 IF [ "${ppa}" != '' ]
0052 SAVE ARTIFACT /etc/apt/sources.list.d/${ppa}*.list /sources.list.d
0053 SAVE ARTIFACT /etc/apt/trusted.gpg.d/${ppa}*.gpg /trusted.gpg.d
0054 END
0055
0056
0057 APT_INSTALL:
0058 COMMAND
0059
0060 ARG image
0061 ARG packages = ''
0062 ARG packages_on_hold = ''
0063 ARG upgrade = 0
0064 ARG clean = 0
0065 ARG pm_aux_options = ''
0066 ARG more_rm_files = ''
0067 ARG more_cmds = :
0068
0069 IF [ ! -f /root/debconf-preset.txt ]
0070 COPY (+repos-conf-apt/debconf-preset.txt --image=${image}) /root/debconf-preset.txt
0071 ARG _debconf_cmd_cond = debconf-set-selections /root/debconf-preset.txt
0072 ELSE
0073 ARG _debconf_cmd_cond = :
0074 END
0075
0076 IF [ ! -f /usr/share/keyrings/private-archive-keyring.gpg ]
0077 COPY (+repos-conf-apt/private-archive-keyring.gpg --image=${image}) \
0078 /usr/share/keyrings/private-archive-keyring.gpg
0079 # NOTE Also copy the `sources.list` file with `multiverse` disabled!
0080 COPY (+repos-conf-apt/sources.list --image=${image}) /etc/apt
0081 END
0082
0083 # ...
0084
0085 MAKE_PYTHON_CI_IMAGE:
0086 COMMAND
0087
0088 ARG image
0089 ARG python = python3
0090 ARG python_pkg = ${python}
0091 ARG python_bin = ${python}
0092 ARG python_ver = 3.11
0093
0094 DO +APT_INSTALL --packages="${python_pkg} git"
0095
0096 ARG _chroot_base = $(dirname $(cat /etc/debian_chroot))
0097
0098 DO ./share+IMAGE_INIT \
0099 --image_description="CI image for Python projects" \
0100 --debian_chroot=${_chroot_base}/python/${python_ver}/ci \
0101 --storage_name=none
0102
0103 COPY --dir (+prep-python-ci/local --image=${image}) /usr
0104
0105 ENV SETUPTOOLS_USE_DISTUTILS='stdlib'
0106 ENV PIP_DISABLE_PIP_VERSION_CHECK=1
0107
0108
0109 all:
0110 LOCALLY
0111
0112 # Primary images
0113 BUILD +ci
0114 BUILD +clang-ci
0115 BUILD +python-ci
0116
0117 IF [ "${BUILD_TESTING}" -gt 0 ]
0118 # Also include all tests
0119 BUILD +tests
0120 END
0121
0122 tests:
0123 LOCALLY
0124
0125 BUILD +ci-tests
0126 BUILD +clang-ci-tests
0127 BUILD +python-ci-tests
0128
0129 ci-tests:
0130 FROM +ci
0131 COPY .env /
0132 DO share+RUN_TESTS --VERBOSE=${VERBOSE}
0133
0134 clang-ci-tests:
0135 FROM +clang-ci
0136 COPY .env /
0137 ENV EXPECT_CLANG_VERSION=${CLANG_VERSION}
0138 DO share+RUN_TESTS --VERBOSE=${VERBOSE} --script=ci-tests.sh
0139
0140 python-ci-tests:
0141 FROM +python-ci
0142 COPY .env /
0143 DO share+RUN_TESTS --VERBOSE=${VERBOSE}