Warning, /frameworks/syntax-highlighting/autotests/folding/Earthfile.fold is written in an unsupported language. File is not indexed.

0001 # kate: hl earthfile;
0002 
0003 VERSION --shell-out-anywhere 0.6
0004 
0005 # <beginfold id='1'>BEGIN</beginfold id='1'> Global parameters
0006 ARG DEVTOOLSET_VERSION = 11
0007 ARG DEVTOOLSET = devtoolset-${DEVTOOLSET_VERSION}
0008 # <endfold id='1'>END</endfold id='1'> 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 <endfold id='2'></endfold id='2'><beginfold id='2'>sample-target:</beginfold id='2'>
0016     FROM alpine
0017     ARG stage
0018     COPY --if-exists files/${stage}/ /files/
0019     SAVE ARTIFACT --keep-ts /files /share
0020 
0021 <endfold id='2'></endfold id='2'><beginfold id='2'>repos-conf-apt:</beginfold id='2'>
0022     ARG image
0023     ARG ppa
0024 
0025     FROM ${image}
0026 
0027     ENV DEBIAN_FRONTEND=noninteractive
0028     ENV DEBCONF_NONINTERACTIVE_SEEN=true
0029 
0030     <beginfold id='3'>IF</beginfold id='3'> [ "${ppa}" != '' ]
0031         ARG _more_cmds = add-apt-repository -y -n ppa:${ppa}/ppa
0032     ELSE
0033         ARG _more_cmds = :
0034     <endfold id='3'>END</endfold id='3'>
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     <beginfold id='3'>IF</beginfold id='3'> [ "${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     <endfold id='3'>END</endfold id='3'>
0055 
0056 
0057 <endfold id='2'></endfold id='2'><beginfold id='2'>APT_INSTALL:</beginfold id='2'>
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     <beginfold id='3'>IF</beginfold id='3'> [ ! -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     <endfold id='3'>END</endfold id='3'>
0075 
0076     <beginfold id='3'>IF</beginfold id='3'> [ ! -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     <endfold id='3'>END</endfold id='3'>
0082 
0083     # ...
0084 
0085 <endfold id='2'></endfold id='2'><beginfold id='2'>MAKE_PYTHON_CI_IMAGE:</beginfold id='2'>
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 <beginfold id='4'>$(</beginfold id='4'>cat /etc/debian_chroot<endfold id='4'>)</endfold id='4'>)
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 <endfold id='2'></endfold id='2'><beginfold id='2'>all:</beginfold id='2'>
0110     LOCALLY
0111 
0112     # Primary images
0113     BUILD +ci
0114     BUILD +clang-ci
0115     BUILD +python-ci
0116 
0117     <beginfold id='3'>IF</beginfold id='3'> [ "${BUILD_TESTING}" -gt 0 ]
0118         # Also include all tests
0119         BUILD +tests
0120     <endfold id='3'>END</endfold id='3'>
0121 
0122 <endfold id='2'></endfold id='2'><beginfold id='2'>tests:</beginfold id='2'>
0123     LOCALLY
0124 
0125     BUILD +ci-tests
0126     BUILD +clang-ci-tests
0127     BUILD +python-ci-tests
0128 
0129 <endfold id='2'></endfold id='2'><beginfold id='2'>ci-tests:</beginfold id='2'>
0130     FROM +ci
0131     COPY .env /
0132     DO share+RUN_TESTS --VERBOSE=${VERBOSE}
0133 
0134 <endfold id='2'></endfold id='2'><beginfold id='2'>clang-ci-tests:</beginfold id='2'>
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 <endfold id='2'></endfold id='2'><beginfold id='2'>python-ci-tests:</beginfold id='2'>
0141     FROM +python-ci
0142     COPY .env /
0143     DO share+RUN_TESTS --VERBOSE=${VERBOSE}