Commit graph

875 commits

Author SHA1 Message Date
Steve Kuznetsov
287f9dccdb
Update the MANIFEST.in
No `README.mkd` file exists, but `README.md` does. No files ending in
`.5` exist, but some manpages that end in `.5.asciidoc` do.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-26 14:26:02 -05:00
Steve Kuznetsov
e41712706f
Correctly pass verbosity options through the builder CLI
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-26 14:26:01 -05:00
Steve Kuznetsov
4716654c7c
Use correct print-formatting directive in debugging
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-26 14:26:01 -05:00
Steve Kuznetsov
efab80283d Merge pull request #250 from stevekuznetsov/skuznets/fix-rawhide-tests
Work around `dnf` issues and install builddep for Rawhide
2017-01-26 13:39:39 -05:00
Devan Goodwin
1753549a74 Merge pull request #266 from stevekuznetsov/skuznets/travis
Add a Travis CI manifest
2017-01-26 11:10:08 -04:00
Devan Goodwin
77919a9912 Merge pull request #264 from stevekuznetsov/skuznets/build-verbosity
Added `--quiet` and `--verbose` to `tito build`
2017-01-26 11:00:39 -04:00
Steve Kuznetsov
95a6f1352b
Use .format() string formatting correctly in Builder
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-26 09:57:47 -05:00
Steve Kuznetsov
e8297aa5be
Refactor rpmbuild invocation for readability
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-26 09:57:47 -05:00
Steve Kuznetsov
db654d1437
Added --quiet and --verbose to tito build
The current output levels from `tito build` are both very verbose in the
case that nothing goes wrong and often missing full context when some-
thing does go wrong. By exposing `--quiet` and `--verbose`, the build
process should be able to modulate the amount of output coming from the
internal process and from `rpmbuild`.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-26 09:57:47 -05:00
Steve Kuznetsov
0ebcf99443
Add a Travis CI manifest
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-26 09:56:15 -05:00
Devan Goodwin
77736f370f Merge pull request #265 from stevekuznetsov/skuznets/tag-mapping
Refactored version->tag mapping logic in Tagger
2017-01-26 10:03:41 -04:00
Steve Kuznetsov
ae4b761829
Only flush output stream if flushing is supported
While file handles support the `.flush()` method, some of the more
UNIX-ey pipes and tees do not. We should try to `.flush()` when we
can, but not bother when we can't.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-26 08:42:30 -05:00
Steve Kuznetsov
81dc44d611
Added support for choosing platforms for tests
Running the entire suite of containerized tests across all of the
platforms that are supported takes quite a while, especially if the
container images need to be built. Now, the platforms that are to be
tested can be specified with `$PY2_DISTROS` and `$PY3_DISTROS`.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-26 08:42:30 -05:00
Steve Kuznetsov
7154ac479a
Refactored version->tag mapping logic in Tagger
While the `tito.VersionTagger._get_new_tag()` method encapsulated some
of the version->tag mapping logic, other areas in the `VersionTagger`
used their own logic to do the mapping. This commit ensures that this
mapping happens in one place, which allows for custom implementations
to override the behavior simply.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-26 08:42:30 -05:00
Devan Goodwin
b277962316 Merge pull request #262 from stevekuznetsov/skuznets/force-flush
Flush output buffers
2017-01-26 08:47:36 -04:00
Devan Goodwin
ced4e19743 Merge pull request #263 from stevekuznetsov/skuznets/command_debug
Updated some debugging statements
2017-01-26 08:46:24 -04:00
Steve Kuznetsov
66a0a9edac
Improved debugging for RPM build step
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-25 17:31:10 -05:00
Steve Kuznetsov
459b377a3d
Print command debugging information only once
When debugging is turned on and a command is run that fails or with
`print_on_success` on, the output for the command execution ends up
being printed twice. This change ensures that only one set of output
is printed at any point.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-25 17:31:09 -05:00
Steve Kuznetsov
b5e8182c69
Flush output buffers
When using `$DEBUG=1`, often the output from different parts of `tito`
that output to different streams (for instance, `stderr` and `stdout`)
appears in the terminal in a garbled order. Furthermore, the stacktraces
generated by the Python interpreter are out of order with the output
from the `tito` process and often fragmented. By flushing the output
buffers on `tito.common._out()` we should be able to work around this.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-25 17:28:35 -05:00
Devan Goodwin
1aa39dc089 Merge pull request #261 from stevekuznetsov/skuznets/tag-version-mapping
Factor out the version->tag mapping in the Builder
2017-01-25 12:10:26 -04:00
Devan Goodwin
f37a510191 Merge pull request #260 from stevekuznetsov/skuznets/non-escalating-install
Added an option to not escalate privileges on `tito build --install`
2017-01-25 12:09:49 -04:00
Steve Kuznetsov
44b18596ec
Document tito tag --use-release in the manpage
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-25 10:10:08 -05:00
Steve Kuznetsov
b537fe0607
Added an option to not escalate privileges on tito build --install
When using `tito build --install` on a system without `sudo`, such as
inside of a Linux container build, the current implementation fails.
Furthermore, if the user is running `tito build --install` with the
correct level of privilege, it is not necessary to escalate privileges
further for the installation step.

This patch adds the `--dont-escalate-privileges` flag to `tito build`
and defaults it to `True`, which keeps the behavior backwards compat-
ible. Users will want to use this flag when building RPMs inside of a
container or when running `tito build` with the requisite permissions
for installing in the first place.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-25 10:10:08 -05:00
Steve Kuznetsov
ed2c0a8ce9
Factor out the version->tag mapping in the Builder
When a custom implementation of a tito Tagger is used, the mapping
function that is used to generate a tag from a version in the custom
Tagger must also be used in whichever tito Builder is used on that
repository. This commit factors out the mapping of version to tag so
that custom implementations of a Builder can inject custom logic here
with minimal effort, as is possible on the tito.VersionTagger by
overriding the _get_new_tag() function.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-24 17:53:50 -05:00
Devan Goodwin
bd21c5f551 Merge pull request #259 from stevekuznetsov/skuznets/tagger-cli
Collapse tagger class selection logic
2017-01-24 09:56:49 -04:00
Steve Kuznetsov
6b57b0bcbc
Collapse tagger class selection logic
In 26b02a7, the utility of the `ForceVersionTagger` was merged with the
base `VersionTagger`, so it is no longer necessary to ever explicitly
invoke the `ForceVersionTagger` class. Furthermore, the `elif` and
`else` branches of the decision tree for the tagger class were identical
in the previous implementation, so they were collapsed as well. The
remaining tagger class assignment is a simple query of the `tito.props`
file.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-23 14:44:23 -05:00
Devan Goodwin
97cb32862c Merge pull request #257 from stevekuznetsov/skuznets/readme
Rename `globalconfig` section to `buildconfig` in README
2017-01-23 08:43:58 -04:00
Steve Kuznetsov
1376b69495
Rename globalconfig section to buildconfig in README
From the looks of it, the `globalconfig` section is deprecated and
adding anything to that section of `tito.props` results in an error:

WARNING: Please rename [globalconfig] to [buildconfig] in tito.props

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-20 17:10:18 -05:00
Devan Goodwin
4d75af103f Merge pull request #255 from dgoodwin/issue253
253 - print cmd info when --debug is supplied
2017-01-17 08:40:19 -04:00
Devan Goodwin
5cf2999a74 Merge pull request #256 from dgoodwin/issue29
fixes #29 - remove --list-tags and --only-tags
2017-01-17 08:39:01 -04:00
jesus m. rodriguez
cd3ef6af29 fixes #29 - remove --list-tags and --only-tags 2017-01-16 21:47:47 -05:00
jesus m. rodriguez
8fd25ae5bb 253 - print cmd info when --debug is supplied 2017-01-16 21:12:50 -05:00
Devan Goodwin
de14541103 Automatic commit of package [tito] release [0.6.9-1].
Created by command:

/usr/bin/tito tag
2017-01-09 12:13:08 -04:00
Devan Goodwin
46dfdefffd Merge pull request #240 from stevekuznetsov/skuznets/use-release
Added `--use-release` flag for `tito tag`
2017-01-09 12:08:36 -04:00
Steve Kuznetsov
4f36972414
Clean up artifacts before test runs, not after
When tests fail, artifacts from that tests are necessary to properly
debug the failure and determine how to fix the test. This is impossible
when artifacts are immediately removed after the test is finished.
Instead, the tests should remove old artifacts before the test run
begins.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-09 10:00:31 -05:00
Steve Kuznetsov
25c3aeed71
Simplified version and release update logic
The logic that previously existed for updating the version and/or the
release in the specfile contained a lot of repetition and enough boolean
logic that it was becoming hard to read. By simplifying that stanza, the
hope is that the resulting code is easier to understand.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-09 10:00:31 -05:00
Steve Kuznetsov
a19a366213
Added --use-release flag for tito tag
When multiple tags exist for one version of a project, or when a version
is passed to `tito tag --use-version` that does not exactly correspond
with a tag in the repository's git history, the auto-generated release
is not guaranteed to monotonically increase. In order for users to
overcome this issue without building complicated logic into `tito`, it
is simpler to allow users to provide a literal release string to use.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-09 10:00:31 -05:00
Devan Goodwin
bb7881dfc6 Merge pull request #251 from stevekuznetsov/skuznets/pep8-fix
Use `def` instead of a lambda for function assignment
2017-01-06 12:23:09 -04:00
Steve Kuznetsov
35268dcf89
Use def instead of a lambda for function assignment
Using `def` instead of `x = lambda...` satisfies the PEP8 E731 warning.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-06 11:16:03 -05:00
Steve Kuznetsov
3cdceca9bd
Work around dnf issues and install builddep for Rawhide
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-06 11:01:17 -05:00
Devan Goodwin
77c7ff9a91 Merge pull request #249 from stevekuznetsov/skuznets/reconfigure-test-os
Add CentOS 7 and Fedora 25 tests, remove Fedora 21 tests
2017-01-06 09:08:12 -04:00
Devan Goodwin
db179f0f27 Merge pull request #248 from stevekuznetsov/skuznets/update-fedora-tests
Use `dnf` instead of `yum` in Fedora Rawhide tests
2017-01-06 09:07:45 -04:00
Steve Kuznetsov
bc9b769c19
Add CentOS 7 and Fedora 25 tests, remove Fedora 21 tests
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-05 16:39:06 -05:00
Steve Kuznetsov
9a7fb69e9e
Use dnf instead of yum in Fedora Rawhide tests
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-05 16:33:59 -05:00
Devan Goodwin
98e27fcdae Merge pull request #245 from stevekuznetsov/skuznets/docker-test-selinx-fix
Relabel test container volume contents for SELinux
2017-01-05 16:09:47 -04:00
Steve Kuznetsov
784a76c036
Relabel test container volume contents for SELinux
To allow the tests to run from a host with SELinux enabled, the data
needs to be relabeled to the correct SELinux contexts. Adding the `Z`
label to the volume mount allows for this to occur.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-05 15:08:00 -05:00
jesus m. rodriguez
db9717d9a4 Merge pull request #244 from lubomir/typos
Fix typos in man pages
2017-01-03 10:26:30 -05:00
Lubomír Sedlář
d774afec78 Fix typos in man pages 2017-01-02 13:11:36 +01:00
Devan Goodwin
94b0a93088 Merge pull request #238 from msehnout/cargo
Cargo
2016-12-15 10:21:32 -04:00
Martin Sehnoutka
074b129ad7 Fix unit tests. 2016-12-15 15:05:25 +01:00