summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbertagaz <bertagaz@ptitcanardnoir.org>2015-06-17 13:36:08 +0200
committerbertagaz <bertagaz@ptitcanardnoir.org>2015-06-17 13:36:08 +0200
commitd292eb6893f687b1c23ed53b2dcdcb3d4f2e2e1d (patch)
tree1ffcd61529f35d002dfe922973f0df4e0d1ad984
parentab62d42035587b5412f7b1801c6e08e11060c4b1 (diff)
parent9f53318870b76c89060e52a677a90ce21810cc25 (diff)
Merge remote-tracking branch 'origin/master' into bugfix/6439-fix-cleanup-of-nightly-built-ISO-imagesbugfix/6439-fix-cleanup-of-nightly-built-ISO-images
-rwxr-xr-xfiles/jenkins/master/generate_build_tails_iso_jobs30
-rwxr-xr-xfiles/reprepro/tails-suites-to-distributions8
-rw-r--r--manifests/check_mirrors.pp4
-rw-r--r--manifests/git_annex/mirror.pp20
-rw-r--r--manifests/jenkins/artifacts_store/webserver.pp26
-rw-r--r--manifests/tester.pp6
-rw-r--r--manifests/tester/check_po.pp22
-rw-r--r--templates/jenkins/artifacts_store/nginx.erb13
8 files changed, 91 insertions, 38 deletions
diff --git a/files/jenkins/master/generate_build_tails_iso_jobs b/files/jenkins/master/generate_build_tails_iso_jobs
index 985b7d5..4ce029f 100755
--- a/files/jenkins/master/generate_build_tails_iso_jobs
+++ b/files/jenkins/master/generate_build_tails_iso_jobs
@@ -18,19 +18,19 @@ builders:
triggers:
- pollscm: '@weekly'
- timed: '@daily'
-wrappers:
- - timestamps
+publishers:
- workspace-cleanup:
- dirmatch: true
- include:
- - "**"'''
+ clean-if:
+ - success: true
+wrappers:
+ - timestamps'''
VALID_JOB_RECIPIENTS = [
'release_managers',
'whoever_broke_the_build',
]
- def __init__(self, branch, snippet = JOB_SNIPPET):
+ def __init__(self, branch, snippet=JOB_SNIPPET):
assert type(branch['branch_name']) is str
assert branch['branch_name'].__len__() > 0
assert type(branch['job_name']) is str
@@ -49,13 +49,13 @@ wrappers:
'url': 'gitolite@puppet-git.lizard:tails'}
}]
if branch['job_recipients'] == 'release_managers':
- self.job['publishers'] = [
- {'email': { 'recipients': TAILS_RM_EMAIL }}
- ]
+ self.job['publishers'].extend([
+ {'email': {'recipients': TAILS_RM_EMAIL}}
+ ])
elif branch['job_recipients'] == 'whoever_broke_the_build':
- self.job['publishers'] = [
- {'email': { 'sent-to-individuals': True }}
- ]
+ self.job['publishers'].extend([
+ {'email': {'recipients': '', 'sent-to-individuals': True}}
+ ])
else:
raise ""
self.job['description'] = self.DESCRIPTION_TEMPLATE % {
@@ -94,9 +94,9 @@ if __name__ == "__main__":
parser.add_argument("Jobs_directory",
help="Full path to the output directory of the Jenkins Jobs.")
args = parser.parse_args()
- for branch in get_active_branches(args.Tails_git_directory):
- job = BuildTailsISOJob(branch)
- job_filename = args.Jobs_directory + "%s.yaml" % branch['job_name']
+ for active_branch in get_active_branches(args.Tails_git_directory):
+ job = BuildTailsISOJob(active_branch)
+ job_filename = args.Jobs_directory + "%s.yaml" % active_branch['job_name']
with open(job_filename, 'w') as job_file:
job_file.write(str(job))
diff --git a/files/reprepro/tails-suites-to-distributions b/files/reprepro/tails-suites-to-distributions
index c79a96c..bbc1e41 100755
--- a/files/reprepro/tails-suites-to-distributions
+++ b/files/reprepro/tails-suites-to-distributions
@@ -15,14 +15,10 @@ dists.each_pair do |name,attrs|
if attrs and attrs['codename']
codename = attrs['codename']
end
- if name == 'builder-wheezy'
- binary_archs = 'amd64 i386'
- elsif name == 'puppetmaster-jessie'
+ if name == 'puppetmaster-jessie'
binary_archs = 'amd64'
- elsif name == 'bugfix-9044-syslinux-on-chromebooks'
- binary_archs = 'amd64 i386'
else
- binary_archs = 'i386'
+ binary_archs = 'amd64 i386'
end
l << <<-END_OF_TEMPLATE.gsub(/^\s*/, '')
Origin: #{reprepro_origin}
diff --git a/manifests/check_mirrors.pp b/manifests/check_mirrors.pp
index 0a5a130..e32e15e 100644
--- a/manifests/check_mirrors.pp
+++ b/manifests/check_mirrors.pp
@@ -48,8 +48,8 @@ class tails::check_mirrors (
exec { 'Import Tails signing key':
user => $user,
group => $user,
- command => "gpg --batch --quiet --import '$signing_key_file'",
- environment => "HOME=$homedir",
+ command => "gpg --batch --quiet --import '${signing_key_file}'",
+ environment => "HOME=${homedir}",
require => File[$gnupg_homedir, $signing_key_file],
subscribe => File[$signing_key_file],
refreshonly => true,
diff --git a/manifests/git_annex/mirror.pp b/manifests/git_annex/mirror.pp
index d1880f4..887fe60 100644
--- a/manifests/git_annex/mirror.pp
+++ b/manifests/git_annex/mirror.pp
@@ -1,18 +1,18 @@
# Manage a mirror of a git-annex repository
define tails::git_annex::mirror (
- $mode = 'mirror',
+ $user,
+ $home,
+ $ssh_keyname,
$checkout_dir,
$remote_repo,
+
$ensure = 'present',
+ $mode = 'mirror',
$direct_mode = true,
$pull_hour = '*',
$pull_minute = ['14', '29', '44', '59'],
- $user,
- $home,
- $ssh_keyname,
-
$manage_mount = false,
$mount_point = false,
$mount_device = false,
@@ -43,11 +43,11 @@ define tails::git_annex::mirror (
}
file { $checkout_dir:
- ensure => directory,
- owner => $user,
- group => 'www-data',
- mode => '0750',
- require => Vcsrepo[$checkout_dir],
+ ensure => directory,
+ owner => $user,
+ group => 'www-data',
+ mode => '0750',
+ require => Vcsrepo[$checkout_dir],
}
exec { "Switch ${name} to direct mode":
diff --git a/manifests/jenkins/artifacts_store/webserver.pp b/manifests/jenkins/artifacts_store/webserver.pp
new file mode 100644
index 0000000..df1797b
--- /dev/null
+++ b/manifests/jenkins/artifacts_store/webserver.pp
@@ -0,0 +1,26 @@
+# Serve Jenkins artifacts over HTTP.
+class tails::jenkins::artifacts_store::webserver (
+ $artifacts_store_path,
+ $hostname,
+){
+
+ validate_absolute_path($artifacts_store_path)
+ validate_string($hostname)
+
+ if !defined(Class['nginx']) {
+ class { '::nginx':
+ access_log => 'noip',
+ error_log => 'none'
+ }
+ }
+
+ nginx::vhostsd { $hostname:
+ content => template('tails/jenkins/artifacts_store/nginx.erb'),
+ notify => Service[nginx],
+ require => [
+ Package[nginx],
+ File[$artifacts_store_path],
+ ],
+ }
+
+}
diff --git a/manifests/tester.pp b/manifests/tester.pp
index 03404fd..59149c2 100644
--- a/manifests/tester.pp
+++ b/manifests/tester.pp
@@ -1,3 +1,4 @@
+# Set up what's necessary to run automated tests
class tails::tester (
$manage_temp_dir_mount = false,
$temp_dir = '/tmp/TailsToaster',
@@ -27,6 +28,11 @@ class tails::tester (
ensure => absent,
}
+ apt::preferences_snippet { 'python-potr':
+ pin => 'release o=Debian Backports,a=jessie-backports',
+ priority => 991,
+ }
+
$tester_packages = [
'cucumber',
'devscripts',
diff --git a/manifests/tester/check_po.pp b/manifests/tester/check_po.pp
index ef8242d..572ab9c 100644
--- a/manifests/tester/check_po.pp
+++ b/manifests/tester/check_po.pp
@@ -1,8 +1,11 @@
-class tails::tester::check_po () {
-
- apt::preferences_snippet { 'i18nspector':
- ensure => absent,
- }
+# Set up what's necessary to automatically check PO files
+class tails::tester::check_po (
+ $tools_repo_local_user = 'jenkins',
+ $tools_repo_checkout = '/var/lib/jenkins/tools',
+ $tools_repo_url = 'https://git-tails.immerda.ch/jenkins-tools',
+ $tools_repo_rev = 'master',
+ $tools_repo_ensure = 'latest',
+) {
$tester_packages = [
'i18nspector'
@@ -10,4 +13,13 @@ class tails::tester::check_po () {
ensure_packages($tester_packages)
+ vcsrepo { $tools_repo_checkout:
+ ensure => $tools_repo_ensure,
+ provider => git,
+ source => $tools_repo_url,
+ revision => $tools_repo_rev,
+ user => $tools_repo_local_user,
+ require => Package[jenkins-slave],
+ }
+
}
diff --git a/templates/jenkins/artifacts_store/nginx.erb b/templates/jenkins/artifacts_store/nginx.erb
new file mode 100644
index 0000000..fda5d08
--- /dev/null
+++ b/templates/jenkins/artifacts_store/nginx.erb
@@ -0,0 +1,13 @@
+# -*- mode: conf; -*-
+# This file is managed by the Tails Jenkins Puppet module.
+
+server {
+ server_name <%= @hostname %>;
+ listen 80;
+ root <%= @artifacts_store_path %>;
+
+ location / {
+ autoindex on;
+ autoindex_exact_size off;
+ }
+}