Commit Graph

15 Commits

Author SHA1 Message Date
Ben Nemec
0eccd2808c Allow source-repositories to be disabled completely
In our official image builds we are only allowed to use resources
that are "blessed" by the build system.  This means that external
things like git repos and tar files are not allowed.  Currently,
even in offline mode source-repositories expects those things to
be available in the cache, so we need a way to disable it entirely.

This change adds an environment variable NO_SOURCE_REPOSITORIES
that does so.  It can be set in an environment.d script so elements
that might rely on a source repository will know it's not available.
The 02-lsb script in redhat-common is one such example and is
updated to handle this case.

Change-Id: I0de63bee6ad79733d6711478c707a9b41593e85f
2014-10-15 12:24:50 -04:00
Jonathan Brownell
6e4e2cfeca Increase source-repositories support for tarballs
The existing support for tar files in source-repositories saves
only the contents within subdirectories contained in the archive.

This change makes the selection of contents within the tarball user-
definable based on the REPOREF specified (or overridden in the env).

A REPOREF of '*' (the current default, but deprecated) will select
the contents of subdirectories within the archive, while '.' will
select the entire contents of the archive.

For reference:
http://lists.openstack.org/pipermail/openstack-dev/2014-August/043197.html
http://lists.openstack.org/pipermail/openstack-dev/2014-August/043249.html

Change-Id: I45db42ce66bf1d63d6ab5730090bf458b1b37ce9
2014-08-19 13:24:02 -07:00
Jenkins
ffdd57b8a5 Merge "Replace more then just "-" in REPONAME" 2014-03-11 12:51:31 +00:00
Jenkins
e83d4dcbb2 Merge "Bash eval the lines in source-repository scripts" 2014-03-10 18:55:06 +00:00
Derek Higgins
0226cf2246 Replace more then just "-" in REPONAME
Looks like shells only support alphanumeric characters and "_"'s in
environment variables. We were substituting "-" characters but in
order to be able to set overrides in projects with names containing
other characters we need to substitute more, I'm looking at you
oslo.config.

Change-Id: I3e2b1b0bc5871e4ec4ffd8117906cd077aa2cb0d
Co-authored-by: James Polley <jp@jamezpolley.com>
2014-03-06 04:56:50 +11:00
Gregory Haynes
6a6d913459 Bash eval the lines in source-repository scripts
This will allow us to add environment variables to source-repository
scripts. Useful for things like arch-specific download urls.

Change-Id: I4d046825a317dc88db3d7673ad261cedacd1a104
2014-03-03 16:37:43 -08:00
Jon-Paul Sullivan
0edfcf6587 Enable simple modification of git repo location
Add the DIB_GITREPOBASE variable to the source-repositories element
to enable global changing of git repository location.

Change-Id: Icfac5e103fce6e5a3f1a2db094144a0ed89fcc33
2014-02-26 13:52:03 +00:00
James Slagle
57ba300be4 Symlink correct element install type
The source-repositories element will now symlink the install scripts
corresponding to the set install type for an element into the install.d
directory.

Different install types are implemented by elements by writing scripts to do
the install type under install.d/<element-name>-<install-type>-install
directories.

For example, the nova element would provide:

nova/install.d/nova-package-install/74-nova
nova/install.d/nova-source-install/74-nova

source-repositories will create the following symlink for the package
install type:

$TMP_HOOKS_PATH/install.d/74-nova -> nova-package-install/74-nova

Or, for the source install type:

$TMP_HOOKS_PATH/install.d/74-nova -> nova-source-install/74-nova

Change-Id: I1bfaf39e5a98b2af904fbc6d674dbada30b27ed9
2014-01-15 14:57:08 -05:00
James Slagle
d253ed16d8 Add package support to source-repositories
Adds a new "package" type to source-repositories. When the package type
is specified in an origin-repository-* file the package name and type
"package" need to be specified like so:

nova package

The existing map-packages mechanism can be used to map the specified
package name to the actual distribution package names.  The
pre-configured package repositories on the image will be used to install
the packages during the install.d phase of the image build.

If the repo type is package, an environment.d hook script is updated
with an environment variable which is sourced by dib-run-parts. This is
so that other hooks, particularly in install.d, will know what repo type
was used and can make the correct decision about doing a source install
or not.

Change-Id: Ief4e524664cd32d2087aeb3b1766f05e017de91e
2014-01-13 08:23:53 -05:00
Chris Jones
4c7a3bf79f Improve source-repositories git caching.
We now unconditionally cache the repositories being fetched with
source-repositories.

Additionally, by improving the way we handle repository refs, we are now
able to build images with code taken directly from gerrit reviews.

Change-Id: Ifd4c5691f6761eb5551663e6d0aa1c0e42afced3
2013-12-20 14:48:30 +00:00
Mark McLoughlin
4f97b087d5 Fix typo in source-repositories README
Change-Id: Iaf5367099544fc5d4699140af642dfd392c7090f
2013-11-25 10:54:18 +00:00
Monty Taylor
5e3b5320e4 Remove github references
OpenStack runs git.openstack.org which is more reliable and responsive
when projects operate within OpenStack Infra. Replace all of the
references to github with referneces to git.openstack.org.

Change-Id: Ib3ece85aba6451801487b0bdbd83147e39d9e155
2013-09-18 08:17:10 -05:00
Robert Collins
c7c4ec19a3 Capture the repositories from source-repositories.
We try to expose metadata to users about what dib included in the
image and source-repositories was not doing that, so this fixes it. It
also permits easy introspection from other elements (such as an
upcoming PyPI cache layer).

Change-Id: I1e48e65f69ebe1f4556cc3bf35ccf195e99bcc76
2013-08-05 09:52:28 +12:00
Derek Higgins
195053108b Adding docs for the source-repositories element
Change-Id: I57244a5cc2f563b2e69eb49388c3c6b49202c9eb
2013-07-10 13:04:39 +01:00
Derek Higgins
ef2aa6e8a1 Adding element to get source for elements.
Fixes bug 1184943

Adding an element that allows other elements to register
repositories it would like to be retrieved for it.

Doing this outside of the chroot allows locally cached
repositories to be used. It also gives the ability to d-i-b
to specify what revision to use if an alternative to the
most recent is required.

Effectively allowing a CI system to test d-i-b and elements
without being effected by unavailable git repositories or
breakages in actively developed source code being used by
the elements.

Change-Id: I1527facebaad256a357af680e017b34b1788575d
2013-06-14 18:46:59 +01:00