Skip to content

Commit

Permalink
Merge pull request #1 from johnlawerance/code_quality
Browse files Browse the repository at this point in the history
Code quality
  • Loading branch information
johnlawerance committed Feb 27, 2016
2 parents dd5e245 + 5d63ed7 commit 201490f
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 54 deletions.
48 changes: 39 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,40 @@
rvm: 1.9.3
---
sudo: false
language: ruby
cache: bundler
bundler_args: --without system_tests
before_install: rm Gemfile.lock || true
script:
- 'bundle exec rake'
matrix:
fast_finish: true
include:
- rvm: 1.9.3
env: PUPPET_VERSION="~> 3.0" STRICT_VARIABLES="yes"
- rvm: 2.1.8
env: PUPPET_VERSION="~> 3.0" STRICT_VARIABLES="yes"
- rvm: 1.9.3
env: PUPPET_VERSION="~> 3.0" STRICT_VARIABLES="yes" FUTURE_PARSER=yes
- rvm: 2.1.8
env: PUPPET_VERSION="~> 3.0" STRICT_VARIABLES="yes" FUTURE_PARSER=yes
- rvm: 2.1.8
env: PUPPET_VERSION="~> 4.0" STRICT_VARIABLES="yes"
- rvm: 2.2.4
env: PUPPET_VERSION="~> 4.0" STRICT_VARIABLES="yes"
- rvm: 2.2.4
env: PUPPET_VERSION="~> 4.0" STRICT_VARIABLES="yes"
- rvm: 2.3.0
env: PUPPET_VERSION="~> 4.0" STRICT_VARIABLES="yes"
notifications:
email:
- john@johnlawerance.com
env:
- PUPPET_VERSION=3.0
- PUPPET_VERSION=4.0
- PUPPET_VERSION=4.1
- PUPPET_VERSION=4.2
- PUPPET_VERSION=4.3
email: john@johnlawerance.com
deploy:
provider: puppetforge
user: johnlawerance
password:
secure: "gNMWPdh6zKIaVJzRBA/DMFoj1IEpQjJ6Sb2NPL6Pt5Yh/+Dgj7zD6jNl/whylUYEkx11DSdfle0S8E7hw0VsLqJOTY4J0E88DZI0UQlT4QyjpUrfOltbGEGssBedl0tm+H7tUqVgqY1VHK+RCHrawkk3Qv2lMfIZEX6mcmuZb0cPmtazdVgXm9v6SLiS3IG/mnxKUPzB/ITna44u2cTqcfZ0MEeeNKOTtKioj05yds1obqbv4BgfXM/RXD0mPCiXnr6Pdx6GlN9xF7Q66FxWb1Shrf+n4WUMLgA9cFNfRR94uMo+19kDkNkALC9+Eb+YjgFxKSteE8jItUn2W32C6wA7jUhpUsAenfLih6Bwvdt2nvqyoxer/l7ddqF9ikUkPCT3CO3N+sKtUVHCxc6PWrjY81mDJsn4jtZzLEUtwR1G3+SJUgM7ysNQMPxMRM+IqvCJasbV/lB8ki9WnjVPeguElm0O0BDMYCMP1tuG3Nx0N8113rWZAoJE6yqxJhyO36B8GaCT6o9Lt4PtP1a5+vwz6bAC1lrqag83GoYMASVxFoP1DBmWvDPjuB71ybn7WrYRXg2ekIeY3WA0lXe1TKjOVpcgw1CkEgxdNImMIxeOX+WlWAHF3cINfcOFP0A+pAlhzQLEYraYZypQSRF+vejHWjkkrA95gNTvA1UBigo="
on:
tags: true
# all_branches is required to use tags
all_branches: true
# Only publish if our main Ruby target builds
rvm: 1.9.3
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
##2016-02-27 - Release 0.1.1
###Summary
- Fixed puppet-lint errors
- Fixed metadata java/stdlib dependency info
- Fixed install_java param not actually being used

##2016-02-26 - Release 0.1.0
###Summary
- Initial Release
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# crucible
[![Puppet Forge](https://img.shields.io/puppetforge/v/johnlawerance/crucible.svg)](https://forge.puppetlabs.com/johnlawerance/crucible)
[![Build Status](https://travis-ci.org/johnlawerance/crucible.svg?branch=master)](https://github.com/johnlawerance/crucible)

#### Table of Contents
Expand Down
20 changes: 9 additions & 11 deletions manifests/init.pp
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
class crucible (
$version = $crucible::params::version,
$service_manage = $crucible::params::service_manage,
$service_ensure = $crucible::params::service_ensure,
$service_enable = $crucible::params::service_enable,
$service_name = $crucible::params::service_name,
$service_user = $crucible::params::service_user,
$install_java = $crucible::params::install_java,
$install_dir = $crucible::params::install_dir,
) inherits crucible::params {
$version = '3.10.3',
$service_manage = true,
$service_ensure = 'running',
$service_enable = true,
$service_name = 'crucible',
$service_user = 'crucible',
$install_java = true,
$install_dir = '/opt/crucible',
) {

validate_re($version, '^*\.*\.*')
validate_bool($service_manage)
Expand All @@ -23,5 +23,3 @@
class { '::crucible::service': }

}


28 changes: 15 additions & 13 deletions manifests/install.pp
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
class crucible::install inherits crucible {
class crucible::install {

# Install Java
class { 'java':
distribution => 'jre',
package => 'java-1.8.0-openjdk',
if $crucible::install_java == true {
class { 'java':
distribution => 'jre',
package => 'java-1.8.0-openjdk',
}
}

# Setup service user
user { "$service_user":
user { $crucible::service_user:
ensure => present,
home => '/home/crucible',
shell => '/bin/bash',
}

# exec to download and install the crucible directory if version file doesn't exist
# Download and install the crucible directory if version file doesn't exist
exec { 'install_crucible':
command => "/usr/bin/wget -q -O /tmp/crucible-$version.zip https://www.atlassian.com/software/crucible/downloads/binary/crucible-$version.zip && /usr/bin/unzip /tmp/crucible-$version.zip -d /tmp/ && mv /tmp/fecru-$version $install_dir-$version && chown -R $service_user.$service_user $install_dir-$version",
creates => "/opt/crucible-$version",
require => User[$service_user],
command => "/usr/bin/wget -q -O /tmp/crucible-${crucible::version}.zip https://www.atlassian.com/software/crucible/downloads/binary/crucible-${crucible::version}.zip && /usr/bin/unzip /tmp/crucible-${crucible::version}.zip -d /tmp/ && mv /tmp/fecru-${crucible::version} ${crucible::install_dir}-${crucible::version} && chown -R ${crucible::service_user}.${crucible::service_user} ${crucible::install_dir}-${crucible::version}",
creates => "/opt/crucible-${crucible::version}",
require => User[$crucible::service_user],
}

# symlink versioned directory with /opt/crucible/ directory name
file { 'crucible_dir':
path => "$install_dir",
ensure => 'link',
owner => "$service_user",
target => "$install_dir-$version",
require => User[$service_user],
path => $crucible::install_dir,
owner => $crucible::service_user,
target => "${crucible::install_dir}-${crucible::version}",
require => User[$crucible::service_user],
}

}
12 changes: 0 additions & 12 deletions manifests/params.pp

This file was deleted.

12 changes: 6 additions & 6 deletions manifests/service.pp
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
class crucible::service inherits crucible {

if $service_manage == true {
if $crucible::service_manage == true {

file { '/etc/init.d/crucible':
ensure => file,
content => template('crucible/crucible-init.sh.erb'),
mode => '755',
mode => '0755',
}

service { 'crucible':
ensure => $service_ensure,
enable => $service_enable,
name => $service_name,
ensure => $crucible::service_ensure,
enable => $crucible::service_enable,
name => $crucible::service_name,
hasstatus => true,
hasrestart => true,
require => File['/etc/init.d/crucible'],
require => File['/etc/init.d/crucible'],
}
}

Expand Down
6 changes: 3 additions & 3 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "johnlawerance-crucible",
"version": "0.1.0",
"version": "0.1.1",
"author": "John Clark",
"summary": "Crucible / Fisheye",
"license": "WTFPL",
Expand Down Expand Up @@ -38,8 +38,8 @@
}
],
"dependencies": [
{"name":"puppetlabs-stdlib","version_requirement":">= 1.0.0"},
{"name":"puppetlabs-java","version_requirement":">= 1.0.0"}
{"name":"puppetlabs-stdlib","version_requirement":">= 3.0.0"},
{"name":"puppetlabs-java","version_requirement":">= 1.2.0"}
],
"data_provider": null
}
Expand Down

0 comments on commit 201490f

Please sign in to comment.