File tree Expand file tree Collapse file tree 7 files changed +110
-56
lines changed Expand file tree Collapse file tree 7 files changed +110
-56
lines changed Original file line number Diff line number Diff line change 1
- # Using this Template
2
1
3
- Bootstrap it:
2
+ # Puppet Module for Play
4
3
5
- ```
6
- mkdir -p ~/src/boxen/puppet-mynewmodule
7
- cd ~/src/boxen/puppet-mynewmodule
8
- git init .
9
- git remote add template https://github.com/boxen/puppet-template.git
10
- git fetch template
11
- git checkout -b master template/master
12
- ```
13
-
14
- Now we're ready to make it our own!
15
-
16
- ```
17
- script/cibuild
18
- .bundle/binstubs/rspec-puppet-init
19
- ```
20
-
21
- Now you'll need to edit ` manifests/init.pp ` and ` spec/classes/template_spec.rb `
22
- for your module.
23
- If your module has other dependencies, be sure to update
24
- ` spec/fixtures/Puppetfile ` .
25
- From then on, you can use ` script/cibuild ` to run the tests.
26
-
27
- When you're ready to push:
28
-
29
- ```
30
- git create githubusername/puppet-mynewmodule
31
- git push origin master
32
- ```
33
-
34
- The rest of the README as follows can be used as a template for your module's README.
35
-
36
- # Template Puppet Module for Boxen
37
-
38
- An example of how we write Puppet modules for Boxen. Replace this
39
- paragraph with a short explanation of what the heck makes your module
40
- useful.
41
-
42
- A great module has a working travis build
4
+ Installs play framework.
43
5
44
6
[ ![ Build Status] ( https://travis-ci.org/boxen/puppet-template.png?branch=master )] ( https://travis-ci.org/boxen/puppet-template )
45
7
46
8
## Usage
47
9
10
+ To install play 1.2:
11
+ ``` puppet
12
+ import play::v1_2
13
+ ```
14
+
15
+ To install play 2.1:
48
16
``` puppet
49
- boxen::example { 'best example ever':
50
- salutation => 'fam'
51
- }
17
+ import play
52
18
```
53
19
54
20
## Required Puppet Modules
55
21
56
22
* ` boxen `
57
- * ` anything-else `
23
+ * ` homebrew `
58
24
59
25
## Development
60
26
Original file line number Diff line number Diff line change
1
+ require 'formula'
2
+
3
+ class Play < Formula
4
+ homepage 'http://www.playframework.org/'
5
+ url 'http://downloads.typesafe.com/play/2.1.0/play-2.1.0.zip'
6
+ sha1 '0708a30906673b5cded859b9d3d772a01855e07a'
7
+ version '2.1.0-boxen1'
8
+
9
+ head 'https://github.com/playframework/Play20.git'
10
+
11
+ def install
12
+ rm Dir [ '*.bat' ] # remove windows' bat files
13
+ libexec . install Dir [ '*' ]
14
+ inreplace libexec +"play" do |s |
15
+ s . gsub! "$dir/" , "$dir/../libexec/"
16
+ s . gsub! "dir=`dirname $PRG`" , "dir=`dirname $0` && dir=$dir/`dirname $PRG`"
17
+ end
18
+ bin . install_symlink libexec +'play'
19
+ end
20
+ end
Original file line number Diff line number Diff line change
1
+ require 'formula'
2
+
3
+ class Play12 < Formula
4
+ homepage 'http://www.playframework.org/'
5
+ url 'http://download.playframework.org/releases/play-1.2.5.zip'
6
+ sha1 'e675241b97ad19032569cd7b36b09c3b7f45bbc5'
7
+ version '1.2.5-boxen1'
8
+ keg_only 'we will create the links ourselves'
9
+
10
+ def install
11
+ rm_rf 'python' # we don't need the bundled Python for windows
12
+ rm Dir [ '*.bat' ]
13
+ libexec . install Dir [ '*' ]
14
+ bin . mkpath
15
+ ln_s libexec +'play' , bin
16
+ end
17
+ end
Original file line number Diff line number Diff line change 1
- # This is a placeholder class.
2
- class template {
3
- anchor { 'Hello_World' : }
1
+ # Installs play 2.
2
+ # Usage
3
+ # include play
4
+
5
+ class play {
6
+ require homebrew
7
+ $version = ' 2.1.0-boxen1'
8
+ homebrew::formula { "play" :
9
+ before => Package[" boxen/brews/play" ],
10
+ source => " puppet:///modules/play/brews/play.rb"
11
+ }
12
+
13
+ Package { "boxen/brews/play" :
14
+ ensure => " ${version} " ,
15
+ }
16
+
17
+ file { "${boxen::config::homebrewdir}/bin/play2" :
18
+ ensure => ' link' ,
19
+ target => " ${boxen::config::homebrewdir} /Cellar/play/${version} /bin/play" ,
20
+ }
4
21
}
22
+
Original file line number Diff line number Diff line change
1
+ # Installs play 1.2.5.
2
+ # Usage
3
+ # include play::v1_2
4
+
5
+ class play::v1_2 {
6
+ require homebrew
7
+ $version = ' 1.2.5-boxen1'
8
+
9
+ homebrew::formula { "play12" :
10
+ before => Package[" boxen/brews/play12" ],
11
+ source => " puppet:///modules/play/brews/play12.rb"
12
+ }
13
+
14
+ package { "boxen/brews/play" :
15
+ ensure => " ${version} " ,
16
+ }
17
+
18
+ file { "${boxen::config::homebrewdir}/bin/play1" :
19
+ ensure => ' link' ,
20
+ target => " ${boxen::config::homebrewdir} /Cellar/play12/${version} /bin/play" ,
21
+ }
22
+ }
Original file line number Diff line number Diff line change
1
+ require 'spec_helper'
2
+ describe 'play' do
3
+ let ( :boxen_home ) { '/opt/boxen' }
4
+ let ( :brewdir ) { "#{ boxen_home } /homebrew" }
5
+ let ( :envdir ) { "#{ boxen_home } /env.d" }
6
+ let ( :facts ) do
7
+ {
8
+ :boxen_home => boxen_home ,
9
+ :luser => 'msturm' ,
10
+ :boxen_user => 'msturm'
11
+ }
12
+
13
+ end
14
+ it do
15
+ should contain_homebrew__formula ( 'play' ) . with_before ( 'Package[boxen/brews/play]' )
16
+ should contain_package ( 'boxen/brews/play' ) . with ( {
17
+ :ensure => '2.1.0-boxen1' ,
18
+ } )
19
+ end
20
+ end
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments