[6.0] aa16600c9 Make CircleCI script download dist tarball
Dridi Boukelmoune
dridi at varni.sh
Fri Nov 6 10:41:50 UTC 2020
On Fri, Nov 6, 2020 at 10:32 AM Martin Blix Grydeland
<martin at varnish-software.com> wrote:
>
>
> commit aa16600c90a7f1be0a115df27d8db58ec06310d0
> Author: Martin Blix Grydeland <martin at varnish-software.com>
> Date: Fri Sep 25 15:37:27 2020 +0200
>
> Make CircleCI script download dist tarball
>
> If given a build parameter called 'dist-url', the build script downloads
> a tarball from the given URL instead of doing a 'make dist' step.
>
> diff --git a/.circleci/config.yml b/.circleci/config.yml
> index 726d789db..571b7703f 100644
> --- a/.circleci/config.yml
> +++ b/.circleci/config.yml
> @@ -13,6 +13,10 @@ parameters:
> pkg-commit:
> type: string
> default: ""
> + dist-url:
> + type: string
> + default: ""
> +
> jobs:
> dist:
> description: Builds varnish-x.y.z.tar.gz that is used later for the packaging jobs
> @@ -33,19 +37,36 @@ jobs:
> make \
> pcre-devel \
> python \
> - python-sphinx
> + python-sphinx \
> + curl
> - checkout
> - - run:
> - name: Create the dist tarball
> - command: |
> - git checkout << pipeline.parameters.vc-commit >>
> - # if version is "trunk", it's a weekly tarball, override the version
> - if grep 'AC_INIT.*trunk.*' ./configure.ac; then
> - sed -i -e "s/^AC_INIT.*trunk.*/AC_INIT([Varnish], [$(date +%Y%m%d)], [varnish-dev at varnish-cache.org])/" ./configure.ac
> - touch .is_weekly
> - fi
> - ./autogen.des --quiet
> - make dist -j 16
> + - when:
> + condition: << pipeline.parameters.dist-url >>
> + steps:
> + - run:
> + name: Download the dist tarball
> + command: |
> + curl -s << pipeline.parameters.dist-url >> -o varnish-dist.tar.gz
> + mkdir parse-version-tmp
> + cd parse-version-tmp
> + tar xzf ../varnish-dist.tar.gz
> + VERSION=$(varnish-*/configure --version | awk 'NR == 1 {print $NF}')
> + cd ..
> + mv varnish-dist.tar.gz varnish-${VERSION}.tar.gz
> + - unless:
> + condition: << pipeline.parameters.dist-url >>
> + steps:
> + - run:
> + name: Create the dist tarball
> + command: |
> + git checkout << pipeline.parameters.vc-commit >>
> + # if version is "trunk", it's a weekly tarball, override the version
> + if grep 'AC_INIT.*trunk.*' ./configure.ac; then
> + sed -i -e "s/^AC_INIT.*trunk.*/AC_INIT([Varnish], [$(date +%Y%m%d)], [varnish-dev at varnish-cache.org])/" ./configure.ac
> + touch .is_weekly
> + fi
First of all, why not grab the version like several lines above, by
running ./configure --version instead of a hazardous grep?
Second, on a stable branch, we can get rid of the whole weekly check.
> + ./autogen.des --quiet
> + make dist -j 16
> - persist_to_workspace:
> root: .
> paths:
> _______________________________________________
> varnish-commit mailing list
> varnish-commit at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit
More information about the varnish-commit
mailing list