Commit d3b60b06 authored by Martin Blix Grydeland's avatar Martin Blix Grydeland

Adjust CircleCI config to be compatible with release branches

Add the necessary bits to the master CCI configuration to make the package
building parts also work in the release branches. This way there is no
need to tailor the release branches' CCI setup on release day.

This should not (famous last words) change how the weekly packages from
the master branch are generated.
parent 45cd6f62
...@@ -7,6 +7,12 @@ parameters: ...@@ -7,6 +7,12 @@ parameters:
pkg-commit: pkg-commit:
type: string type: string
default: "master" default: "master"
dist-url:
type: string
default: ""
dist-url-sha256:
type: string
default: ""
configure_args: configure_args:
type: string type: string
default: | default: |
...@@ -17,7 +23,7 @@ parameters: ...@@ -17,7 +23,7 @@ parameters:
--with-persistent-storage \ --with-persistent-storage \
jobs: jobs:
dist: dist:
description: Builds varnish-x.y.z.tar.gz that is used later for the packaging jobs description: Build or download varnish-x.y.z.tar.gz that is used later for the packaging jobs
docker: docker:
- image: centos:7 - image: centos:7
steps: steps:
...@@ -37,14 +43,43 @@ jobs: ...@@ -37,14 +43,43 @@ jobs:
python3 \ python3 \
python-sphinx python-sphinx
- checkout - checkout
- 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
- when:
condition: << pipeline.parameters.dist-url-sha256 >>
steps:
- run:
name: Verify downloaded tarball
command: |
echo "<< pipeline.parameters.dist-url-sha256 >> varnish-dist.tar.gz" | sha256sum -c
- run:
name: Rename the dist tarball by parsed version
command: |
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 -v varnish-dist.tar.gz varnish-${VERSION}.tar.gz
- unless:
condition: << pipeline.parameters.dist-url >>
steps:
- run: - run:
name: Create the dist tarball name: Create the dist tarball
command: | command: |
git checkout << pipeline.parameters.vc-commit >> git checkout << pipeline.parameters.vc-commit >>
# if version is "trunk", it's a weekly tarball, override the version # Locally built tarballs are always built with weekly in package name
if grep 'AC_INIT.*trunk.*' ./configure.ac; then
sed -i -e "s/^AC_INIT.*trunk.*/AC_INIT([Varnish], [$(date +%Y%m%d)], [varnish-dev@varnish-cache.org])/" ./configure.ac
touch .is_weekly touch .is_weekly
# If version is "trunk", override version to add date
if grep 'AC_INIT.*trunk.*' ./configure.ac; then
sed -e "s/AC_INIT(\[\(.*\)\], \[\(.*\)\], \[\(.*\)\])/AC_INIT([\1], [$(date +%Y%m%d)], [\3])/" ./configure.ac
else
sed -e "s/AC_INIT(\[\(.*\)\], \[\(.*\)\], \[\(.*\)\])/AC_INIT([\1], [\2-$(date +%Y%m%d)], [\3])/" ./configure.ac
fi fi
./autogen.des --quiet ./autogen.des --quiet
make dist -j 16 make dist -j 16
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment