aboutsummaryrefslogtreecommitdiff
path: root/bigtop_toolchain
diff options
context:
space:
mode:
authorKengo Seki <sekikn@apache.org>2016-10-18 06:33:27 +0900
committerKonstantin Boudnik <konstantin_boudnik@epam.com>2016-10-18 12:32:20 -0700
commit0ee641d714a8e1cc50eabb880fb011906ec47115 (patch)
treeaab989171546349edbdda9ede0c54ef8ec4d8d5d /bigtop_toolchain
parent41536b9beaf1f0a9b01e2fdab2d7746838238d8c (diff)
BIGTOP-2384: Refactor toolchain code to extract packages version out of every action
Signed-off-by: Konstantin Boudnik <konstantin_boudnik@epam.com>
Diffstat (limited to 'bigtop_toolchain')
-rw-r--r--bigtop_toolchain/manifests/env.pp9
-rw-r--r--bigtop_toolchain/manifests/gradle.pp17
-rw-r--r--bigtop_toolchain/manifests/groovy.pp17
-rw-r--r--bigtop_toolchain/manifests/maven.pp2
-rw-r--r--bigtop_toolchain/manifests/vagrant.pp11
5 files changed, 34 insertions, 22 deletions
diff --git a/bigtop_toolchain/manifests/env.pp b/bigtop_toolchain/manifests/env.pp
index f86571b9..03d1b03d 100644
--- a/bigtop_toolchain/manifests/env.pp
+++ b/bigtop_toolchain/manifests/env.pp
@@ -14,6 +14,9 @@
# limitations under the License.
class bigtop_toolchain::env {
+ $java_version = '1.7.0'
+ $java = "java-${java_version}"
+
case $architecture {
'amd64' : { $arch= "amd64" }
'ppc64le' : { $arch= "ppc64el" }
@@ -21,13 +24,13 @@ class bigtop_toolchain::env {
}
case $operatingsystem {
'Ubuntu','Debian': {
- $javahome = "/usr/lib/jvm/java-1.7.0-openjdk-$arch"
+ $javahome = "/usr/lib/jvm/${java}-openjdk-$arch"
}
'Fedora','Centos', 'Amazon': {
- $javahome = "/usr/lib/jvm/java-1.7.0"
+ $javahome = "/usr/lib/jvm/${java}"
}
'OpenSuSE' : {
- $javahome = "/usr/lib64/jvm/java-1.7.0-openjdk-1.7.0"
+ $javahome = "/usr/lib64/jvm/${java}-openjdk-${java_version}"
}
}
file { '/etc/profile.d/bigtop.sh':
diff --git a/bigtop_toolchain/manifests/gradle.pp b/bigtop_toolchain/manifests/gradle.pp
index aa4247a2..3557cb9c 100644
--- a/bigtop_toolchain/manifests/gradle.pp
+++ b/bigtop_toolchain/manifests/gradle.pp
@@ -15,21 +15,24 @@
class bigtop_toolchain::gradle {
- exec {"/usr/bin/wget http://services.gradle.org/distributions/gradle-2.7-bin.zip":
+ $gradle_version = '2.7'
+ $gradle = "gradle-${gradle_version}"
+
+ exec {"/usr/bin/wget http://services.gradle.org/distributions/${gradle}-bin.zip":
cwd => "/usr/src",
- unless => "/usr/bin/test -f /usr/src/gradle-2.7-bin.zip",
+ unless => "/usr/bin/test -f /usr/src/${gradle}-bin.zip",
}
- exec {'/usr/bin/unzip -x -o /usr/src/gradle-2.7-bin.zip':
+ exec {"/usr/bin/unzip -x -o /usr/src/${gradle}-bin.zip":
cwd => '/usr/local',
refreshonly => true,
- subscribe => Exec["/usr/bin/wget http://services.gradle.org/distributions/gradle-2.7-bin.zip"],
- require => Exec["/usr/bin/wget http://services.gradle.org/distributions/gradle-2.7-bin.zip"],
+ subscribe => Exec["/usr/bin/wget http://services.gradle.org/distributions/${gradle}-bin.zip"],
+ require => Exec["/usr/bin/wget http://services.gradle.org/distributions/${gradle}-bin.zip"],
}
file {'/usr/local/gradle':
ensure => link,
- target => '/usr/local/gradle-2.7',
- require => Exec['/usr/bin/unzip -x -o /usr/src/gradle-2.7-bin.zip'],
+ target => "/usr/local/${gradle}",
+ require => Exec["/usr/bin/unzip -x -o /usr/src/${gradle}-bin.zip"],
}
}
diff --git a/bigtop_toolchain/manifests/groovy.pp b/bigtop_toolchain/manifests/groovy.pp
index 2d6eb7c5..f50886ac 100644
--- a/bigtop_toolchain/manifests/groovy.pp
+++ b/bigtop_toolchain/manifests/groovy.pp
@@ -15,24 +15,27 @@
class bigtop_toolchain::groovy {
+ $groovy_version = '2.4.4'
+ $groovy = "apache-groovy-binary-${groovy_version}"
+
include bigtop_toolchain::packages
- exec {"/usr/bin/wget http://dl.bintray.com/groovy/maven/apache-groovy-binary-2.4.4.zip":
+ exec {"/usr/bin/wget http://dl.bintray.com/groovy/maven/${groovy}.zip":
cwd => "/usr/src",
require => Package[$packages::pkgs],
- unless => "/usr/bin/test -f /usr/src/apache-groovy-binary-2.4.4.zip",
+ unless => "/usr/bin/test -f /usr/src/${groovy}.zip",
}
- exec {'/usr/bin/unzip -x -o /usr/src/apache-groovy-binary-2.4.4.zip':
+ exec {"/usr/bin/unzip -x -o /usr/src/${groovy}.zip":
cwd => '/usr/local',
refreshonly => true,
- subscribe => Exec["/usr/bin/wget http://dl.bintray.com/groovy/maven/apache-groovy-binary-2.4.4.zip"],
- require => Exec["/usr/bin/wget http://dl.bintray.com/groovy/maven/apache-groovy-binary-2.4.4.zip"],
+ subscribe => Exec["/usr/bin/wget http://dl.bintray.com/groovy/maven/${groovy}.zip"],
+ require => Exec["/usr/bin/wget http://dl.bintray.com/groovy/maven/${groovy}.zip"],
}
file {'/usr/local/groovy':
ensure => link,
- target => '/usr/local/groovy-2.4.4',
- require => Exec['/usr/bin/unzip -x -o /usr/src/apache-groovy-binary-2.4.4.zip'],
+ target => "/usr/local/groovy-${groovy_version}",
+ require => Exec["/usr/bin/unzip -x -o /usr/src/${groovy}.zip"],
}
}
diff --git a/bigtop_toolchain/manifests/maven.pp b/bigtop_toolchain/manifests/maven.pp
index 8bc02a47..a1d7142d 100644
--- a/bigtop_toolchain/manifests/maven.pp
+++ b/bigtop_toolchain/manifests/maven.pp
@@ -32,7 +32,7 @@ class bigtop_toolchain::maven {
file {'/usr/local/maven':
ensure => link,
- target => "/usr/local/apache-maven-$mvnversion",
+ target => "/usr/local/$mvn",
require => Exec["/bin/tar xvzf /usr/src/$mvn-bin.tar.gz"],
}
}
diff --git a/bigtop_toolchain/manifests/vagrant.pp b/bigtop_toolchain/manifests/vagrant.pp
index 07f9ae6a..93fd03a3 100644
--- a/bigtop_toolchain/manifests/vagrant.pp
+++ b/bigtop_toolchain/manifests/vagrant.pp
@@ -15,16 +15,19 @@
class bigtop_toolchain::vagrant {
+ $vagrant_version = '1.7.1_x86_64'
+ $vagrant = "vagrant_${vagrant_version}"
+
case $operatingsystem{
/Ubuntu|Debian/: {
exec {'download-vagrant':
- command => '/usr/bin/wget https://dl.bintray.com/mitchellh/vagrant/vagrant_1.7.1_x86_64.deb',
+ command => "/usr/bin/wget https://dl.bintray.com/mitchellh/vagrant/${vagrant}.deb",
cwd => '/usr/src',
- creates => '/usr/src/vagrant_1.7.1_x86_64.deb'
+ creates => "/usr/src/${vagrant}.deb"
}
package { 'vagrant':
ensure => 'latest',
- source => '/usr/src/vagrant_1.7.1_x86_64.deb',
+ source => "/usr/src/${vagrant}.deb",
provider => 'dpkg',
require => Exec['download-vagrant']
}
@@ -32,7 +35,7 @@ class bigtop_toolchain::vagrant {
default : {
package { 'vagrant':
ensure => 'latest',
- source => 'https://dl.bintray.com/mitchellh/vagrant/vagrant_1.7.1_x86_64.rpm',
+ source => "https://dl.bintray.com/mitchellh/vagrant/${vagrant}.rpm",
provider => 'rpm'
}
}