summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Farrellee <matt@redhat.com>2013-07-10 09:03:02 -0400
committerMatthew Farrellee <matt@redhat.com>2013-07-10 09:08:20 -0400
commit4cd9ca4df83eace888e8ad627a37a2f605e08a14 (patch)
treeb19e3826accff2b4bfae3130241ea1ef28b8c23f
parente86ea0234bbae146fd587cd6f375e7eda7a16b36 (diff)
Simplification of hadoop_fedora/11-setup-java implementation0.2a20.2.rc20.2.rc10.2
Notes
Notes (review): Verified+2: Jenkins Approved+1: Sergey Lukjanov <slukjanov@mirantis.com> Code-Review+2: Sergey Lukjanov <slukjanov@mirantis.com> Code-Review+2: Alexander Ignatov <aignatov@mirantis.com> Code-Review+1: Ivan Berezovskiy <iberezovskiy@mirantis.com> Submitted-by: Jenkins Submitted-at: Wed, 10 Jul 2013 14:20:02 +0000 Reviewed-on: https://review.openstack.org/36460 Project: stackforge/savanna-extra Branch: refs/heads/master
-rwxr-xr-xelements/hadoop_fedora/post-install.d/11-setup-java56
-rwxr-xr-xelements/hadoop_fedora/post-install.d/12-setup-hadoop2
2 files changed, 24 insertions, 34 deletions
diff --git a/elements/hadoop_fedora/post-install.d/11-setup-java b/elements/hadoop_fedora/post-install.d/11-setup-java
index 0ced81d..8952eec 100755
--- a/elements/hadoop_fedora/post-install.d/11-setup-java
+++ b/elements/hadoop_fedora/post-install.d/11-setup-java
@@ -1,44 +1,34 @@
1#!/bin/bash 1#!/bin/bash
2echo "Java setup begins" 2echo "Java setup begins"
3install-packages wget
4tmp_dir=/tmp/java/
5mkdir -p $TARGET_ROOT/$tmp_dir
6set -e 3set -e
7if [ -z "$JAVA_DOWNLOAD_URL" ]; then 4
8 script_dir=$(dirname $0) 5# NOTE: $(dirname $0) is read-only, use space under $TARGET_ROOT
9 install -D -g root -o root -m 0755 $script_dir/$JAVA_FILE $TARGET_ROOT/$tmp_dir 6JAVA_HOME=$TARGET_ROOT/usr/java
10 filename=$JAVA_FILE 7mkdir -p $JAVA_HOME
11 echo "Java file moved" 8
12else 9if [ -n "$JAVA_DOWNLOAD_URL" ]; then
13 wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" -P $TARGET_ROOT/$tmp_dir $JAVA_DOWNLOAD_URL 10 install-packages wget
11 wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" -P $JAVA_HOME $JAVA_DOWNLOAD_URL
14 if [ $? -eq 0 ]; then 12 if [ $? -eq 0 ]; then
15 echo "Java is downloading" 13 echo "Java downloaded"
16 else 14 else
17 echo "Url error. Exit" 15 echo "Error downloading java. Exiting."
18 exit 1 16 exit 1
19 fi 17 fi
20 filename=$(find $TARGET_ROOT/$tmp_dir -maxdepth 1 -name "jdk*") 18 JAVA_FILE=$(basename $JAVA_DOWNLOAD_URL)
21 filename=$(basename $filename) 19elif [ -n "$JAVA_FILE" ]; then
20 install -D -g root -o root -m 0755 $(dirname $0)/$JAVA_FILE $JAVA_HOME
22fi 21fi
23 22
24if echo $tmp_dir/$filename | grep -q -s -F .tar.gz ; then 23cd $JAVA_HOME
25 pushd $TARGET_ROOT/$tmp_dir 24if echo $JAVA_FILE | grep -q -s -F .tar.gz ; then
26 echo -e "\n" | tar -zxvf $TARGET_ROOT/$tmp_dir/$filename 25 echo -e "\n" | tar -zxvf $JAVA_FILE
27 popd 26elif echo $JAVA_FILE | grep -q -s -F .bin ; then
28 else 27 echo -e "\n" | sh $JAVA_FILE
29 if echo $filename | grep -q -s -F .bin ; then 28else
30 pushd $TARGET_ROOT/$tmp_dir 29 echo "Unknown file type: $JAVA_FILE. Exiting."
31 echo -e "\n" | sh $filename 30 exit 1
32 rm $filename
33 popd
34 fi
35fi 31fi
32rm $JAVA_FILE
36 33
37filename=$(find $TARGET_ROOT/$tmp_dir -maxdepth 1 -type d -name "jdk*")
38filename=$(basename $filename)
39javaPath=/usr/java/
40mkdir -p $TARGET_ROOT/$javaPath
41mv $TARGET_ROOT/$tmp_dir/$filename $TARGET_ROOT/$javaPath
42rm -r $tmp_dir
43echo "Java was installed" 34echo "Java was installed"
44
diff --git a/elements/hadoop_fedora/post-install.d/12-setup-hadoop b/elements/hadoop_fedora/post-install.d/12-setup-hadoop
index 98068ad..62ef2c5 100755
--- a/elements/hadoop_fedora/post-install.d/12-setup-hadoop
+++ b/elements/hadoop_fedora/post-install.d/12-setup-hadoop
@@ -2,7 +2,7 @@
2echo "Hadoop setup begins" 2echo "Hadoop setup begins"
3tmp_dir=/tmp/hadoop 3tmp_dir=/tmp/hadoop
4 4
5install-packages openssh-server 5install-packages openssh-server wget
6echo "Creating hadoop user & group" 6echo "Creating hadoop user & group"
7adduser -G adm,wheel hadoop 7adduser -G adm,wheel hadoop
8 8