diff options
-rw-r--r-- | build/arch/RedHat/make_jdk.sh | 3 | ||||
-rw-r--r-- | build/arch/RedHat/make_kibana.sh | 52 | ||||
-rwxr-xr-x | build/make_repo.sh | 26 | ||||
-rw-r--r-- | build/os/centos/rhel6/compass/Dockerfile.tmpl | 4 | ||||
-rw-r--r-- | build/templates/compass_core.tmpl | 4 |
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 |