-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
149 lines (114 loc) · 4.84 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
NAME
nrepo - Repository Management
DESCRIPTION
Nrepo is designed to be an extensible repository management system
Currently it provides a basic framework and support for Yum based
repositories. Stay tuned for more!
SYNOPSIS
nrepo --action X [options]
See perldoc App::Nrepo for all valid actions and their in depth descriptions
Actions:
list List all configured repositories
mirror Mirror a repository
requires:
--repo (all|$regex|$repository_name)
optional:
--checksums
--regex (uses --repo value as a regex)
tag Tag a repository
requires:
--repo $repository_name
--tag $destination_tag
optional:
--src-tag $src_tag (defaults to 'head')
--symlink (default false)
clean Cleans a repository of unreferenced files
requires:
--repo (all|$regex|$repository_name)
optional:
--regex (uses --repo value as a regex)
init Initialise a custom repository
requires:
--repo $repository_name
add-file Add files to a custom repository
requires:
--repo $repository_name
--arch $arch
--file $path_to_file (--file can be supplied multiple times)
del-file Remove files from a custom repository
requires:
--repo $repository_name
--arch $arch
--file $path_to_file (--file can be supplied multiple times)
Script Options:
--config-file Path to config-file, defaults to ./conf/nrepo.conf
--log-level Change the stdout log level (overrides config)
--help This helpful message
EXAMPLES
# Working with mirrored repos:
# Update the repository from upstream to current
nrepo --action mirror --repo centos-6-epel
# Tag the newly updated packages/manifests with a hard tag
nrepo --action tag --repo centos-6-epel --tag release_20150827
# Tag the hard tag with a soft tag that your clients reference
nrepo --action tag --repo centos-6-epel --src-tag release_20150827 --symlink --tag production
# Working with local repos:
# Add some packages:
nrepo --action add-file --repo centos-6-custom --arch x86_64 --file /path/to/package_foo-1.0-el6.x86_64.rpm --file /path/to/package_bar-1.0-el6.x86_64.rpm
# Tag the newly updated packages/manifests with a hard tag
nrepo --action tag --repo centos-6-custom --tag release_20150827
# Tag the hard tag with a soft tag that your clients reference
nrepo --action tag --repo centos-6-epel --src-tag release_20150827 --symlink --tag production
# Working with tags:
# Lets say upstream added broken updates you can easily roll back your production tag just by:
# --force is needed if a destination tag already exists
nrepo --action tag --repo $repo --src-tag $last_stable_releas_tag --symlink --tag production --force
CONFIGURATION
Global Options
data_dir
Path to location where repository files are stored eg:
data_dir = /path/to/repo_data
include
You can use this to include other conf files or directories eg:
include /path/to/repos.conf
include /path/to/conf.d
tag_style
This determines how tag directories are done eg:
bottomdir (default) would result in a data structure like:
$data_dir/$repo_name/$tag
topdir would result in a data structure like:
$data_dir/$tag/$repo_name
log_file
Path to log output to (No default) eg:
log_file = /path/to/logfile.log
log_file_level
Log messages to log file at this level (defaults to 'info') Levels
acceptable are what Log::Dispatch supports
screen_level
Same as log_level but to STDOUT...this value can be overwritten at
runtime using --log-level Defaults to 'notice'
Global and/or repository
hard_tag_regex
This option will use the repository config value if present
otherwise the global value if present eg:
hard_tag_regex = ^release_\d{8}$
Repository Config
A repository is defined as:
<repo $reponame>
$option1 = $value1
...
$optionN = $valueN
</>
Valid options include:
type
The repository base type, ie Yum, Apt, Plain etc
local
The directory relative to $data_dir
url The url to mirror from
ca An optional ca cert file used when mirroring from upstream https (ie
like Redhats cdn network)
cert
An optional cert file used when mirroring from upstream https (ie
like Redhats cdn network)
key An optional cert key file used when mirroring from upstream https
(ie like Redhats cdn network)