2
2
$home = "/home/tarmac"
3
$bzrcmd = "$home/.local/bin/bzr"
4
$pathwithlocal = "$home/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
5
"bzr": ensure => present;
7
# You can add extra packages to install here, for instance things
8
# needed to run test tests.
7
"python-dev": ensure => present;
21
exec { "latest-bazaar-tgz":
22
command => "/usr/bin/wget https://launchpad.net/bzr/2.6/2.6.0/+download/bzr-2.6.0.tar.gz",
25
require => [File[$home]],
26
creates => "$home/bzr-2.6.0.tar.gz",
29
exec { "latest-bazaar-tree":
30
command => "/bin/tar -xzf $home/bzr-2.6.0.tar.gz",
33
require => [Exec["latest-bazaar-tgz"]],
34
creates => "$home/bzr-2.6.0",
37
exec { "latest-bazaar-built":
38
command => "/usr/bin/python setup.py install --user",
40
cwd => "$home/bzr-2.6.0",
41
logoutput => "on_failure",
42
environment => ["HOME=$home"],
43
require => [Package["python-dev"], Exec["latest-bazaar-tree"]],
22
47
exec { "tarmac-source":
23
command => "/usr/bin/bzr checkout --lightweight lp:tarmac",
26
require => [File[$home], Package["bzr"]],
27
creates => "$home/tarmac",
48
command => "$bzrcmd checkout --lightweight $tarmac_branch tarmac",
51
logoutput => "on_failure",
52
environment => ["HOME=$home"],
53
require => [Exec["latest-bazaar-built"]],
54
creates => "$home/tarmac",
30
57
file { "$home/tarmac/tarmac/plugins/commit.py":
51
78
require => File["$home/.config/tarmac"],
52
79
content => $launchpad_credentials;
82
require => File["$home"],
83
content => "export PATH=$pathwithlocal";
55
86
require => File["$home"],
78
109
if $launchpad_username {
79
110
exec { "launchpad-login":
80
command => "/usr/bin/bzr launchpad-login $launchpad_username 2>&1",
111
command => "$bzrcmd launchpad-login $launchpad_username 2>&1",
82
113
creates => "$home/.bazaar/authentication.conf",
83
require => [Package["bzr"], File["$home/.ssh/id_rsa"]],
114
require => [Exec["latest-bazaar-built"], File["$home/.ssh/id_rsa"]],
115
logoutput => "on_failure",
116
environment => ["HOME=$home"],
120
command => "$bzrcmd whoami Tarmac",
122
require => [Exec["latest-bazaar-built"], File["$home/.ssh/id_rsa"]],
84
123
logoutput => "on_failure",
85
124
environment => ["HOME=$home"],
89
128
command => "/usr/bin/flock -n $home/tarmac.lock /usr/bin/python $home/tarmac/bin/tarmac merge",
92
environment => ["PYTHONPATH=$home/tarmac"],
93
require => [User["tarmac"], File["$home/tarmac.lock"]]
131
environment => "PYTHONPATH=$home/tarmac\nPATH=$pathwithlocal",
132
require => [User["tarmac"], File["$home/tarmac.lock"]],