puppet 2.7.22 → 2.7.23
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of puppet might be problematic. Click here for more details.
- data/CHANGELOG +21 -0
- data/Rakefile +0 -2
- data/ext/build_defaults.yaml +1 -1
- data/ext/packaging/README.md +88 -33
- data/ext/packaging/packaging.rake +45 -0
- data/ext/packaging/spec/tasks/build_object_spec.rb +2 -0
- data/ext/packaging/tasks/00_utils.rake +94 -54
- data/ext/packaging/tasks/10_setupvars.rake +40 -28
- data/ext/packaging/tasks/apple.rake +20 -27
- data/ext/packaging/tasks/build.rake +3 -8
- data/ext/packaging/tasks/deb.rake +12 -36
- data/ext/packaging/tasks/deb_repos.rake +28 -36
- data/ext/packaging/tasks/fetch.rake +1 -2
- data/ext/packaging/tasks/jenkins.rake +22 -56
- data/ext/packaging/tasks/jenkins_dynamic.rake +111 -0
- data/ext/packaging/tasks/mock.rake +101 -56
- data/ext/packaging/tasks/pe_deb.rake +5 -7
- data/ext/packaging/tasks/pe_remote.rake +30 -42
- data/ext/packaging/tasks/pe_rpm.rake +3 -11
- data/ext/packaging/tasks/pe_ship.rake +14 -18
- data/ext/packaging/tasks/pe_sign.rake +11 -0
- data/ext/packaging/tasks/pe_tar.rake +1 -1
- data/ext/packaging/tasks/release.rake +0 -6
- data/ext/packaging/tasks/remote_build.rake +1 -13
- data/ext/packaging/tasks/retrieve.rake +1 -1
- data/ext/packaging/tasks/rpm.rake +15 -10
- data/ext/packaging/tasks/rpm_repos.rake +45 -56
- data/ext/packaging/tasks/ship.rake +46 -37
- data/ext/packaging/tasks/sign.rake +22 -14
- data/ext/packaging/tasks/tar.rake +1 -1
- data/ext/packaging/tasks/template.rake +1 -1
- data/ext/packaging/templates/README +1 -0
- data/ext/packaging/templates/downstream.xml.erb +32 -0
- data/ext/packaging/templates/packaging.xml.erb +182 -0
- data/ext/packaging/templates/repo.xml.erb +93 -0
- data/lib/puppet.rb +2 -0
- data/lib/puppet/file_system.rb +3 -0
- data/lib/puppet/file_system/path_pattern.rb +97 -0
- data/lib/puppet/module.rb +25 -4
- data/lib/puppet/module_tool/applications/unpacker.rb +5 -1
- data/lib/puppet/parser/files.rb +20 -15
- data/lib/puppet/parser/parser_support.rb +10 -1
- data/lib/puppet/parser/type_loader.rb +48 -28
- data/lib/puppet/version.rb +1 -1
- data/spec/unit/file_system/path_pattern_spec.rb +139 -0
- data/spec/unit/module_spec.rb +8 -1
- data/spec/unit/module_tool/applications/unpacker_spec.rb +6 -0
- data/spec/unit/parser/files_spec.rb +6 -67
- data/spec/unit/parser/parser_spec.rb +15 -5
- data/spec/unit/parser/type_loader_spec.rb +14 -33
- data/spec/unit/resource/type_collection_spec.rb +39 -55
- metadata +11 -5
- data/Gemfile.lock +0 -44
- data/ext/packaging/tasks/pe_sles.rake +0 -101
- data/ext/packaging/tasks/pre_tasks.rake +0 -0
@@ -32,16 +32,16 @@ end
|
|
32
32
|
namespace :pl do
|
33
33
|
desc "Sign the tarball, defaults to PL key, pass GPG_KEY to override or edit build_defaults"
|
34
34
|
task :sign_tar do
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
else
|
39
|
-
STDERR.puts "No tarball exists. Try rake package:tar?"
|
40
|
-
end
|
35
|
+
File.exist?("pkg/#{@build.project}-#{@build.version}.tar.gz") or fail "No tarball exists. Try rake package:tar?"
|
36
|
+
load_keychain if has_tool('keychain')
|
37
|
+
gpg_sign_file "pkg/#{@build.project}-#{@build.version}.tar.gz"
|
41
38
|
end
|
42
39
|
|
43
40
|
desc "Sign mocked rpms, Defaults to PL Key, pass KEY to override"
|
44
41
|
task :sign_rpms do
|
42
|
+
# Find x86_64 noarch rpms that have been created as hard links and remove them
|
43
|
+
rm_r Dir["pkg/*/*/*/x86_64/*.noarch.rpm"]
|
44
|
+
# We'll sign the remaining noarch
|
45
45
|
el5_rpms = Dir["pkg/el/5/**/*.rpm"].join(' ')
|
46
46
|
modern_rpms = (Dir["pkg/el/6/**/*.rpm"] + Dir["pkg/fedora/**/*.rpm"]).join(' ')
|
47
47
|
unless el5_rpms.empty?
|
@@ -53,6 +53,12 @@ namespace :pl do
|
|
53
53
|
puts "Signing el6 and fedora rpms..."
|
54
54
|
sign_modern(modern_rpms)
|
55
55
|
end
|
56
|
+
# Now we hardlink them back in
|
57
|
+
Dir["pkg/*/*/*/i386/*.noarch.rpm"].each do |rpm|
|
58
|
+
cd File.dirname(rpm) do
|
59
|
+
ln rpm, File.join("..","x86_64")
|
60
|
+
end
|
61
|
+
end
|
56
62
|
end
|
57
63
|
|
58
64
|
desc "Sign ips package, Defaults to PL Key, pass KEY to override"
|
@@ -76,15 +82,19 @@ namespace :pl do
|
|
76
82
|
signed = FALSE
|
77
83
|
end
|
78
84
|
end
|
79
|
-
|
85
|
+
fail unless signed
|
80
86
|
puts "All rpms signed"
|
81
87
|
end
|
82
88
|
|
83
89
|
desc "Sign generated debian changes files. Defaults to PL Key, pass KEY to override"
|
84
90
|
task :sign_deb_changes do
|
85
|
-
|
86
|
-
|
87
|
-
|
91
|
+
begin
|
92
|
+
load_keychain if has_tool('keychain')
|
93
|
+
sign_deb_changes("pkg/deb/*/*.changes") unless Dir["pkg/deb/*/*.changes"].empty?
|
94
|
+
sign_deb_changes("pkg/deb/*.changes") unless Dir["pkg/deb/*.changes"].empty?
|
95
|
+
ensure
|
96
|
+
%x{keychain -k mine}
|
97
|
+
end
|
88
98
|
end
|
89
99
|
|
90
100
|
##
|
@@ -94,10 +104,8 @@ namespace :pl do
|
|
94
104
|
namespace :jenkins do
|
95
105
|
desc "Sign all locally staged packages on #{@build.distribution_server}"
|
96
106
|
task :sign_all => "pl:fetch" do
|
97
|
-
|
98
|
-
|
99
|
-
exit 1
|
100
|
-
end
|
107
|
+
Dir["pkg/*"].empty? and fail "There were files found in pkg/. Maybe you wanted to build/retrieve something first?"
|
108
|
+
|
101
109
|
# Because rpms and debs are laid out differently in PE under pkg/ they
|
102
110
|
# have a different sign task to address this. Rather than create a whole
|
103
111
|
# extra :jenkins task for signing PE, we determine which sign task to use
|
@@ -75,7 +75,7 @@ namespace :package do
|
|
75
75
|
ENV['NEW_STYLE_PACKAGE'] and Rake::Task["package:versionbump"].invoke(workdir)
|
76
76
|
|
77
77
|
cd "pkg" do
|
78
|
-
sh "#{tar} --exclude #{tar_excludes.join(" --exclude ")} -zcf #{@build.project}-#{@build.version}.tar.gz #{@build.project}-#{@build.version}"
|
78
|
+
sh "#{tar} --exclude #{tar_excludes.join(" --exclude ")} -zcf '#{@build.project}-#{@build.version}.tar.gz' #{@build.project}-#{@build.version}"
|
79
79
|
end
|
80
80
|
rm_rf(workdir)
|
81
81
|
puts
|
@@ -3,7 +3,7 @@ namespace :package do
|
|
3
3
|
task :template, :workdir do |t, args|
|
4
4
|
workdir = args.workdir
|
5
5
|
|
6
|
-
FileList["#{workdir}/ext/**/*.erb"].each do |template|
|
6
|
+
FileList["#{workdir}/ext/**/*.erb"].exclude(/#{workdir}\/ext\/packaging/).each do |template|
|
7
7
|
# process the template, stripping off the ERB extension
|
8
8
|
erb(template, template[0..-5])
|
9
9
|
rm_f(template)
|
@@ -0,0 +1 @@
|
|
1
|
+
Add erb templates to this directory that packaging repo uses
|
@@ -0,0 +1,32 @@
|
|
1
|
+
<?xml version='1.0' encoding='UTF-8'?>
|
2
|
+
<project>
|
3
|
+
<actions/>
|
4
|
+
<description><p>
|
5
|
+
When DOWNSTREAM_JOB is passed to the packaging repo, this job is created to wrap the call to that job.
|
6
|
+
This allows us to use jenkins' upstream/downstream chaining facilities while retaining the ability to trigger jobs on other jenkins hosts
|
7
|
+
</p></description>
|
8
|
+
<keepDependencies>false</keepDependencies>
|
9
|
+
<properties>
|
10
|
+
<jenkins.plugins.hipchat.HipChatNotifier_-HipChatJobProperty plugin="hipchat-plugin@0.1.0">
|
11
|
+
<room></room>
|
12
|
+
<startNotification>false</startNotification>
|
13
|
+
</jenkins.plugins.hipchat.HipChatNotifier_-HipChatJobProperty>
|
14
|
+
</properties>
|
15
|
+
<scm class="hudson.scm.NullSCM"/>
|
16
|
+
<canRoam>true</canRoam>
|
17
|
+
<disabled>false</disabled>
|
18
|
+
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
|
19
|
+
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
|
20
|
+
<triggers class="vector"/>
|
21
|
+
<concurrentBuild>false</concurrentBuild>
|
22
|
+
<builders>
|
23
|
+
<hudson.tasks.Shell>
|
24
|
+
<command>#!/bin/bash
|
25
|
+
set -e
|
26
|
+
# This URI was passed in as an argument to the original rake package call
|
27
|
+
curl -i '<%= escape_html(ENV['DOWNSTREAM_JOB']) %>'</command>
|
28
|
+
</hudson.tasks.Shell>
|
29
|
+
</builders>
|
30
|
+
<publishers/>
|
31
|
+
<buildWrappers/>
|
32
|
+
</project>
|
@@ -0,0 +1,182 @@
|
|
1
|
+
<?xml version='1.0' encoding='UTF-8'?>
|
2
|
+
<matrix-project>
|
3
|
+
<actions/>
|
4
|
+
<description><p>
|
5
|
+
Dynamically Created Packaging Job for a packaging repo-compatible project.
|
6
|
+
Intended to be triggered from within a project with the packaging repo
|
7
|
+
bootstrapped.
|
8
|
+
</p>
|
9
|
+
<p>
|
10
|
+
Three parameters are expected:
|
11
|
+
</p>
|
12
|
+
1) File: A build parameters file that describes information about the build state
|
13
|
+
<br>
|
14
|
+
2) File: A tar.gz of a git bundle, created by the packaging repo, of the
|
15
|
+
current state of the project to be packaged
|
16
|
+
</br>
|
17
|
+
<br>
|
18
|
+
3) String: The project, e.g. facter, puppet
|
19
|
+
</br>
|
20
|
+
<p>
|
21
|
+
This job will be triggered automatically after generation by the packaging
|
22
|
+
repo.
|
23
|
+
</p>
|
24
|
+
<br>
|
25
|
+
To trigger another downstream job after completion of this and the downstream repo creation job, pass DOWNSTREAM_JOB=$URI with the invocation, e.g.
|
26
|
+
</br>
|
27
|
+
<p>
|
28
|
+
pl:jenkins:uber_build DOWNSTREAM_JOB=http://jenkins-release.delivery.puppetlabs.net/job/puppetlabs-packaging-downstream-test/build
|
29
|
+
</p>
|
30
|
+
<p>
|
31
|
+
To get notified of the failure of this packaging job, pass NOTIFY= with the invocation, e.g.
|
32
|
+
</p>
|
33
|
+
<p>
|
34
|
+
pl:jenkins:uber_build NOTIFY=foo@puppetlabs.com
|
35
|
+
</p>
|
36
|
+
<p>
|
37
|
+
Successful completion of packaging will result in the automatic creation of
|
38
|
+
apt/yum repositories on the distribution server with the built packages. To
|
39
|
+
generate client apt/yum repository config files for accessing these packages,
|
40
|
+
check out the ref of the git sha that was packaged, and run `rake
|
41
|
+
pl:jenkins:(deb|rpm)_repo_configs`. Configuration files will be generated and
|
42
|
+
deposited locally in pkg/repo_configs.
|
43
|
+
</p>
|
44
|
+

|
45
|
+

|
46
|
+

|
47
|
+
</description>
|
48
|
+
<logRotator class="hudson.tasks.LogRotator">
|
49
|
+
<daysToKeep>3</daysToKeep>
|
50
|
+
<numToKeep>-1</numToKeep>
|
51
|
+
<artifactDaysToKeep>-1</artifactDaysToKeep>
|
52
|
+
<artifactNumToKeep>-1</artifactNumToKeep>
|
53
|
+
</logRotator>
|
54
|
+
<keepDependencies>false</keepDependencies>
|
55
|
+
<properties>
|
56
|
+
<jp.ikedam.jenkins.plugins.groovy__label__assignment.GroovyLabelAssignmentProperty plugin="groovy-label-assignment@1.0.0">
|
57
|
+
<groovyScript>def labelMap = [
|
58
|
+
<% @build.cows.split(' ').each do |cow| %>"pl_deb COW=<%= cow %>": "deb",<% end %>
|
59
|
+
<% @build.final_mocks.split(' ').each do |mock| %>"pl_mock MOCK=<%= mock %>": "rpm",<% end %>
|
60
|
+
"package_tar": "rpm",
|
61
|
+
<% if @build.build_gem then %>"package_gem": "gem",<% end %>
|
62
|
+
<% if @build.build_dmg then %>"package_apple": "dmg",<% end %>
|
63
|
+
];
|
64
|
+
return labelMap.get(binding.getVariables().get("command"));</groovyScript>
|
65
|
+
</jp.ikedam.jenkins.plugins.groovy__label__assignment.GroovyLabelAssignmentProperty>
|
66
|
+
<jenkins.plugins.hipchat.HipChatNotifier_-HipChatJobProperty plugin="hipchat-plugin@0.1.0">
|
67
|
+
<room></room>
|
68
|
+
<startNotification>false</startNotification>
|
69
|
+
</jenkins.plugins.hipchat.HipChatNotifier_-HipChatJobProperty>
|
70
|
+
<hudson.model.ParametersDefinitionProperty>
|
71
|
+
<parameterDefinitions>
|
72
|
+
<hudson.model.FileParameterDefinition>
|
73
|
+
<name>BUILD_PROPERTIES</name>
|
74
|
+
<description></description>
|
75
|
+
</hudson.model.FileParameterDefinition>
|
76
|
+
<hudson.model.FileParameterDefinition>
|
77
|
+
<name>PROJECT_BUNDLE</name>
|
78
|
+
<description></description>
|
79
|
+
</hudson.model.FileParameterDefinition>
|
80
|
+
<hudson.model.StringParameterDefinition>
|
81
|
+
<name>PROJECT</name>
|
82
|
+
<description></description>
|
83
|
+
<defaultValue></defaultValue>
|
84
|
+
</hudson.model.StringParameterDefinition>
|
85
|
+
</parameterDefinitions>
|
86
|
+
</hudson.model.ParametersDefinitionProperty>
|
87
|
+
</properties>
|
88
|
+
<scm class="hudson.scm.NullSCM"/>
|
89
|
+
<canRoam>true</canRoam>
|
90
|
+
<disabled>false</disabled>
|
91
|
+
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
|
92
|
+
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
|
93
|
+
<triggers class="vector"/>
|
94
|
+
<concurrentBuild>false</concurrentBuild>
|
95
|
+
<axes>
|
96
|
+
<hudson.matrix.TextAxis>
|
97
|
+
<name>command</name>
|
98
|
+
<values>
|
99
|
+
<% @build.cows.split(' ').each do |cow| %><string>pl_deb COW=<%= cow %></string><% end %>
|
100
|
+
<% @build.final_mocks.split(' ').each do |mock| %><string>pl_mock MOCK=<%= mock %></string><% end %>
|
101
|
+
<string>package_tar</string>
|
102
|
+
<% if @build.build_gem then %><string>package_gem</string><% end %>
|
103
|
+
<% if @build.build_dmg then %><string>package_apple</string><% end %>
|
104
|
+
</values>
|
105
|
+
</hudson.matrix.TextAxis>
|
106
|
+
</axes>
|
107
|
+
<builders>
|
108
|
+
<hudson.tasks.Shell>
|
109
|
+
<command>#!/bin/bash
|
110
|
+
set -e
|
111
|
+
### Create a local clone of the git-bundle that was passed
|
112
|
+
# The bundle is wrapped in a tarball. We don't need to know the project that is
|
113
|
+
# in the git bundle.
|
114
|
+
|
115
|
+
# Swap out _ for : in the command - lein cannot handle : in paths, and jenkins
|
116
|
+
# automatically makes directories with the names of the matrix cell (in this
|
117
|
+
# case $command) if https://github.com/technomancy/leiningen/issues/891 is ever
|
118
|
+
# resolved, this dirty hack can be removed.
|
119
|
+
command=$(echo $command | sed 's/_/:/1')
|
120
|
+
|
121
|
+
[ -f "PROJECT_BUNDLE" ] || exit 1
|
122
|
+
mkdir project && tar -xzf PROJECT_BUNDLE -C project/
|
123
|
+
|
124
|
+
pushd project
|
125
|
+
git clone --recursive $(ls) git_repo
|
126
|
+
|
127
|
+
pushd git_repo
|
128
|
+
|
129
|
+
### Clone the packaging repo
|
130
|
+
rake package:bootstrap
|
131
|
+
|
132
|
+
### Perform the build
|
133
|
+
rake $command PARAMS_FILE="$WORKSPACE/BUILD_PROPERTIES" --trace
|
134
|
+
|
135
|
+
### Send the results
|
136
|
+
rake pl:jenkins:ship["artifacts"] PARAMS_FILE="$WORKSPACE/BUILD_PROPERTIES" --trace
|
137
|
+
|
138
|
+
popd
|
139
|
+
popd</command>
|
140
|
+
</hudson.tasks.Shell>
|
141
|
+
</builders>
|
142
|
+
<publishers>
|
143
|
+
<hudson.tasks.ArtifactArchiver>
|
144
|
+
<artifacts>**/PROJECT_BUNDLE</artifacts>
|
145
|
+
<latestOnly>false</latestOnly>
|
146
|
+
<allowEmptyArchive>false</allowEmptyArchive>
|
147
|
+
</hudson.tasks.ArtifactArchiver><% if @build.notify %>
|
148
|
+
<hudson.tasks.Mailer plugin="mailer@1.4">
|
149
|
+
<recipients><%= "#{@build.notify}" %></recipients>
|
150
|
+
<dontNotifyEveryUnstableBuild>false</dontNotifyEveryUnstableBuild>
|
151
|
+
<sendToIndividuals>false</sendToIndividuals>
|
152
|
+
</hudson.tasks.Mailer><% end %>
|
153
|
+
<hudson.plugins.parameterizedtrigger.BuildTrigger plugin="parameterized-trigger@2.16">
|
154
|
+
<configs>
|
155
|
+
<hudson.plugins.parameterizedtrigger.BuildTriggerConfig>
|
156
|
+
<configs>
|
157
|
+
<hudson.plugins.parameterizedtrigger.CurrentBuildParameters/>
|
158
|
+
</configs>
|
159
|
+
<projects><%= "#{@build.project}-repo-#{@build.build_date}-#{@build.ref}" %></projects>
|
160
|
+
<condition>UNSTABLE_OR_BETTER</condition>
|
161
|
+
<triggerWithNoParameters>false</triggerWithNoParameters>
|
162
|
+
</hudson.plugins.parameterizedtrigger.BuildTriggerConfig>
|
163
|
+
</configs>
|
164
|
+
</hudson.plugins.parameterizedtrigger.BuildTrigger>
|
165
|
+
</publishers>
|
166
|
+
<buildWrappers>
|
167
|
+
<hudson.plugins.build__timeout.BuildTimeoutWrapper plugin="build-timeout@1.11">
|
168
|
+
<timeoutMinutes>45</timeoutMinutes>
|
169
|
+
<failBuild>false</failBuild>
|
170
|
+
<writingDescription>false</writingDescription>
|
171
|
+
<timeoutPercentage>0</timeoutPercentage>
|
172
|
+
<timeoutType>absolute</timeoutType>
|
173
|
+
<timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
|
174
|
+
</hudson.plugins.build__timeout.BuildTimeoutWrapper>
|
175
|
+
<hudson.plugins.ansicolor.AnsiColorBuildWrapper plugin="ansicolor@0.3.1">
|
176
|
+
<colorMapName>xterm</colorMapName>
|
177
|
+
</hudson.plugins.ansicolor.AnsiColorBuildWrapper>
|
178
|
+
</buildWrappers>
|
179
|
+
<executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl">
|
180
|
+
<runSequentially>false</runSequentially>
|
181
|
+
</executionStrategy>
|
182
|
+
</matrix-project>
|
@@ -0,0 +1,93 @@
|
|
1
|
+
<?xml version='1.0' encoding='UTF-8'?>
|
2
|
+
<project>
|
3
|
+
<actions/>
|
4
|
+
<description><p>
|
5
|
+
Dynamically created job to generate apt and yum repos from packages built by jenkins. It uses the git archive from the package:tar cell in the upstream package matrix to determine which repos to create.
|
6
|
+
</p>
|
7
|
+
<p>
|
8
|
+
This job will trigger the downstream job supplied with DOWNSTREAM_JOB if passed to rake in the upstream invocation.
|
9
|
+
</p>
|
10
|
+
</description>
|
11
|
+
<logRotator class="hudson.tasks.LogRotator">
|
12
|
+
<daysToKeep>3</daysToKeep>
|
13
|
+
<numToKeep>-1</numToKeep>
|
14
|
+
<artifactDaysToKeep>-1</artifactDaysToKeep>
|
15
|
+
<artifactNumToKeep>-1</artifactNumToKeep>
|
16
|
+
</logRotator>
|
17
|
+
<keepDependencies>false</keepDependencies>
|
18
|
+
<properties>
|
19
|
+
<jenkins.plugins.hipchat.HipChatNotifier_-HipChatJobProperty plugin="hipchat-plugin@0.1.0">
|
20
|
+
<room></room>
|
21
|
+
<startNotification>false</startNotification>
|
22
|
+
</jenkins.plugins.hipchat.HipChatNotifier_-HipChatJobProperty>
|
23
|
+
</properties>
|
24
|
+
<scm class="hudson.scm.NullSCM"/>
|
25
|
+
<assignedNode>deb||rpm</assignedNode>
|
26
|
+
<canRoam>false</canRoam>
|
27
|
+
<disabled>false</disabled>
|
28
|
+
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
|
29
|
+
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
|
30
|
+
<triggers class="vector"/>
|
31
|
+
<concurrentBuild>false</concurrentBuild>
|
32
|
+
<builders>
|
33
|
+
<hudson.plugins.copyartifact.CopyArtifact plugin="copyartifact@1.25">
|
34
|
+
<projectName><%= "#{@build.project}-packaging-#{@build.build_date}-#{@build.ref}" %>/command=package_tar</projectName>
|
35
|
+
<filter>**/PROJECT_BUNDLE</filter>
|
36
|
+
<target></target>
|
37
|
+
<selector class="hudson.plugins.copyartifact.TriggeredBuildSelector">
|
38
|
+
<fallbackToLastSuccessful>true</fallbackToLastSuccessful>
|
39
|
+
</selector>
|
40
|
+
<flatten>true</flatten>
|
41
|
+
</hudson.plugins.copyartifact.CopyArtifact>
|
42
|
+
<hudson.tasks.Shell>
|
43
|
+
<command>#!/bin/bash
|
44
|
+
set -e
|
45
|
+
### We've retrieved the git bundle from the tarball build, so now we clone it
|
46
|
+
### and use it to trigger our repo creation
|
47
|
+
#
|
48
|
+
# PROJECT_BUNDLE is a tarball containing a bundle file and git_repo is the
|
49
|
+
# directory that will contain the git repository. First we untar the tarball
|
50
|
+
# and then clone the git_bundle
|
51
|
+
|
52
|
+
[ -f "PROJECT_BUNDLE" ] || exit 1
|
53
|
+
mkdir project && tar -xzf PROJECT_BUNDLE -C project/
|
54
|
+
|
55
|
+
pushd project
|
56
|
+
git clone --recursive $(ls) git_repo
|
57
|
+
|
58
|
+
pushd git_repo
|
59
|
+
|
60
|
+
### Clone the packaging repo
|
61
|
+
rake package:bootstrap --trace
|
62
|
+
|
63
|
+
### Run repo creation
|
64
|
+
rake pl:jenkins:rpm_repos --trace
|
65
|
+
rake pl:jenkins:deb_repos --trace
|
66
|
+
|
67
|
+
popd
|
68
|
+
popd
|
69
|
+
|
70
|
+
# Delete the upstream project now that repos have been created. This is largely
|
71
|
+
# to avoid clutter and reclaim space
|
72
|
+
#
|
73
|
+
curl -i -X POST <%= "http://#{@build.jenkins_build_host}/job/#{@build.project}-packaging-#{@build.build_date}-#{@build.ref}" %>/doDelete
|
74
|
+
</command>
|
75
|
+
</hudson.tasks.Shell>
|
76
|
+
</builders><% if ENV['DOWNSTREAM_JOB'] %>
|
77
|
+
<publishers>
|
78
|
+
<hudson.tasks.BuildTrigger>
|
79
|
+
<childProjects><%= "#{@build.project}-downstream-#{@build.build_date}-#{@build.ref}" %></childProjects>
|
80
|
+
<threshold>
|
81
|
+
<name>SUCCESS</name>
|
82
|
+
<ordinal>0</ordinal>
|
83
|
+
<color>BLUE</color>
|
84
|
+
</threshold>
|
85
|
+
</hudson.tasks.BuildTrigger>
|
86
|
+
</publishers><% else %>
|
87
|
+
<publishers/><% end %>
|
88
|
+
<buildWrappers>
|
89
|
+
<hudson.plugins.ansicolor.AnsiColorBuildWrapper plugin="ansicolor@0.3.1">
|
90
|
+
<colorMapName>xterm</colorMapName>
|
91
|
+
</hudson.plugins.ansicolor.AnsiColorBuildWrapper>
|
92
|
+
</buildWrappers>
|
93
|
+
</project>
|
data/lib/puppet.rb
CHANGED
@@ -0,0 +1,97 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
|
3
|
+
module Puppet::FileSystem
|
4
|
+
class PathPattern
|
5
|
+
class InvalidPattern < Puppet::Error; end
|
6
|
+
|
7
|
+
TRAVERSAL = /^\.\.$/
|
8
|
+
ABSOLUTE_UNIX = /^\//
|
9
|
+
ABSOLUTE_WINDOWS = /^[a-z]:/i
|
10
|
+
#ABSOLUT_VODKA #notappearinginthisclass
|
11
|
+
CURRENT_DRIVE_RELATIVE_WINDOWS = /^\\/
|
12
|
+
|
13
|
+
def self.relative(pattern)
|
14
|
+
RelativePathPattern.new(pattern)
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.absolute(pattern)
|
18
|
+
AbsolutePathPattern.new(pattern)
|
19
|
+
end
|
20
|
+
|
21
|
+
class << self
|
22
|
+
protected :new
|
23
|
+
end
|
24
|
+
|
25
|
+
# @param prefix [AbsolutePathPattern] An absolute path pattern instance
|
26
|
+
# @return [AbsolutePathPattern] A new AbsolutePathPattern prepended with
|
27
|
+
# the passed prefix's pattern.
|
28
|
+
def prefix_with(prefix)
|
29
|
+
new_pathname = prefix.pathname + pathname
|
30
|
+
self.class.absolute(new_pathname.to_s)
|
31
|
+
end
|
32
|
+
|
33
|
+
def glob
|
34
|
+
Dir.glob(pathname.to_s)
|
35
|
+
end
|
36
|
+
|
37
|
+
def to_s
|
38
|
+
pathname.to_s
|
39
|
+
end
|
40
|
+
|
41
|
+
protected
|
42
|
+
|
43
|
+
attr_reader :pathname
|
44
|
+
|
45
|
+
private
|
46
|
+
|
47
|
+
def validate
|
48
|
+
@pathname.each_filename do |e|
|
49
|
+
if e =~ TRAVERSAL
|
50
|
+
raise(InvalidPattern, "PathPatterns cannot be created with directory traversals.")
|
51
|
+
end
|
52
|
+
end
|
53
|
+
case @pathname.to_s
|
54
|
+
when CURRENT_DRIVE_RELATIVE_WINDOWS
|
55
|
+
raise(InvalidPattern, "A PathPattern cannot be a Windows current drive relative path.")
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
def initialize(pattern)
|
60
|
+
begin
|
61
|
+
@pathname = Pathname.new(pattern.strip)
|
62
|
+
rescue ArgumentError => error
|
63
|
+
raise InvalidPattern.new("PathPatterns cannot be created with a zero byte.", error)
|
64
|
+
end
|
65
|
+
validate
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
class RelativePathPattern < PathPattern
|
70
|
+
def absolute?
|
71
|
+
false
|
72
|
+
end
|
73
|
+
|
74
|
+
def validate
|
75
|
+
super
|
76
|
+
case @pathname.to_s
|
77
|
+
when ABSOLUTE_WINDOWS
|
78
|
+
raise(InvalidPattern, "A relative PathPattern cannot be prefixed with a drive.")
|
79
|
+
when ABSOLUTE_UNIX
|
80
|
+
raise(InvalidPattern, "A relative PathPattern cannot be an absolute path.")
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
class AbsolutePathPattern < PathPattern
|
86
|
+
def absolute?
|
87
|
+
true
|
88
|
+
end
|
89
|
+
|
90
|
+
def validate
|
91
|
+
super
|
92
|
+
if @pathname.to_s !~ ABSOLUTE_UNIX and @pathname.to_s !~ ABSOLUTE_WINDOWS
|
93
|
+
raise(InvalidPattern, "An absolute PathPattern cannot be a relative path.")
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|