packaging 0.99.31 → 0.99.32

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: 46032268fefeac3b8976ae2cdd44b27bab028dd4154d6dae1b99c62832510e8c
4
- data.tar.gz: 56f74df3abe80d40e39caeb2db1c2a4ba025e22ba2e90876191f29cb82a43f33
3
+ metadata.gz: 38ead6eee53e123cd39afdd4b92313496e9591ea0068de99ccb0567ac40abb62
4
+ data.tar.gz: ee005f59911683859d7abba2d836bd515e127ef6bedb6b7b5091344efa60d93a
5
5
  SHA512:
6
- metadata.gz: da7b1a51187cf880d42109e753c9166b5f5147f2f01faf59c880b334ad9abaaacf8ee663a92674b852d2e70133079e649955a925b188df88c256969f49aca972
7
- data.tar.gz: 108cfe68681a7c93f1e1b53f6a2a1b620ee5ec5930598c1ab5a01d332ed5460fad9b79fdfb98b082686dbeea3b0442712835783bc6d82384398676084c041536
6
+ metadata.gz: 57b80b8c7806508eefe557b5445e35ca09a240abcefd2016a0423effdce33cc13f30b719229ac8a4ef2f59db64d4017e88314662f32356c526183dd460fa8f04
7
+ data.tar.gz: e1069a4a27333f178fa23e0cd8d19e224e9c57345eb4f201b472d8c688e93231692567e587428345525db14477b3471a17c8a9d5c449929f908d5fb6cfaba270
@@ -8,7 +8,7 @@ module Pkg::Archive
8
8
 
9
9
  # Array of paths for temporarily staging artifacts before syncing to release-archives on s3
10
10
  def archive_paths
11
- [Pkg::Config.yum_archive_path, Pkg::Config.apt_archive_path, Pkg::Config.freight_archive_path, Pkg::Config.downloads_archive_path].compact.freeze
11
+ [Pkg::Config.yum_archive_path, Pkg::Config.apt_archive_path, Pkg::Config.freight_archive_path, Pkg::Config.downloads_archive_path, '/opt/tmp-apt'].compact.freeze
12
12
  end
13
13
 
14
14
  # Move yum directories from repo path to archive staging path
@@ -36,46 +36,28 @@ module Pkg::Archive
36
36
  Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.staging_server, command)
37
37
  end
38
38
 
39
- # Move apt directories from repo path (and repo staging path aka freight path) to archive staging paths
39
+ # Move directories from freight path (aka repo staging path) to archive staging paths
40
40
  def stage_apt_archives(directory)
41
- # /opt/tools/freight/apt/$codename/#{directory}
42
- # /opt/repository/apt/pool/$codename/#{directory}
43
- pool_directory = File.join(Pkg::Config.apt_repo_path, 'pool')
41
+ find_command = "find #{Pkg::Config.apt_repo_staging_path} -type d -name #{directory}"
42
+ find_command = "find #{Pkg::Config.apt_repo_staging_path} -maxdepth 2 -type f" if directory == 'main'
44
43
  command = <<-CMD
45
- for full_directory in $(find #{pool_directory} -type d -name #{directory}); do
46
- find $full_directory -type l -delete
47
- sudo chattr -i -R $full_directory
48
- subdirectory=${full_directory##{Pkg::Config.apt_repo_path}/}
49
- codename=$(echo $subdirectory | cut -d'/' -f 2)
50
- sudo mkdir --parents #{Pkg::Config.apt_archive_path}/$subdirectory
51
- sudo chown root:release -R #{Pkg::Config.apt_archive_path}/$subdirectory
52
- sudo chmod g+w -R #{Pkg::Config.apt_archive_path}/$subdirectory
53
- mv $full_directory #{Pkg::Config.apt_archive_path}/$(dirname $subdirectory)
44
+ for stuff in $(#{find_command}); do
45
+ find $stuff -type l -delete
46
+ codename=$(dirname ${stuff##{Pkg::Config.apt_repo_staging_path}/})
54
47
  sudo mkdir --parents #{Pkg::Config.freight_archive_path}/$codename
55
48
  sudo chown root:release -R #{Pkg::Config.freight_archive_path}/$codename
56
49
  sudo chmod g+w -R #{Pkg::Config.freight_archive_path}/$codename
57
- if [ #{directory} = 'main' ]; then
58
- freight_directory=#{Pkg::Config.apt_repo_staging_path}/$codename
59
- if [ ! -d $freight_directory ]; then
60
- echo "ERROR: Couldn't find freight directory $freight_directory, exiting . . ."
61
- exit 1
62
- fi
63
- for file in $(find $freight_directory -maxdepth 1 -type f); do
64
- mv $file #{Pkg::Config.freight_archive_path}/$codename
65
- done
66
- else
67
- freight_directory=#{Pkg::Config.apt_repo_staging_path}/$codename/#{directory}
68
- if [ ! -d $freight_directory ]; then
69
- if [ -d #{Pkg::Config.freight_archive_path}/$codename/#{directory} ]; then
70
- echo "Directory $freight_directory has already been staged, skipping . . ."
71
- exit 0
72
- else
73
- echo "ERROR: Couldn't find freight directory $freight_directory, exiting . . ."
74
- exit 1
75
- fi
76
- fi
77
- mv $freight_directory #{Pkg::Config.freight_archive_path}/$codename/#{directory}
50
+ mv $stuff #{Pkg::Config.freight_archive_path}/$codename
51
+
52
+ pool_directory=#{Pkg::Config.apt_repo_path}/pool/$codename/#{directory}
53
+ if [ ! -d $pool_directory ]; then
54
+ echo "Can't find directory $pool_directory, it may have already been archived, skipping . . ."
55
+ continue
78
56
  fi
57
+ sudo mkdir --parents /opt/tmp-apt
58
+ sudo chown root:release -R /opt/tmp-apt
59
+ sudo chmod g+w -R /opt/tmp-apt
60
+ mv $pool_directory /opt/tmp-apt
79
61
  done
80
62
  CMD
81
63
  Pkg::Util::Net.remote_ssh_cmd(Pkg::Config.staging_server, command)
@@ -6,6 +6,7 @@ module Pkg::Params
6
6
  BUILD_PARAMS = [:allow_dirty_tree,
7
7
  :answer_override,
8
8
  :apt_archive_path,
9
+ :apt_archive_repo_command,
9
10
  :apt_host,
10
11
  :apt_releases,
11
12
  :apt_repo_command,
@@ -200,6 +201,7 @@ module Pkg::Params
200
201
  { :var => :allow_dirty_tree, :envvar => :ALLOW_DIRTY_TREE, :type => :bool },
201
202
  { :var => :answer_override, :envvar => :ANSWER_OVERRIDE },
202
203
  { :var => :apt_archive_path, :envvar => :APT_ARCHIVE_PATH },
204
+ { :var => :apt_archive_repo_command, :envvar => :APT_ARCHIVE_REPO_COMMAND },
203
205
  { :var => :apt_host, :envvar => :APT_HOST },
204
206
  { :var => :apt_releases, :envvar => :APT_RELEASES, :type => :array },
205
207
  { :var => :apt_repo_path, :envvar => :APT_REPO },
@@ -5,6 +5,7 @@ require 'yaml'
5
5
  describe "Pkg::Config" do
6
6
 
7
7
  Build_Params = [:apt_archive_path,
8
+ :apt_archive_repo_command,
8
9
  :apt_host,
9
10
  :apt_releases,
10
11
  :apt_repo_path,
data/tasks/archive.rake CHANGED
@@ -18,6 +18,16 @@ namespace :pl do
18
18
  end
19
19
  end
20
20
 
21
+ desc "Create archive yum repo"
22
+ task :update_archive_yum_repo => 'pl:fetch' do
23
+ Pkg::Repo.update_repo(Pkg::Config.staging_server, Pkg::Config.yum_repo_command, { :repo_name => '', :repo_path => Pkg::Config.yum_archive_path, :repo_host => Pkg::Config.staging_server })
24
+ end
25
+
26
+ desc "Create archive apt repo"
27
+ task :update_archive_apt_repo => 'pl:fetch' do
28
+ Pkg::Repo.update_repo(Pkg::Config.staging_server, Pkg::Config.apt_archive_repo_command)
29
+ end
30
+
21
31
  desc "Sync archived packages to s3"
22
32
  task :deploy_staged_archives_to_s3 => 'pl:fetch' do
23
33
  command = 'sudo /usr/local/bin/s3_repo_sync.sh release-archives.puppet.com'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: packaging
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.99.31
4
+ version: 0.99.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet Labs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-13 00:00:00.000000000 Z
11
+ date: 2019-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec