puppet 3.0.0.rc5 → 3.0.0.rc7
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/LICENSE +1 -1
- data/README_DEVELOPER.md +209 -1
- data/README_HIERA.md +148 -0
- data/Rakefile +25 -27
- data/bin/extlookup2hiera +56 -0
- data/conf/auth.conf +34 -34
- data/examples/hiera/README.md +91 -0
- data/examples/hiera/etc/hiera.yaml +15 -0
- data/examples/hiera/etc/hieradb/common.yaml +3 -0
- data/examples/hiera/etc/hieradb/dc1.yaml +6 -0
- data/examples/hiera/etc/hieradb/development.yaml +2 -0
- data/examples/hiera/etc/puppet.conf +3 -0
- data/examples/hiera/modules/data/manifests/common.pp +3 -0
- data/examples/hiera/modules/ntp/manifests/config.pp +5 -0
- data/examples/hiera/modules/ntp/manifests/data.pp +3 -0
- data/examples/hiera/modules/ntp/templates/ntp.conf.erb +3 -0
- data/examples/hiera/modules/users/manifests/common.pp +3 -0
- data/examples/hiera/modules/users/manifests/dc1.pp +3 -0
- data/examples/hiera/modules/users/manifests/development.pp +3 -0
- data/examples/hiera/site.pp +3 -0
- data/ext/build_defaults.yaml +23 -0
- data/ext/debian/README.Debian +8 -0
- data/ext/debian/README.source +2 -0
- data/ext/debian/TODO.Debian +1 -0
- data/ext/debian/changelog.erb +1104 -0
- data/ext/debian/compat +1 -0
- data/ext/debian/control +143 -0
- data/ext/debian/copyright +361 -0
- data/ext/debian/docs +1 -0
- data/ext/debian/fileserver.conf +17 -0
- data/ext/debian/puppet-common.dirs +8 -0
- data/ext/debian/puppet-common.install +4 -0
- data/ext/debian/puppet-common.lintian-overrides +5 -0
- data/ext/debian/puppet-common.manpages +2 -0
- data/ext/debian/puppet-common.postinst +35 -0
- data/ext/debian/puppet-common.postrm +32 -0
- data/ext/debian/puppet-el.dirs +1 -0
- data/ext/debian/puppet-el.emacsen-install +25 -0
- data/ext/debian/puppet-el.emacsen-remove +11 -0
- data/ext/debian/puppet-el.emacsen-startup +9 -0
- data/ext/debian/puppet-el.install +1 -0
- data/ext/debian/puppet-testsuite.install +2 -0
- data/ext/debian/puppet-testsuite.lintian-overrides +4 -0
- data/ext/debian/puppet.conf +14 -0
- data/ext/debian/puppet.default +7 -0
- data/ext/debian/puppet.init +118 -0
- data/ext/debian/puppet.lintian-overrides +3 -0
- data/ext/debian/puppet.logrotate +11 -0
- data/ext/debian/puppet.manpages +32 -0
- data/ext/debian/puppet.postinst +20 -0
- data/ext/debian/puppet.postrm +20 -0
- data/ext/debian/puppet.preinst +20 -0
- data/ext/debian/puppetmaster-common.install +2 -0
- data/ext/debian/puppetmaster-common.manpages +2 -0
- data/ext/debian/puppetmaster-common.puppetqd.default +27 -0
- data/ext/debian/puppetmaster-common.puppetqd.init +84 -0
- data/ext/debian/puppetmaster-passenger.dirs +4 -0
- data/ext/debian/puppetmaster-passenger.postinst +66 -0
- data/ext/debian/puppetmaster-passenger.postrm +33 -0
- data/ext/debian/puppetmaster.README.debian +16 -0
- data/ext/debian/puppetmaster.default +38 -0
- data/ext/debian/puppetmaster.init +158 -0
- data/ext/debian/puppetmaster.lintian-overrides +3 -0
- data/ext/debian/puppetmaster.postinst +20 -0
- data/ext/debian/puppetmaster.postrm +5 -0
- data/ext/debian/puppetmaster.preinst +22 -0
- data/ext/debian/rules +128 -0
- data/ext/debian/source/format +1 -0
- data/ext/debian/source/options +1 -0
- data/ext/debian/vim-puppet.README.Debian +13 -0
- data/ext/debian/vim-puppet.dirs +3 -0
- data/ext/debian/vim-puppet.yaml +5 -0
- data/ext/debian/watch +2 -0
- data/ext/emacs/puppet-mode.el +1 -0
- data/ext/envpuppet +4 -0
- data/ext/envpuppet.bat +3 -2
- data/{conf → ext}/freebsd/puppetd +0 -0
- data/{conf → ext}/freebsd/puppetmasterd +0 -0
- data/{conf → ext}/gentoo/conf.d/puppet +0 -0
- data/{conf → ext}/gentoo/conf.d/puppetmaster +0 -0
- data/{conf → ext}/gentoo/init.d/puppet +0 -0
- data/{conf → ext}/gentoo/init.d/puppetmaster +0 -0
- data/{conf → ext}/gentoo/puppet/fileserver.conf +0 -0
- data/{conf → ext}/gentoo/puppet/puppet.conf +0 -0
- data/ext/ips/puppet-agent +49 -0
- data/ext/ips/puppet-master +44 -0
- data/ext/ips/puppet.conf +29 -0
- data/ext/ips/puppet.p5m.erb +12 -0
- data/ext/ips/puppetagent.xml +46 -0
- data/ext/ips/puppetmaster.xml +42 -0
- data/ext/ips/rules +19 -0
- data/ext/ips/transforms +34 -0
- data/{conf → ext}/osx/PackageInfo.plist +0 -0
- data/{conf → ext}/osx/createpackage.sh +1 -1
- data/ext/osx/file_mapping.yaml +33 -0
- data/ext/osx/preflight.erb +37 -0
- data/{tasks/rake/templates → ext/osx}/prototype.plist.erb +0 -0
- data/ext/packaging/README-Solaris.md +117 -0
- data/ext/packaging/README.md +89 -0
- data/ext/packaging/tasks/00_utils.rb +236 -0
- data/ext/packaging/tasks/10_setupvars.rake +62 -0
- data/ext/packaging/tasks/apple.rake +201 -0
- data/ext/packaging/tasks/clean.rake +5 -0
- data/ext/packaging/tasks/deb.rake +105 -0
- data/ext/packaging/tasks/gem.rake +52 -0
- data/ext/packaging/tasks/ips.rake +78 -0
- data/ext/packaging/tasks/mock.rake +88 -0
- data/ext/packaging/tasks/release.rake +20 -0
- data/ext/packaging/tasks/rpm.rake +39 -0
- data/ext/packaging/tasks/ship.rake +34 -0
- data/ext/packaging/tasks/sign.rake +76 -0
- data/ext/packaging/tasks/tar.rake +20 -0
- data/ext/project_data.yaml +25 -0
- data/ext/rack/files/apache2.conf +2 -1
- data/{conf → ext}/redhat/client.init +0 -0
- data/{conf → ext}/redhat/client.sysconfig +0 -0
- data/{conf → ext}/redhat/fileserver.conf +0 -0
- data/{conf → ext}/redhat/logrotate +0 -0
- data/{conf → ext}/redhat/puppet.conf +0 -0
- data/{conf/redhat/puppet.spec → ext/redhat/puppet.spec.erb} +140 -33
- data/{conf → ext}/redhat/queue.init +0 -0
- data/{conf → ext}/redhat/rundir-perms.patch +0 -0
- data/{conf → ext}/redhat/server.init +0 -0
- data/{conf → ext}/redhat/server.sysconfig +0 -0
- data/{conf → ext}/solaris/pkginfo +0 -0
- data/{conf → ext}/solaris/smf/puppetd.xml +0 -0
- data/{conf → ext}/solaris/smf/puppetmasterd.xml +0 -0
- data/{conf → ext}/solaris/smf/svc-puppetd +0 -0
- data/{conf → ext}/solaris/smf/svc-puppetmasterd +0 -0
- data/{conf → ext}/suse/client.init +0 -0
- data/{conf → ext}/suse/fileserver.conf +0 -0
- data/{conf → ext}/suse/logrotate +0 -0
- data/{conf → ext}/suse/puppet.conf +0 -0
- data/{conf → ext}/suse/puppet.spec +1 -1
- data/{conf → ext}/suse/server.init +0 -0
- data/ext/systemd/puppetagent.service +13 -0
- data/ext/systemd/puppetmaster.service +13 -0
- data/{conf → ext}/windows/eventlog/Rakefile +0 -0
- data/{conf → ext}/windows/eventlog/puppetres.dll +0 -0
- data/{conf → ext}/windows/eventlog/puppetres.mc +0 -0
- data/ext/windows/service/daemon.bat +6 -0
- data/ext/windows/service/daemon.rb +90 -0
- data/install.rb +22 -32
- data/lib/hiera/backend/puppet_backend.rb +102 -0
- data/lib/hiera/scope.rb +42 -0
- data/lib/hiera_puppet.rb +89 -0
- data/lib/puppet.rb +1 -1
- data/lib/puppet/agent.rb +2 -2
- data/lib/puppet/agent/locker.rb +12 -9
- data/lib/puppet/application.rb +10 -8
- data/lib/puppet/application/agent.rb +12 -8
- data/lib/puppet/application/apply.rb +2 -2
- data/lib/puppet/application/cert.rb +6 -6
- data/lib/puppet/application/certificate.rb +1 -4
- data/lib/puppet/application/describe.rb +1 -1
- data/lib/puppet/application/device.rb +5 -2
- data/lib/puppet/application/doc.rb +1 -1
- data/lib/puppet/application/face_base.rb +3 -13
- data/lib/puppet/application/filebucket.rb +1 -1
- data/lib/puppet/application/inspect.rb +1 -1
- data/lib/puppet/application/kick.rb +4 -2
- data/lib/puppet/application/master.rb +2 -2
- data/lib/puppet/application/queue.rb +3 -1
- data/lib/puppet/application/resource.rb +1 -1
- data/lib/puppet/configurer.rb +11 -7
- data/lib/puppet/configurer/downloader.rb +1 -4
- data/lib/puppet/daemon.rb +4 -4
- data/lib/puppet/defaults.rb +64 -60
- data/lib/puppet/external/dot.rb +1 -1
- data/lib/puppet/external/pson/common.rb +15 -0
- data/lib/puppet/external/pson/pure.rb +0 -62
- data/lib/puppet/external/pson/pure/generator.rb +1 -1
- data/lib/puppet/external/pson/pure/parser.rb +2 -2
- data/lib/puppet/face/ca.rb +19 -14
- data/lib/puppet/face/config.rb +2 -2
- data/lib/puppet/face/facts.rb +1 -1
- data/lib/puppet/face/help/action.erb +0 -1
- data/lib/puppet/face/help/face.erb +0 -1
- data/lib/puppet/face/help/man.erb +3 -6
- data/lib/puppet/face/module/install.rb +1 -1
- data/lib/puppet/face/module/list.rb +1 -1
- data/lib/puppet/face/module/uninstall.rb +1 -1
- data/lib/puppet/face/node.rb +1 -1
- data/lib/puppet/face/node/clean.rb +30 -25
- data/lib/puppet/feature/base.rb +0 -3
- data/lib/puppet/feature/rails.rb +2 -1
- data/lib/puppet/file_serving/terminus_selector.rb +1 -1
- data/lib/puppet/indirector/catalog/active_record.rb +5 -0
- data/lib/puppet/indirector/catalog/static_compiler.rb +2 -3
- data/lib/puppet/indirector/certificate/disabled_ca.rb +22 -0
- data/lib/puppet/indirector/certificate_request/disabled_ca.rb +22 -0
- data/lib/puppet/indirector/certificate_revocation_list/disabled_ca.rb +22 -0
- data/lib/puppet/indirector/face.rb +3 -3
- data/lib/puppet/indirector/facts/active_record.rb +5 -0
- data/lib/puppet/indirector/facts/facter.rb +1 -4
- data/lib/puppet/indirector/facts/inventory_active_record.rb +6 -0
- data/lib/puppet/indirector/file_bucket_file/file.rb +2 -1
- data/lib/puppet/indirector/indirection.rb +2 -2
- data/lib/puppet/indirector/key/disabled_ca.rb +22 -0
- data/lib/puppet/indirector/node/active_record.rb +5 -0
- data/lib/puppet/indirector/request.rb +4 -0
- data/lib/puppet/indirector/resource/active_record.rb +5 -0
- data/lib/puppet/network/authentication.rb +30 -0
- data/lib/puppet/network/http.rb +0 -13
- data/lib/puppet/network/http/connection.rb +10 -2
- data/lib/puppet/network/http/handler.rb +8 -0
- data/lib/puppet/network/http/mongrel/rest.rb +5 -0
- data/lib/puppet/network/http/rack/rest.rb +7 -0
- data/lib/puppet/network/http/webrick.rb +3 -6
- data/lib/puppet/network/http/webrick/rest.rb +4 -0
- data/lib/puppet/network/server.rb +9 -33
- data/lib/puppet/node.rb +1 -1
- data/lib/puppet/node/facts.rb +0 -1
- data/lib/puppet/parser/compiler.rb +1 -1
- data/lib/puppet/parser/functions.rb +12 -1
- data/lib/puppet/parser/functions/hiera.rb +8 -0
- data/lib/puppet/parser/functions/hiera_array.rb +8 -0
- data/lib/puppet/parser/functions/hiera_hash.rb +8 -0
- data/lib/puppet/parser/functions/hiera_include.rb +11 -0
- data/lib/puppet/parser/functions/shellquote.rb +21 -29
- data/lib/puppet/parser/lexer.rb +2 -1
- data/lib/puppet/parser/scope.rb +8 -0
- data/lib/puppet/provider/exec/windows.rb +1 -1
- data/lib/puppet/provider/group/groupadd.rb +2 -3
- data/lib/puppet/provider/package/pkg.rb +37 -10
- data/lib/puppet/provider/service/daemontools.rb +1 -1
- data/lib/puppet/provider/service/launchd.rb +1 -1
- data/lib/puppet/provider/service/redhat.rb +1 -1
- data/lib/puppet/provider/service/runit.rb +1 -1
- data/lib/puppet/provider/user/useradd.rb +8 -3
- data/lib/puppet/provider/user/windows_adsi.rb +11 -0
- data/lib/puppet/provider/zfs/zfs.rb +29 -2
- data/lib/puppet/provider/zone/solaris.rb +144 -39
- data/lib/puppet/provider/zpool/zpool.rb +7 -10
- data/lib/puppet/settings.rb +50 -86
- data/lib/puppet/settings/duration_setting.rb +34 -0
- data/lib/puppet/settings/terminus_setting.rb +16 -0
- data/lib/puppet/ssl/base.rb +49 -9
- data/lib/puppet/ssl/certificate.rb +13 -9
- data/lib/puppet/ssl/certificate_authority.rb +4 -0
- data/lib/puppet/ssl/certificate_authority/interface.rb +10 -17
- data/lib/puppet/ssl/certificate_factory.rb +4 -21
- data/lib/puppet/ssl/certificate_request.rb +1 -10
- data/lib/puppet/ssl/certificate_revocation_list.rb +1 -3
- data/lib/puppet/ssl/digest.rb +20 -0
- data/lib/puppet/ssl/host.rb +31 -6
- data/lib/puppet/test/test_helper.rb +1 -1
- data/lib/puppet/transaction/report.rb +2 -1
- data/lib/puppet/type.rb +1 -1
- data/lib/puppet/type/augeas.rb +1 -1
- data/lib/puppet/type/cron.rb +1 -1
- data/lib/puppet/type/exec.rb +7 -8
- data/lib/puppet/type/file.rb +1 -1
- data/lib/puppet/type/file/content.rb +2 -2
- data/lib/puppet/type/file/ensure.rb +1 -1
- data/lib/puppet/type/file/mode.rb +1 -1
- data/lib/puppet/type/file/selcontext.rb +6 -2
- data/lib/puppet/type/file/source.rb +1 -1
- data/lib/puppet/type/schedule.rb +1 -1
- data/lib/puppet/type/scheduled_task.rb +1 -1
- data/lib/puppet/type/tidy.rb +1 -1
- data/lib/puppet/type/zone.rb +126 -253
- data/lib/puppet/util.rb +10 -23
- data/lib/puppet/util/adsi.rb +22 -14
- data/lib/puppet/util/log/destinations.rb +7 -0
- data/lib/puppet/util/log/rate_limited_logger.rb +40 -0
- data/lib/puppet/util/metric.rb +2 -2
- data/lib/puppet/util/monkey_patches.rb +8 -0
- data/lib/puppet/util/platform.rb +7 -0
- data/lib/puppet/util/selinux.rb +31 -36
- data/lib/puppet/util/windows/error.rb +1 -1
- data/lib/puppet/util/windows/process.rb +3 -3
- data/lib/puppet/util/windows/security.rb +7 -7
- data/lib/puppet/util/windows/user.rb +65 -2
- data/lib/puppet/util/zaml.rb +90 -46
- data/lib/puppet/version.rb +1 -1
- data/spec/fixtures/hiera.yaml +9 -0
- data/spec/fixtures/manifests/site.pp +0 -0
- data/spec/integration/defaults_spec.rb +25 -11
- data/spec/integration/faces/ca_spec.rb +11 -16
- data/spec/integration/network/server/webrick_spec.rb +14 -27
- data/spec/integration/node_spec.rb +4 -1
- data/spec/integration/parser/functions/require_spec.rb +3 -3
- data/spec/integration/parser/undef_param_spec.rb +88 -0
- data/spec/integration/provider/mount_spec.rb +4 -1
- data/spec/integration/ssl/certificate_authority_spec.rb +18 -0
- data/spec/lib/puppet_spec/files.rb +3 -3
- data/spec/lib/puppet_spec/settings.rb +0 -1
- data/spec/shared_contexts/platform.rb +8 -0
- data/spec/spec_helper.rb +6 -0
- data/spec/unit/agent/locker_spec.rb +8 -2
- data/spec/unit/application/agent_spec.rb +29 -7
- data/spec/unit/application/apply_spec.rb +1 -1
- data/spec/unit/application/device_spec.rb +18 -1
- data/spec/unit/application/face_base_spec.rb +16 -2
- data/spec/unit/application/kick_spec.rb +8 -0
- data/spec/unit/application/queue_spec.rb +5 -0
- data/spec/unit/application_spec.rb +13 -23
- data/spec/unit/configurer/downloader_spec.rb +2 -11
- data/spec/unit/configurer_spec.rb +6 -0
- data/spec/unit/face/node_spec.rb +1 -1
- data/spec/unit/hiera/backend/puppet_backend_spec.rb +140 -0
- data/spec/unit/hiera/scope_spec.rb +62 -0
- data/spec/unit/hiera_puppet_spec.rb +111 -0
- data/spec/unit/indirector/catalog/active_record_spec.rb +4 -0
- data/spec/unit/indirector/catalog/static_compiler_spec.rb +194 -0
- data/spec/unit/indirector/certificate/disabled_ca_spec.rb +33 -0
- data/spec/unit/indirector/certificate_request/disabled_ca_spec.rb +33 -0
- data/spec/unit/indirector/certificate_revocation_list/disabled_ca_spec.rb +33 -0
- data/spec/unit/indirector/facts/active_record_spec.rb +37 -26
- data/spec/unit/indirector/facts/inventory_active_record_spec.rb +5 -0
- data/spec/unit/indirector/hiera_spec.rb +2 -1
- data/spec/unit/indirector/key/disabled_ca_spec.rb +33 -0
- data/spec/unit/indirector/node/active_record_spec.rb +7 -0
- data/spec/unit/indirector/request_spec.rb +22 -0
- data/spec/unit/indirector/resource/active_record_spec.rb +5 -0
- data/spec/unit/module_tool/application_spec.rb +1 -1
- data/spec/unit/network/authentication_spec.rb +86 -0
- data/spec/unit/network/http/connection_spec.rb +21 -0
- data/spec/unit/network/http/handler_spec.rb +12 -0
- data/spec/unit/network/http/rack/rest_spec.rb +7 -0
- data/spec/unit/network/http/webrick_spec.rb +11 -26
- data/spec/unit/network/server_spec.rb +79 -192
- data/spec/unit/node/facts_spec.rb +2 -2
- data/spec/unit/parser/ast/vardef_spec.rb +4 -4
- data/spec/unit/parser/files_spec.rb +3 -0
- data/spec/unit/parser/functions/defined_spec.rb +5 -5
- data/spec/unit/parser/functions/fqdn_rand_spec.rb +1 -1
- data/spec/unit/parser/functions/hiera_array_spec.rb +23 -0
- data/spec/unit/parser/functions/hiera_hash_spec.rb +19 -0
- data/spec/unit/parser/functions/hiera_include_spec.rb +19 -0
- data/spec/unit/parser/functions/hiera_spec.rb +21 -0
- data/spec/unit/parser/functions/include_spec.rb +3 -3
- data/spec/unit/parser/functions/realize_spec.rb +3 -3
- data/spec/unit/parser/functions/require_spec.rb +5 -5
- data/spec/unit/parser/functions/shellquote_spec.rb +0 -4
- data/spec/unit/parser/functions_spec.rb +6 -10
- data/spec/unit/parser/lexer_spec.rb +13 -0
- data/spec/unit/parser/scope_spec.rb +16 -1
- data/spec/unit/provider/exec/posix_spec.rb +7 -6
- data/spec/unit/provider/group/groupadd_spec.rb +36 -30
- data/spec/unit/provider/package/pkg_spec.rb +16 -2
- data/spec/unit/provider/service/redhat_spec.rb +2 -2
- data/spec/unit/provider/sshkey/parsed_spec.rb +4 -0
- data/spec/unit/provider/user/user_role_add_spec.rb +125 -126
- data/spec/unit/provider/user/useradd_spec.rb +147 -118
- data/spec/unit/provider/user/windows_adsi_spec.rb +22 -0
- data/spec/unit/provider/zone/solaris_spec.rb +126 -7
- data/spec/unit/provider/zpool/zpool_spec.rb +4 -3
- data/spec/unit/puppet_spec.rb +7 -0
- data/spec/unit/settings/duration_setting_spec.rb +45 -0
- data/spec/unit/settings/terminus_setting_spec.rb +28 -0
- data/spec/unit/settings_spec.rb +21 -23
- data/spec/unit/ssl/base_spec.rb +68 -19
- data/spec/unit/ssl/certificate_authority/interface_spec.rb +19 -30
- data/spec/unit/ssl/certificate_authority_spec.rb +3 -2
- data/spec/unit/ssl/certificate_factory_spec.rb +15 -6
- data/spec/unit/ssl/certificate_request_spec.rb +80 -113
- data/spec/unit/ssl/certificate_revocation_list_spec.rb +1 -1
- data/spec/unit/ssl/certificate_spec.rb +26 -2
- data/spec/unit/ssl/digest_spec.rb +35 -0
- data/spec/unit/ssl/host_spec.rb +73 -27
- data/spec/unit/ssl/key_spec.rb +0 -4
- data/spec/unit/type/exec_spec.rb +1 -1
- data/spec/unit/type/file_spec.rb +2 -1
- data/spec/unit/type/scheduled_task_spec.rb +2 -2
- data/spec/unit/type/zone_spec.rb +52 -10
- data/spec/unit/util/adsi_spec.rb +19 -0
- data/spec/unit/util/checksums_spec.rb +2 -3
- data/spec/unit/util/execution_spec.rb +1 -1
- data/spec/unit/util/log/destinations_spec.rb +1 -0
- data/spec/unit/util/log/rate_limited_logger_spec.rb +51 -0
- data/spec/unit/util/logging_spec.rb +6 -6
- data/spec/unit/util/selinux_spec.rb +24 -32
- data/spec/unit/util/zaml_spec.rb +94 -6
- data/spec/unit/util_spec.rb +17 -0
- data/spec/watchr.rb +2 -6
- data/tasks/{rake/manpages.rake → manpages.rake} +0 -0
- data/tasks/{rake/parser.rake → parser.rake} +0 -0
- metadata +1003 -119
- data/CHANGELOG +0 -9233
- data/conf/osx/preflight +0 -24
- data/lib/puppet/network/http/mongrel.rb +0 -35
- data/lib/puppet/util/config_timeout.rb +0 -24
- data/spec/unit/network/http/mongrel/rest_spec.rb +0 -257
- data/spec/unit/network/http/mongrel_spec.rb +0 -91
- data/spec/unit/network/http_spec.rb +0 -31
- data/spec/unit/util/config_timeout_spec.rb +0 -57
- data/tasks/rake/apple.rake +0 -176
- data/tasks/rake/changelog.rake +0 -15
- data/tasks/rake/ci.rake +0 -22
- data/tasks/rake/dailybuild.rake +0 -9
- data/tasks/rake/gem.rake +0 -63
- data/tasks/rake/git_workflow.rake +0 -134
- data/tasks/rake/metrics.rake +0 -14
- data/tasks/rake/sign.rake +0 -14
- data/tasks/rake/testbranch.rake +0 -16
- data/tasks/rake/yard.rake +0 -11
@@ -1,57 +0,0 @@
|
|
1
|
-
#! /usr/bin/env ruby -S rspec
|
2
|
-
require 'spec_helper'
|
3
|
-
require 'puppet/util/config_timeout'
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
describe Puppet::Util::ConfigTimeout do
|
8
|
-
# NOTE: in the future it might be a good idea to add an explicit "integer" type to
|
9
|
-
# the settings types, in which case this would no longer be necessary.
|
10
|
-
|
11
|
-
|
12
|
-
class TestConfigTimeout
|
13
|
-
include Puppet::Util::ConfigTimeout
|
14
|
-
end
|
15
|
-
|
16
|
-
let :instance do TestConfigTimeout.new end
|
17
|
-
|
18
|
-
|
19
|
-
context "when the config setting is a String" do
|
20
|
-
context "which contains an integer" do
|
21
|
-
it "should convert the string to an integer" do
|
22
|
-
Puppet[:configtimeout] = "12"
|
23
|
-
instance.timeout_interval.should == 12
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
context "which does not contain an integer do" do
|
28
|
-
it "should raise an ArgumentError" do
|
29
|
-
Puppet[:configtimeout] = "foo"
|
30
|
-
expect {
|
31
|
-
instance.timeout_interval
|
32
|
-
}.to raise_error(ArgumentError)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
context "when the config setting is an Integer" do
|
38
|
-
it "should return the integer" do
|
39
|
-
Puppet[:configtimeout] = 12
|
40
|
-
instance.timeout_interval.should == 12
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
context "when the config setting is some other type" do
|
45
|
-
# test a random smattering of types
|
46
|
-
[Hash.new, Array.new, Object.new].each do |obj|
|
47
|
-
context "when the config setting is a #{obj.class}" do
|
48
|
-
it "should raise an ArgumentError" do
|
49
|
-
Puppet[:configtimeout] = Hash.new
|
50
|
-
expect {
|
51
|
-
instance.timeout_interval
|
52
|
-
}.to raise_error(ArgumentError)
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
data/tasks/rake/apple.rake
DELETED
@@ -1,176 +0,0 @@
|
|
1
|
-
# Title: Rake task to build Apple packages for Puppet.
|
2
|
-
# Author: Gary Larizza
|
3
|
-
# Date: 12/5/2011
|
4
|
-
# Description: This task will create a DMG-encapsulated package that will
|
5
|
-
# install Puppet on OS X systems. This happens by building
|
6
|
-
# a directory tree of files that will then be fed to the
|
7
|
-
# packagemaker binary (can be installed by installing the
|
8
|
-
# XCode Tools) which will create the .pkg file.
|
9
|
-
#
|
10
|
-
require 'fileutils'
|
11
|
-
require 'erb'
|
12
|
-
require 'find'
|
13
|
-
require 'pathname'
|
14
|
-
|
15
|
-
# Path to Binaries (Constants)
|
16
|
-
TAR = '/usr/bin/tar'
|
17
|
-
CP = '/bin/cp'
|
18
|
-
INSTALL = '/usr/bin/install'
|
19
|
-
DITTO = '/usr/bin/ditto'
|
20
|
-
PACKAGEMAKER = '/Developer/usr/bin/packagemaker'
|
21
|
-
SED = '/usr/bin/sed'
|
22
|
-
|
23
|
-
# Setup task to populate all the variables
|
24
|
-
task :setup do
|
25
|
-
@version = `git describe`.chomp
|
26
|
-
@title = "puppet-#{@version}"
|
27
|
-
@reverse_domain = 'com.puppetlabs.puppet'
|
28
|
-
@package_major_version = @version.split('.')[0]
|
29
|
-
@package_minor_version = @version.split('.')[1] +
|
30
|
-
@version.split('.')[2].split('-')[0].split('rc')[0]
|
31
|
-
@pm_restart = 'None'
|
32
|
-
@build_date = Time.new.strftime("%Y-%m-%dT%H:%M:%SZ")
|
33
|
-
end
|
34
|
-
|
35
|
-
# method: make_directory_tree
|
36
|
-
# description: This method sets up the directory structure that packagemaker
|
37
|
-
# needs to build a package. A prototype.plist file (holding
|
38
|
-
# package-specific options) is built from an ERB template located
|
39
|
-
# in the tasks/rake/templates directory.
|
40
|
-
def make_directory_tree
|
41
|
-
puppet_tmp = '/tmp/puppet'
|
42
|
-
@scratch = "#{puppet_tmp}/#{@title}"
|
43
|
-
@working_tree = {
|
44
|
-
'scripts' => "#{@scratch}/scripts",
|
45
|
-
'resources' => "#{@scratch}/resources",
|
46
|
-
'working' => "#{@scratch}/root",
|
47
|
-
'payload' => "#{@scratch}/payload",
|
48
|
-
}
|
49
|
-
puts "Cleaning Tree: #{puppet_tmp}"
|
50
|
-
FileUtils.rm_rf(puppet_tmp)
|
51
|
-
@working_tree.each do |key,val|
|
52
|
-
puts "Creating: #{val}"
|
53
|
-
FileUtils.mkdir_p(val)
|
54
|
-
end
|
55
|
-
File.open("#{@scratch}/#{'prototype.plist'}", "w+") do |f|
|
56
|
-
f.write(ERB.new(File.read('tasks/rake/templates/prototype.plist.erb')).result())
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
# method: build_dmg
|
61
|
-
# description: This method builds a package from the directory structure in
|
62
|
-
# /tmp/puppet and puts it in the
|
63
|
-
# /tmp/puppet/puppet-#{version}/payload directory. A DMG is
|
64
|
-
# created, using hdiutil, based on the contents of the
|
65
|
-
# /tmp/puppet/puppet-#{version}/payload directory. The resultant
|
66
|
-
# DMG is placed in the pkg/apple directory.
|
67
|
-
#
|
68
|
-
def build_dmg
|
69
|
-
# Local Variables
|
70
|
-
dmg_format_code = 'UDZO'
|
71
|
-
zlib_level = '9'
|
72
|
-
dmg_format_option = "-imagekey zlib-level=#{zlib_level}"
|
73
|
-
dmg_format = "#{dmg_format_code} #{dmg_format_option}"
|
74
|
-
dmg_file = "#{@title}.dmg"
|
75
|
-
package_file = "#{@title}.pkg"
|
76
|
-
pm_extra_args = '--verbose --no-recommend --no-relocate'
|
77
|
-
package_target_os = '10.5'
|
78
|
-
|
79
|
-
# Build .pkg file
|
80
|
-
system("sudo #{PACKAGEMAKER} --root #{@working_tree['working']} \
|
81
|
-
--id #{@reverse_domain} \
|
82
|
-
--filter DS_Store \
|
83
|
-
--target #{package_target_os} \
|
84
|
-
--title #{@title} \
|
85
|
-
--info #{@scratch}/prototype.plist \
|
86
|
-
--scripts #{@working_tree['scripts']} \
|
87
|
-
--resources #{@working_tree['resources']} \
|
88
|
-
--version #{@version} \
|
89
|
-
#{pm_extra_args} --out #{@working_tree['payload']}/#{package_file}")
|
90
|
-
|
91
|
-
# Build .dmg file
|
92
|
-
system("sudo hdiutil create -volname #{@title} \
|
93
|
-
-srcfolder #{@working_tree['payload']} \
|
94
|
-
-uid 99 \
|
95
|
-
-gid 99 \
|
96
|
-
-ov \
|
97
|
-
-format #{dmg_format} \
|
98
|
-
#{dmg_file}")
|
99
|
-
|
100
|
-
if File.directory?("#{Pathname.pwd}/pkg/apple")
|
101
|
-
FileUtils.mv("#{Pathname.pwd}/#{dmg_file}", "#{Pathname.pwd}/pkg/apple/#{dmg_file}")
|
102
|
-
puts "moved: #{dmg_file} has been moved to #{Pathname.pwd}/pkg/apple/#{dmg_file}"
|
103
|
-
else
|
104
|
-
FileUtils.mkdir_p("#{Pathname.pwd}/pkg/apple")
|
105
|
-
FileUtils.mv(dmg_file, "#{Pathname.pwd}/pkg/apple/#{dmg_file}")
|
106
|
-
puts "moved: #{dmg_file} has been moved to #{Pathname.pwd}/pkg/apple/#{dmg_file}"
|
107
|
-
end
|
108
|
-
end
|
109
|
-
|
110
|
-
# method: pack_puppet_source
|
111
|
-
# description: This method copies the puppet source into a directory
|
112
|
-
# structure in /tmp/puppet/puppet-#{version}/root mirroring the
|
113
|
-
# structure on the target system for which the package will be
|
114
|
-
# installed. Anything installed into /tmp/puppet/root will be
|
115
|
-
# installed as the package's payload.
|
116
|
-
#
|
117
|
-
def pack_puppet_source
|
118
|
-
work = "#{@working_tree['working']}"
|
119
|
-
puppet_source = Pathname.pwd
|
120
|
-
|
121
|
-
# Make all necessary directories
|
122
|
-
directories = ["#{work}/private/etc/puppet/",
|
123
|
-
"#{work}/usr/bin",
|
124
|
-
"#{work}/usr/sbin",
|
125
|
-
"#{work}/usr/share/doc/puppet",
|
126
|
-
"#{work}/usr/share/man/man5",
|
127
|
-
"#{work}/usr/share/man/man8",
|
128
|
-
"#{work}/usr/lib/ruby/site_ruby/1.8/puppet"]
|
129
|
-
FileUtils.mkdir_p(directories)
|
130
|
-
|
131
|
-
# Install necessary files
|
132
|
-
system("#{INSTALL} -o root -g wheel -m 644 #{puppet_source}/conf/auth.conf #{work}/private/etc/puppet/auth.conf")
|
133
|
-
system("#{DITTO} #{puppet_source}/bin/ #{work}/usr/bin")
|
134
|
-
system("#{DITTO} #{puppet_source}/sbin/ #{work}/usr/sbin")
|
135
|
-
system("#{INSTALL} -o root -g wheel -m 644 #{puppet_source}/man/man5/puppet.conf.5 #{work}/usr/share/man/man5/")
|
136
|
-
system("#{DITTO} #{puppet_source}/man/man8/ #{work}/usr/share/man/man8")
|
137
|
-
system("#{DITTO} #{puppet_source}/lib/ #{work}/usr/lib/ruby/site_ruby/1.8/")
|
138
|
-
|
139
|
-
# Setup a preflight script and replace variables in the files with
|
140
|
-
# the correct paths.
|
141
|
-
system("#{INSTALL} -o root -g wheel -m 644 #{puppet_source}/conf/osx/preflight #{@working_tree['scripts']}")
|
142
|
-
system("#{SED} -i '' \"s\#{SITELIBDIR}\#/usr/lib/ruby/site_ruby/1.8\#g\" #{@working_tree['scripts']}/preflight")
|
143
|
-
system("#{SED} -i '' \"s\#{BINDIR}\#/usr/bin\#g\" #{@working_tree['scripts']}/preflight")
|
144
|
-
|
145
|
-
# Install documentation (matching for files with capital letters)
|
146
|
-
Dir.foreach("#{puppet_source}") do |file|
|
147
|
-
system("#{INSTALL} -o root -g wheel -m 644 #{puppet_source}/#{file} #{work}/usr/share/doc/puppet") if file =~ /^[A-Z][A-Z]/
|
148
|
-
end
|
149
|
-
|
150
|
-
# Set Permissions
|
151
|
-
executable_directories = [ "#{work}/usr/bin",
|
152
|
-
"#{work}/usr/sbin",
|
153
|
-
"#{work}/usr/share/man/man8"]
|
154
|
-
FileUtils.chmod_R(0755, executable_directories)
|
155
|
-
FileUtils.chown_R('root', 'wheel', directories)
|
156
|
-
FileUtils.chmod_R(0644, "#{work}/usr/lib/ruby/site_ruby/1.8/")
|
157
|
-
FileUtils.chown_R('root', 'wheel', "#{work}/usr/lib/ruby/site_ruby/1.8/")
|
158
|
-
Find.find("#{work}/usr/lib/ruby/site_ruby/1.8/") do |dir|
|
159
|
-
FileUtils.chmod(0755, dir) if File.directory?(dir)
|
160
|
-
end
|
161
|
-
end
|
162
|
-
|
163
|
-
namespace :package do
|
164
|
-
desc "Task for building an Apple Package"
|
165
|
-
task :apple => [:setup] do
|
166
|
-
# Test for Root and Packagemaker binary
|
167
|
-
raise "Please run rake as root to build Apple Packages" unless Process.uid == 0
|
168
|
-
raise "Packagemaker must be installed. Please install XCode Tools" unless \
|
169
|
-
File.exists?('/Developer/usr/bin/packagemaker')
|
170
|
-
|
171
|
-
make_directory_tree
|
172
|
-
pack_puppet_source
|
173
|
-
build_dmg
|
174
|
-
FileUtils.chmod_R(0775, "#{Pathname.pwd}/pkg")
|
175
|
-
end
|
176
|
-
end
|
data/tasks/rake/changelog.rake
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
desc "Create a ChangeLog based on git commits."
|
2
|
-
task :changelog do
|
3
|
-
begin
|
4
|
-
gitc = %x{which git-changelog}
|
5
|
-
rescue
|
6
|
-
puts "This task needs the git-changelog binary - http://github.com/ReinH/git-changelog"
|
7
|
-
end
|
8
|
-
|
9
|
-
CHANGELOG_DIR = "#{Dir.pwd}"
|
10
|
-
mkdir(CHANGELOG_DIR) unless File.directory?(CHANGELOG_DIR)
|
11
|
-
change_body = `git-changelog --limit=99999`
|
12
|
-
File.open(File.join(CHANGELOG_DIR, "CHANGELOG"), 'w') do |f|
|
13
|
-
f << change_body
|
14
|
-
end
|
15
|
-
end
|
data/tasks/rake/ci.rake
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
desc "Prep CI RSpec tests"
|
2
|
-
task :ci_prep do
|
3
|
-
require 'rubygems'
|
4
|
-
begin
|
5
|
-
gem 'ci_reporter'
|
6
|
-
require 'ci/reporter/rake/rspec'
|
7
|
-
require 'ci/reporter/rake/test_unit'
|
8
|
-
ENV['CI_REPORTS'] = 'results'
|
9
|
-
rescue LoadError
|
10
|
-
puts 'Missing ci_reporter gem. You must have the ci_reporter gem installed to run the CI spec tests'
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
desc "Run the CI RSpec tests"
|
15
|
-
task :ci_spec => [:ci_prep, 'ci:setup:rspec', :spec] do
|
16
|
-
sh "exit 0"
|
17
|
-
end
|
18
|
-
|
19
|
-
desc "Run CI Unit tests"
|
20
|
-
task :ci_unit => [:ci_prep, 'ci:setup:testunit'] do
|
21
|
-
sh "cd test; rake test; exit 0"
|
22
|
-
end
|
data/tasks/rake/dailybuild.rake
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
desc "Create a Puppet daily build"
|
2
|
-
task :daily => :changelog do
|
3
|
-
version = "puppet" + "-" + Time.now.localtime.strftime("%Y%m%d")
|
4
|
-
sh "git archive --format=tar --prefix=#{version}/ HEAD^{tree} >#{version}.tar"
|
5
|
-
sh "pax -waf #{version}.tar -s ':^:#{version}/:' ChangeLog"
|
6
|
-
sh "rm ChangeLog"
|
7
|
-
sh "gzip -f -9 #{version}.tar"
|
8
|
-
end
|
9
|
-
|
data/tasks/rake/gem.rake
DELETED
@@ -1,63 +0,0 @@
|
|
1
|
-
require 'fileutils'
|
2
|
-
require 'puppet/version'
|
3
|
-
|
4
|
-
GEM_FILES = FileList[
|
5
|
-
'[A-Z]*',
|
6
|
-
'install.rb',
|
7
|
-
'bin/**/*',
|
8
|
-
'lib/**/*',
|
9
|
-
'conf/**/*',
|
10
|
-
'man/**/*',
|
11
|
-
'examples/**/*',
|
12
|
-
'ext/**/*',
|
13
|
-
'tasks/**/*',
|
14
|
-
'test/**/*',
|
15
|
-
'spec/**/*'
|
16
|
-
]
|
17
|
-
|
18
|
-
EXECUTABLES = FileList[
|
19
|
-
'bin/**/*',
|
20
|
-
'sbin/**/*'
|
21
|
-
]
|
22
|
-
|
23
|
-
SBIN = Dir.glob("sbin/*")
|
24
|
-
|
25
|
-
spec = Gem::Specification.new do |spec|
|
26
|
-
spec.platform = Gem::Platform::RUBY
|
27
|
-
spec.name = 'puppet'
|
28
|
-
spec.files = GEM_FILES.to_a
|
29
|
-
spec.executables = EXECUTABLES.gsub(/sbin\/|bin\//, '').to_a
|
30
|
-
spec.version = Puppet.version
|
31
|
-
spec.add_dependency('facter', '>= 1.6.11')
|
32
|
-
spec.add_dependency('hiera', '>= 1.0.0rc')
|
33
|
-
spec.add_dependency('hiera-puppet', '>= 1.0.0rc')
|
34
|
-
spec.summary = 'Puppet, an automated configuration management tool'
|
35
|
-
spec.description = 'Puppet, an automated configuration management tool'
|
36
|
-
spec.author = 'Puppet Labs'
|
37
|
-
spec.email = 'puppet@puppetlabs.com'
|
38
|
-
spec.homepage = 'http://puppetlabs.com'
|
39
|
-
spec.rubyforge_project = 'puppet'
|
40
|
-
spec.has_rdoc = true
|
41
|
-
spec.rdoc_options <<
|
42
|
-
'--title' << 'Puppet - Configuration Management' <<
|
43
|
-
'--main' << 'README' <<
|
44
|
-
'--line-numbers'
|
45
|
-
end
|
46
|
-
|
47
|
-
desc "Prepare binaries for gem creation"
|
48
|
-
task :prepare_gem do
|
49
|
-
SBIN.each do |f|
|
50
|
-
FileUtils.copy(f,"bin")
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
desc "Create the gem"
|
55
|
-
task :gem => :prepare_gem do
|
56
|
-
Dir.mkdir("pkg") rescue nil
|
57
|
-
Gem::Builder.new(spec).build
|
58
|
-
FileUtils.move("puppet-#{Puppet.version}.gem", "pkg")
|
59
|
-
SBIN.each do |f|
|
60
|
-
fn = f.gsub(/sbin\/(.*)/, '\1')
|
61
|
-
FileUtils.rm_r "bin/" + fn
|
62
|
-
end
|
63
|
-
end
|
@@ -1,134 +0,0 @@
|
|
1
|
-
# This set of tasks helps automate the workflow as described on
|
2
|
-
# http://projects.puppetlabs.com/projects/puppet/wiki/Development_Lifecycle
|
3
|
-
|
4
|
-
|
5
|
-
def find_start(start)
|
6
|
-
# This is a case statement, as we might want to map certain
|
7
|
-
# git tags to starting points that are not currently in git.
|
8
|
-
case start
|
9
|
-
when nil?;
|
10
|
-
when @next_release; return "master"
|
11
|
-
else return start
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
desc "Set up git for working with Puppet"
|
16
|
-
task :git_setup do
|
17
|
-
# This should be changed as new versions get released
|
18
|
-
@next_release = '0.26.x'
|
19
|
-
@remote = {}
|
20
|
-
default_remote = {}
|
21
|
-
default_remote[:url] = 'git://github.com/reductivelabs/puppet'
|
22
|
-
default_remote[:name] = 'origin'
|
23
|
-
@remote[:name] = %x{git config puppet.defaultremote}.chomp
|
24
|
-
@remote[:name] = @remote[:name].empty? ? default_remote[:name] : @remote[:name]
|
25
|
-
@remote[:url] = default_remote[:url] if @remote[:name] == default_remote[:name]
|
26
|
-
default_fetch = '+refs/heads/*:refs/remotes/puppet/*'
|
27
|
-
@remote[:fetch] = %x{git config puppet.#{@remote[:name]}.fetch}.chomp
|
28
|
-
@remote[:fetch] = @remote[:fetch].empty? ? default_fetch : @remote[:fetch]
|
29
|
-
end
|
30
|
-
|
31
|
-
desc "Start work on a feature"
|
32
|
-
task :start_feature, [:feature,:remote,:branch] => :git_setup do |t, args|
|
33
|
-
args.with_defaults(:remote => @remote[:name])
|
34
|
-
args.with_defaults(:branch => @next_release)
|
35
|
-
start_at = find_start(args.branch)
|
36
|
-
branch = "feature/#{start_at}/#{args.feature}"
|
37
|
-
sh "git checkout -b #{branch} #{start_at}" do |ok, res|
|
38
|
-
if ! ok
|
39
|
-
raise <<EOS
|
40
|
-
Was not able to create branch for #{args.feature} on branch #{args.branch}, starting at #{start_at}: error code was: #{res.exitstatus}
|
41
|
-
EOS
|
42
|
-
end
|
43
|
-
end
|
44
|
-
sh "git config branch.#{branch}.remote #{args.remote}" do |ok, res|
|
45
|
-
raise "Could not set remote: #{$?}" unless ok
|
46
|
-
end
|
47
|
-
|
48
|
-
sh "git config branch.#{branch}.merge refs/heads/#{branch}" do |ok, res|
|
49
|
-
raise "Could not configure merge: #{$?}" unless ok
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
desc "Do git prep to start work on a Redmine ticket"
|
54
|
-
task :start_ticket, [:ticket, :remote, :branch] => :git_setup do |t, args|
|
55
|
-
args.with_defaults(:remote => @remote[:name])
|
56
|
-
args.with_defaults(:branch => @next_release)
|
57
|
-
start_at = find_start(args.branch)
|
58
|
-
branch = "tickets/#{start_at}/#{args.ticket}"
|
59
|
-
sh "git checkout -b #{branch} #{start_at}" do |ok, res|
|
60
|
-
unless ok
|
61
|
-
raise <<EOS
|
62
|
-
Was not able to create branch for ticket #{args.ticket} on branch #{args.branch}, starting at #{start_at}: error code was: #{$?}
|
63
|
-
Git command used was: #{command}
|
64
|
-
EOS
|
65
|
-
end
|
66
|
-
end
|
67
|
-
sh "git config branch.#{branch}.remote #{args.remote}" do |ok, res|
|
68
|
-
raise "Could not set remote: #{$?}" unless ok
|
69
|
-
end
|
70
|
-
|
71
|
-
sh "git config branch.#{branch}.merge refs/heads/#{branch}" do |ok, res|
|
72
|
-
raise "Could not configure merge: #{$?}" unless ok
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
|
-
# This isn't very useful by itself, but we might enhance it later, or use it
|
77
|
-
# in a dependency for a more complex task.
|
78
|
-
desc "Push out changes"
|
79
|
-
task :push_changes, [:remote] do |t, arg|
|
80
|
-
branch = %x{git branch | grep "^" | awk '{print $2}'}
|
81
|
-
sh "git push #{arg.remote} #{branch}" do |ok, res|
|
82
|
-
raise "Unable to push to #{arg.remote}" unless ok
|
83
|
-
end
|
84
|
-
end
|
85
|
-
|
86
|
-
desc "Send patch information to the puppet-dev list"
|
87
|
-
task :mail_patches do
|
88
|
-
if Dir.glob("00*.patch").length > 0
|
89
|
-
raise "Patches already exist matching '00*.patch'; clean up first"
|
90
|
-
end
|
91
|
-
|
92
|
-
unless %x{git status} =~ /On branch (.+)/
|
93
|
-
raise "Could not get branch from 'git status'"
|
94
|
-
end
|
95
|
-
branch = $1
|
96
|
-
|
97
|
-
unless branch =~ %r{^([^\/]+)/([^\/]+)/([^\/]+)$}
|
98
|
-
raise "Branch name does not follow <type>/<parent>/<name> model; cannot autodetect parent branch"
|
99
|
-
end
|
100
|
-
|
101
|
-
type, parent, name = $1, $2, $3
|
102
|
-
|
103
|
-
# Create all of the patches
|
104
|
-
sh "git format-patch -C -M -s -n --subject-prefix='PATCH/puppet' #{parent}..HEAD"
|
105
|
-
|
106
|
-
# Add info to the patches
|
107
|
-
additional_info = "Local-branch: #{branch}\n"
|
108
|
-
files = Dir.glob("00*.patch")
|
109
|
-
files.each do |file|
|
110
|
-
contents = File.read(file)
|
111
|
-
contents.sub!(/^---\n/, "---\n#{additional_info}")
|
112
|
-
File.open(file, 'w') do |file_handle|
|
113
|
-
file_handle.print contents
|
114
|
-
end
|
115
|
-
end
|
116
|
-
|
117
|
-
# And then mail them out.
|
118
|
-
|
119
|
-
# If we've got more than one patch, add --compose
|
120
|
-
if files.length > 1
|
121
|
-
compose = "--compose"
|
122
|
-
subject = "--subject \"#{type} #{name} against #{parent}\""
|
123
|
-
else
|
124
|
-
compose = ""
|
125
|
-
subject = ""
|
126
|
-
end
|
127
|
-
|
128
|
-
# Now send the mail.
|
129
|
-
sh "git send-email #{compose} #{subject} --no-signed-off-by-cc --suppress-from --to puppet-dev@googlegroups.com 00*.patch"
|
130
|
-
|
131
|
-
# Finally, clean up the patches
|
132
|
-
sh "rm 00*.patch"
|
133
|
-
end
|
134
|
-
|