apt_stage_artifacts 0.5.4 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 93eab470ef8684eb79b47dafcc7f08b345d232542d96666e853ea8ac7e553d3e
4
- data.tar.gz: bfee3c314fdd1eecd75253d7ad3c71e7debb8d4c396a43a379541e44c3347b5b
3
+ metadata.gz: 8e43d6a863a30baa1254fc13176928c876311967637ee2c94aaa525db1d59434
4
+ data.tar.gz: 04c20925c5ffceac9f3861d0e5783cc3ffec3b30acc992bb7e8384acbcf6fcfa
5
5
  SHA512:
6
- metadata.gz: b9ce4b50d62011ae52277ca427de4c6ecbbba6116687fe240097d70327c99b3b0b870c2deb63fea2a3630719f2d89d0f499f69416b7e81c79ac65d02d60e54c0
7
- data.tar.gz: d71e6d727e0cc5a8ffa56eb7360174eed2de96af56e1877a9235a1e4f02ca3da7c2ec8d57b51f83ee1e197fabafd77fc101295fbb169b5086b187619bc79aa51
6
+ metadata.gz: f9eab7e0f70f96fa3f960a33c3013f7957e0eb863a7cf381b975e7d1de484ea157ad71635e792dbab50b449c7590bfa996e36959fd98d831f0ebb20795f773e8
7
+ data.tar.gz: 71c0f29097b376bb4d7e169e48b97d8e2377cc3a7c0267e7dbd21cba360a78e91b42e1e5aa6626c0b5818ca1b44faf17e1db2b2b4c7d62dd83cc6f1fd58912af
@@ -16,14 +16,17 @@ class AptStageArtifacts
16
16
  Stages .deb artifacts into a freight library from a Vanagon or packaging directory.
17
17
 
18
18
  Usage:
19
- apt-stage-artifacts [--version]
20
- apt-stage-artifacts [--version] <top_directory>
19
+ apt-stage-artifacts [--repo-type=<repo-type>] [<top_directory>]
20
+ apt-stage-artifacts --version
21
+ apt-stage-artifacts --help
22
+
21
23
  DOCOPT
22
24
 
23
25
  def initialize(argv)
24
26
  @script_name = File.basename($PROGRAM_NAME)
25
27
  @log_level = Logger::INFO
26
28
  @user_options = parse_options(argv)
29
+ @repo_type = @user_options['--repo-type'] || 'stable'
27
30
  @version_string = "Version #{AptStageArtifacts::VERSION}"
28
31
 
29
32
  @artifacts_tarball_name = 'artifacts.tgz'
@@ -44,6 +47,10 @@ class AptStageArtifacts
44
47
  def run
45
48
  logger.info @version_string
46
49
  exit 0 if @user_options['--version']
50
+ unless AptStageArtifacts::VALID_REPO_TYPES.include? @repo_type
51
+ fatal "Unknown repo_type: \"#{@repo_type}\". Valid repo types are: " +
52
+ AptStageArtifacts::VALID_REPO_TYPES.join(', ')
53
+ end
47
54
  load_builder_data_yaml
48
55
  collect_artifacts
49
56
  create_remote_staging_directory
@@ -114,10 +121,11 @@ class AptStageArtifacts
114
121
 
115
122
  # A manifest is a staging to-do list represented in JSON as an array of hashes
116
123
  # containing:
117
- # deb_file_path:
118
- # codename:
119
- # puppet_version:
120
- # repo_type:
124
+ # deb_file_path: relative path to the .deb file
125
+ # codename: debian codename for this artifact, needed by freight
126
+ # puppet_version: part of the destination apt repo. We maintain apt repos by puppet major
127
+ # version
128
+ # repo_type: either 'stable' or 'nightly' typically. 'archive' is supported but unused.
121
129
  def generate_manifest
122
130
  manifest = []
123
131
 
@@ -126,15 +134,8 @@ class AptStageArtifacts
126
134
 
127
135
  repo_name = artifact_components[-2]
128
136
  case repo_name
129
- when /^puppet(\d+)-nightly$/
130
- puppet_version = Regexp.last_match(1)
131
- repo_type = 'nightly'
132
- when /^puppet(\d+)-archive/
133
- puppet_version = Regexp.last_match(1)
134
- repo_type = 'archive'
135
137
  when /^puppet(\d+)+$/
136
138
  puppet_version = Regexp.last_match(1)
137
- repo_type = 'stable'
138
139
  else
139
140
  fatal("Unknown repo name \"#{repo_name}\" in #{deb_file_path}")
140
141
  end
@@ -148,7 +149,7 @@ class AptStageArtifacts
148
149
  deb_file_path: deb_file_path,
149
150
  puppet_version: puppet_version,
150
151
  codename: codename,
151
- repo_type: repo_type
152
+ repo_type: @repo_type
152
153
  }
153
154
  end
154
155
 
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class AptStageArtifacts
2
- VERSION = '0.5.4'
2
+ VERSION = '0.6.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apt_stage_artifacts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet Release Engineering
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-07 00:00:00.000000000 Z
11
+ date: 2021-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry