Commit graph

31 commits

Author SHA1 Message Date
19b9ecc797 BuildSourceImage: use umoci for OCI layout, if present
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2019-09-26 12:20:46 -04:00
9726e11de5
BuildSourceImage: bump the version
Fixes #36

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2019-09-21 01:35:53 -04:00
a8df221421
BuildSourceImage: fail early if mkdir fails
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2019-09-19 05:26:27 -04:00
cdd9e3aaef
*: clarify output directory written
Also, SRC_DIR is no longer used.

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2019-09-18 09:18:37 -04:00
Valentin Rothberg
b26fada584 exit 0 on -h
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-09-11 16:25:47 +02:00
Valentin Rothberg
fc84cfdace
Merge pull request #18 from vbatts/clearer_driver_log
BuildSourceImage: group the driver log
2019-09-11 11:10:21 +02:00
513a7fd6f7
BuildSourceImage: remove cruft from the rebase during rewrite
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2019-09-10 11:12:14 -04:00
29899c15f5
BuildSourceImage: group the driver log
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2019-09-10 10:19:38 -04:00
9fabac2890
BuildSourceImage: bail with information, if not inputs are provided
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2019-09-10 09:35:00 -04:00
84b889e1ad
BuildSourceImage: version flag
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2019-09-10 09:18:43 -04:00
433272896f
BuildSourceImage: switch to -s for SRPMs
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2019-09-10 09:10:56 -04:00
088e55ee76
*: more review updates from VR
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2019-09-10 09:08:44 -04:00
e6ca9482c8
BuildSourceImage: flipped condition!
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2019-09-10 09:08:39 -04:00
9f68658629
BuildSourceImage: changes for VR's review
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2019-09-10 09:08:37 -04:00
a4444e2e90
BuildSourceImage: lint cleanup reported by shellcheck -a
more info at https://www.shellcheck.net/wiki/

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2019-09-10 09:08:35 -04:00
89bfe5bf20
BuildSourceImage: basic function of pushing the image afterward
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2019-09-10 09:08:31 -04:00
9078c53d4c
BuildSourceImage: ensure that build from only SRPMS works
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2019-09-10 09:08:29 -04:00
adcad3d78a
BuildSourceImage: looks like golang ts of RFC 3339 is special
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2019-09-10 09:08:27 -04:00
977a003d16
*: tying it all together
this makes everything a flag now. This is not 100%

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2019-09-10 09:08:25 -04:00
b7e49bc1c6
awk: don't print the newline. Removes the need for a tr
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2019-09-10 09:08:23 -04:00
0d103e778f
BuildSourceImage: readying for the koji use case
for koji, there will be no fetching of the image, nor fetching of RPMS
using `dnf download --source ...`. They'll just provide a directory of
SRPMS used (perhaps as a composite of architectures). And just add these
in similar fashion as when fetching.

This used with the flag to specify which drivers to run will allow
tailoring to just that use-case.

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2019-09-10 09:08:21 -04:00
56fd7c4de9
*: big rewrite
_(this is a WIP)_

for the requirements to not be so bound to RPM only, breaking collection
of sources out into "plugins". Currently not much more sophisticated
than just iterating through bash functions that expect 3 argugments.
rootfs of the inspectee; output path for the sources collected; manifest
path.
The idea for the manifest is still loose, but how best to follow up the
plugin which collected source, to then have the rich metadata available
to attach to the individual "layers" that are produced for each source
component.

for the requirement of most contrained non-root container running this
script as non-root, we'll switch away from buildah for now. This ought
to just be skopeo copy, unpacking, inspecting, json, and skopeo copy. No
mounting, no namespacing, etc.

for the sake of writing unit tests (i.e. `bats`), break the script into
a way that it can be sourced and run the functions individually. Only
act like the whole script when run directly.

If `umoci` is available it will get used for some functions (like
unpacking), but it is not required and will be attempted with jq and
bash otherwise.

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2019-09-10 09:08:19 -04:00
f5db5f704f
Dockerfile and export image if OUTPUT_DIR
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2019-09-10 09:08:12 -04:00
Daniel J Walsh
22a20a5e28
Merge pull request #9 from vbatts/errout
exit on errors
2019-08-15 06:36:41 -04:00
26f5cce2a0
exit on errors
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2019-08-14 10:12:35 -04:00
311730a347
clearer variable name than "i"
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2019-08-14 08:10:49 -04:00
Nalin Dahyabhai
cff4c01971 Correct quoting, histories
Before doing anything, ensure that we have at least two arguments.
Correct misuse of $() when ${} was intended, to reference environment
variables.
Use `buildah config --created-by` rather than `--add-history` to set the
CreatedBy field when committing new images, so that they only add one
history entry.
Set timestamps on .src.rpm files to their build date, rather than 0.
Commit new images using --omit-timestamp, to make their own timestamps
predictable.
Only name the final image.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2019-07-31 19:25:46 -04:00
Daniel J Walsh
785ad324cb
Do not compress source code images
Source code rpms are already compressed, so no reason
to compress for a seecond time.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-07-22 06:38:23 -04:00
Daniel J Walsh
740a3b60fa
Fixes to make the images sharable
Changing the time on all SRC RPMS to EPOCH So the images will always have
the same date on them.  This prevents us from getting variance and allows the
blobs to be shared.

Also now commit each layer and start a new container based on the previous

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-07-16 09:50:48 -04:00
Jindrich Novy
239362b8d0 Filter out all gpg-pubkey entries from rpmdb as these are not RPMs. 2019-07-15 10:53:50 +02:00
Daniel J Walsh
67d628b22a
Initial Version
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-07-12 14:47:11 -04:00