[libvirt PATCH 2/3] cirrus: Add templates and refresh script

Daniel P. Berrangé berrange at redhat.com
Mon Jun 29 16:31:33 UTC 2020


On Mon, Jun 29, 2020 at 06:27:40PM +0200, Andrea Bolognani wrote:
> On Mon, 2020-06-29 at 15:32 +0100, Daniel P. Berrangé wrote:
> > On Mon, Jun 29, 2020 at 03:58:43PM +0200, Andrea Bolognani wrote:
> > > +for infile in templates/*
> > > +do
> > > +    outfile="${infile##*/}.j2"
> > > +    host="${outfile%%.*}"
> > > +
> > > +    eval $("$LCITOOL" dockerfile "libvirt-$host" libvirt --variables)
> > > +
> > > +    sed -e "s|[@]PKGS@|$PKGS|g" \
> > > +        -e "s|[@]CROSS_PKGS@|$CROSS_PKGS|g" \
> > > +        -e "s|[@]PYPI_PKGS@|$PYPI_PKGS|g" \
> > > +        -e "s|[@]CPAN_PKGS@|$CPAN_PKGS|g" \
> > > +        -e "s|[@]MAKE@|$MAKE|g" \
> > > +        -e "s|[@]NINJA@|$NINJA|g" \
> > > +        -e "s|[@]PYTHON@|$PYTHON|g" \
> > > +        <"$infile" >"$outfile"
> > > +done
> > 
> > I feel like this should really be reduced to just:
> > 
> >   $LCITOOL cirrusci libvirt-$host libvirt > $outfile
> > 
> > > +  build_script:
> > > +    - mkdir build
> > > +    - cd build
> > > +    - ../autogen.sh --prefix=$(pwd)/install-root
> > > +    - $MAKE -j3
> > > +    - $MAKE -j3 install
> > > +    - $MAKE -j3 dist
> > 
> > This part can then be stored in ci/cirrus/build.yml since it is
> > common to freebsd & macos.
> > 
> > So now in gitlab-ci.yml we can just concatenate the two into a
> > temp file:
> > 
> >    cat ci/cirrus/$NAME.yml ci/cirrus/build.yml >  ci/cirrus/$NAME.yml.j2
> >    cirrus-run ci/cirrus/$NAME.yml.j2
> > 
> > This avoids needing to store the same information in git twice.
> 
> Yeah, I don't like having to store the information twice in git, but
> I'm also not a fan of having an lcitool subcommand that is tightly
> coupled with the details of a specific CI service rather than dealing
> with the more general problem of managing build environments.

Hmm, I kind of feel that's exactly the job of lcitool. Generate whatever
files/resources we need for integrating with whatever CI infra we're
choosing to use.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




More information about the libvir-list mailing list