summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin chi <chigang@huawei.com>2015-11-17 07:29:20 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2015-11-17 07:29:21 +0000
commitb2c43e6309342b450cbd895d28ae2da2ad0847e8 (patch)
tree6ed75cc63e214f1130277da99c4294577de2da32
parentbc68ab08a3c3d4058a798ba59eafae6126ffd3e4 (diff)
parent40559d47089d66c0c81b9d7fd1a2c81b490a5927 (diff)
Merge "using ELK in web-ui for running log"
-rw-r--r--build/arch/RedHat/make_jdk.sh3
-rw-r--r--build/arch/RedHat/make_kibana.sh52
-rwxr-xr-xbuild/make_repo.sh26
-rw-r--r--build/os/centos/rhel6/compass/Dockerfile.tmpl4
-rw-r--r--build/templates/compass_core.tmpl4
5 files changed, 86 insertions, 3 deletions
diff --git a/build/arch/RedHat/make_jdk.sh b/build/arch/RedHat/make_jdk.sh
new file mode 100644
index 00000000..6ef45d06
--- /dev/null
+++ b/build/arch/RedHat/make_jdk.sh
@@ -0,0 +1,3 @@
+wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u65-b17/jdk-8u65-linux-x64.rpm
+
+cp -rf jdk-8u65-linux-x64.rpm /var/cache/yum/
diff --git a/build/arch/RedHat/make_kibana.sh b/build/arch/RedHat/make_kibana.sh
new file mode 100644
index 00000000..51af5209
--- /dev/null
+++ b/build/arch/RedHat/make_kibana.sh
@@ -0,0 +1,52 @@
+
+yum -y install wget
+yum -y install tar
+yum -y install rpm-build
+
+cat << EOF > ~/.rpmmacros
+%_topdir /root/rpmbuild
+EOF
+
+mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
+
+pushd .
+
+cd ~/rpmbuild/SOURCES
+wget https://download.elastic.co/kibana/kibana/kibana-4.2.0-linux-x64.tar.gz
+
+cat << EOF > ~/rpmbuild/SPECS/kibana.spec
+Name: kibana
+Version: 4.2.0
+Release: 1
+Vendor: elasticsearch
+Summary: GUN kibana x64
+License: GPL
+Source: kibana-4.2.0-linux-x64.tar.gz
+Group: System Enviroment/Daemons
+URL: http://www.elasticsearch.co/
+Packager: test@test.com
+%description
+kibana package
+
+%prep
+tar xvf ../SOURCES/kibana-4.2.0-linux-x64.tar.gz
+
+%install
+cd ../BUILDROOT
+mkdir -p ./kibana-4.2.0-1.x86_64/opt/kibana
+cp -rf ../BUILD/kibana-4.2.0-linux-x64/* ./kibana-4.2.0-1.x86_64/opt/kibana
+
+%clean
+rm -rf ./kibana-4.2.0-linux-x64
+
+%files
+/opt/kibana/
+EOF
+
+cd ~
+rpmbuild -bb rpmbuild/SPECS/kibana.spec
+
+cp -rf rpmbuild/RPMS/* /var/cache/yum/
+
+find /var/cache/yum -name "perl*" | xargs rm -rf
+popd
diff --git a/build/make_repo.sh b/build/make_repo.sh
index 4357fbd1..61c40aef 100755
--- a/build/make_repo.sh
+++ b/build/make_repo.sh
@@ -23,6 +23,24 @@ set -ex
cp /*.tar.gz /result -f
EOF
+cat << EOF >${WORK_PATH}/work/repo/elasticsearch.repo
+[elasticsearch-2.x]
+name=Elasticsearch repository for 2.x packages
+baseurl=http://packages.elastic.co/elasticsearch/2.x/centos
+gpgcheck=1
+gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch
+enabled=1
+EOF
+
+cat << EOF > ${WORK_PATH}/work/repo/logstash.repo
+[logstash-2.0]
+name=Logstash repository for 2.0.x packages
+baseurl=http://packages.elastic.co/logstash/2.0/centos
+gpgcheck=1
+gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch
+enabled=1
+EOF
+
sudo apt-get install python-yaml -y
sudo apt-get install python-cheetah -y
}
@@ -163,7 +181,8 @@ function make_all_repo()
make_repo --os-ver rhel6 --package-tag compass \
--tmpl "${WORK_PATH}/build/templates/compass_core.tmpl" \
- --default-package "epel-release python-yaml python-jinja2 python-paramiko"
+ --default-package "epel-release python-yaml python-jinja2 python-paramiko elasticsearch logstash" \
+ --special-package "kibana jdk"
make_repo --os-ver trusty --package-tag juno \
--ansible-dir $WORK_PATH/deploy/adapters/ansible \
@@ -195,6 +214,11 @@ function main()
make_repo --os-ver rhel7 --package-tag juno \
--ansible-dir $WORK_PATH/deploy/adapters/ansible \
--default-package "rsyslog-7.6.7-1.el7 strace net-tools wget vim openssh-server dracut-config-rescue-033-241.el7_1.3 dracut-network-033-241.el7_1.3"
+ elif [ "$1" = "rhel6" ]; then
+ make_repo --os-ver rhel6 --package-tag compass \
+ --tmpl "${WORK_PATH}/build/templates/compass_core.tmpl" \
+ --default-package "epel-release python-yaml python-jinja2 python-paramiko elasticsearch logstash" \
+ --special-package "kibana jdk"
else
make_repo $*
fi
diff --git a/build/os/centos/rhel6/compass/Dockerfile.tmpl b/build/os/centos/rhel6/compass/Dockerfile.tmpl
index 8a8318e1..df2bcb77 100644
--- a/build/os/centos/rhel6/compass/Dockerfile.tmpl
+++ b/build/os/centos/rhel6/compass/Dockerfile.tmpl
@@ -1,6 +1,10 @@
FROM centos:6.6
MAINTAINER Chigang(Justin) <chigang@huawei.com>
+# add repo files first, then update
+ADD ./elasticsearch.repo /etc/yum.repos.d/elasticsearch.repo
+ADD ./logstash.repo /etc/yum.repos.d/logstash.repo
+
# TODO: Is there some easy way to get the fastest/closest mirror?
RUN yum update -y
diff --git a/build/templates/compass_core.tmpl b/build/templates/compass_core.tmpl
index 9c88cc4f..afecba58 100644
--- a/build/templates/compass_core.tmpl
+++ b/build/templates/compass_core.tmpl
@@ -16,8 +16,8 @@ yum -y install $pkg
mkdir -p /centos6-package
-find /var/cache/yum/ -name *.rpm | xargs -i cp {} /centos6-package
+find /var/cache/yum/ -name "*.rpm" | xargs -i cp {} /centos6-package
-find /centos6-package -size 0 -name *.rpm | xargs rm -f
+find /centos6-package -size 0 -name "*.rpm" | xargs rm -f
tar -zcvf /centos6-package.tar.gz /centos6-package