Merge lp:~s-matyukevich/charms/trusty/logstash-agent/logstash-agent-1.4.2 into lp:charms/trusty/logstash-agent

Proposed by Sergey Matyukevich
Status: Merged
Merged at revision: 6
Proposed branch: lp:~s-matyukevich/charms/trusty/logstash-agent/logstash-agent-1.4.2
Merge into: lp:charms/trusty/logstash-agent
Diff against target: 90 lines (+16/-14)
3 files modified
files/charm/logstash-agent.conf (+2/-3)
hooks/common.sh (+4/-4)
hooks/install (+10/-7)
To merge this branch: bzr merge lp:~s-matyukevich/charms/trusty/logstash-agent/logstash-agent-1.4.2
Reviewer Review Type Date Requested Status
Review Queue (community) automated testing Approve
Charles Butler (community) Approve
Review via email: mp+241382@code.launchpad.net

Description of the change

Logstash version updated to 1.4.2

https://codereview.appspot.com/172270043/

To post a comment you must log in.
Revision history for this message
Sergey Matyukevich (s-matyukevich) wrote :
Download full text (4.6 KiB)

Reviewers: mp+241382_code.launchpad.net,

Message:
Please take a look.

Description:
Logstash version updated to 1.4.2

https://code.launchpad.net/~s-matyukevich/charms/trusty/logstash-agent/logstash-agent-1.4.2/+merge/241382

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/172270043/

Affected files (+18, -14 lines):
   A [revision details]
   M files/charm/logstash-agent.conf
   M hooks/common.sh
   M hooks/install

Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: <email address hidden>
+New revision: <email address hidden>

Index: hooks/common.sh
=== modified file 'hooks/common.sh'
--- hooks/common.sh 2012-11-18 22:33:19 +0000
+++ hooks/common.sh 2014-11-10 09:51:05 +0000
@@ -3,9 +3,9 @@
  #set -eux # -x for verbose logging to juju debug-log

  # Set CONFIG constants
-VERSION="1.1.4"
-BASEURL="https://logstash.objects.dreamhost.com/release"
-CHECKSUM="68ac6c953aad026752f69ae7c15b13f4"
+VERSION="1.4.2"
+BASEURL="https://download.elasticsearch.org/logstash/logstash"
+CHECKSUM="6e6be734392e8c7d6d55e23d0bd8d2b3"
  BASEPATH="/opt/logstash-agent"
  USER="logstash"
  HOST=`unit-get private-address`
@@ -15,4 +15,4 @@
  # USER=$(config-get user)
  # juju-log "Logstash User: ${USER}"

-juju-log "Finished loading config variables"
\ No newline at end of file
+juju-log "Finished loading config variables"

Index: hooks/install
=== modified file 'hooks/install'
--- hooks/install 2012-12-02 23:34:57 +0000
+++ hooks/install 2014-11-10 09:51:05 +0000
@@ -11,7 +11,7 @@
  # set redis listener
  juju-log "Install upstart init script"
  install -o root -g root -m 0644 ${HOME}/files/charm/logstash-agent.conf
/etc/init/logstash-agent.conf
-sed -i "s|BASEPATH|${BASEPATH}|g" /etc/init/logstash-agent.conf
+sed -i "s|BASEPATH|${BASEPATH}|g;s|VERSION|${VERSION}|g"
/etc/init/logstash-agent.conf
  juju-log "create logstash user"
  [ -z "$(id ${USER})"] && useradd ${USER}
  juju-log "create skeleton dir"
@@ -21,18 +21,21 @@
  mkdir -p ${BASEPATH}/logs
  juju-log "install logstash and create config files"
  # Check if a local copy of the jar exists
-if [ -f ${HOME}/files/charm/logstash-${VERSION}-monolithic.jar ]
+if [ -f ${HOME}/files/charm/logstash-${VERSION}.tar.gz ]
  then
- install -o root -g root -m 0644
${HOME}/files/charm/logstash-${VERSION}-monolithic.jar
${BASEPATH}/bin/logstash-monolithic.jar
+ install -o root -g root -m 0644
${HOME}/files/charm/logstash-${VERSION}.tar.gz
${BASEPATH}/bin/logstash.tar.gz
  else
    # Download logstash monolithic jar and checksum
- wget -q -O ${BASEPATH}/bin/logstash-monolithic.jar
${BASEURL}/logstash-${VERSION}-monolithic.jar
- if [[ $(md5sum "${BASEPATH}/bin/logstash-monolithic.jar" | cut -d " " -f
1) != ${CHECKSUM} ]]; then
- juju-log --log-level CRITICAL "Checksum of
${BASEPATH}/bin/logstash-monolithic.jar failed"
+ wget -q -O ${BASEPATH}/bin/logstash.tar.gz
${BASEURL}/logstash-${VERSION}.tar.gz
+ if [[ $(md5sum "${BASEPATH}/bin/logst...

Read more...

Revision history for this message
Review Queue (review-queue) wrote :

This items has failed automated testing! Results available here http://reports.vapour.ws/charm-tests/charm-bundle-test-10343-results

review: Needs Fixing (automated testing)
Revision history for this message
Charles Butler (lazypower) wrote :

Greeting Sergey,

I've taken a look over this MP and it appears the CI results are a bit of a misnomer - related to infrastructure issues rather than charm/test issues. I've pulled the branch and run the tests and it appears that this does a great job of upgrading the 1.1 series to 1.4 series.

Thanks for the contribution, great work!

review: Approve
Revision history for this message
Review Queue (review-queue) wrote :

The results (PASS) are in and available here: http://reports.vapour.ws/charm-tests/charm-bundle-test-10805-results

review: Approve (automated testing)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'files/charm/logstash-agent.conf'
2--- files/charm/logstash-agent.conf 2012-11-18 22:33:19 +0000
3+++ files/charm/logstash-agent.conf 2014-11-11 08:32:10 +0000
4@@ -11,12 +11,11 @@
5 respawn
6 respawn limit 5 30
7 env HOME=BASEPATH
8-env JAVA_OPTS='-Xms512m -Xmx512m'
9 chdir BASEPATH
10 setuid logstash
11 setgid adm
12 console log
13
14 script
15- java -jar BASEPATH/bin/logstash-monolithic.jar agent -f BASEPATH/conf.d/ --log BASEPATH/logs/logstash-agent.log -v
16-end script
17\ No newline at end of file
18+ bash BASEPATH/bin/logstash-VERSION/bin/logstash agent -f BASEPATH/conf.d/ --log BASEPATH/logs/logstash-agent.log -v
19+end script
20
21=== modified file 'hooks/common.sh'
22--- hooks/common.sh 2012-11-18 22:33:19 +0000
23+++ hooks/common.sh 2014-11-11 08:32:10 +0000
24@@ -3,9 +3,9 @@
25 #set -eux # -x for verbose logging to juju debug-log
26
27 # Set CONFIG constants
28-VERSION="1.1.4"
29-BASEURL="https://logstash.objects.dreamhost.com/release"
30-CHECKSUM="68ac6c953aad026752f69ae7c15b13f4"
31+VERSION="1.4.2"
32+BASEURL="https://download.elasticsearch.org/logstash/logstash"
33+CHECKSUM="6e6be734392e8c7d6d55e23d0bd8d2b3"
34 BASEPATH="/opt/logstash-agent"
35 USER="logstash"
36 HOST=`unit-get private-address`
37@@ -15,4 +15,4 @@
38 # USER=$(config-get user)
39 # juju-log "Logstash User: ${USER}"
40
41-juju-log "Finished loading config variables"
42\ No newline at end of file
43+juju-log "Finished loading config variables"
44
45=== modified file 'hooks/install'
46--- hooks/install 2012-12-02 23:34:57 +0000
47+++ hooks/install 2014-11-11 08:32:10 +0000
48@@ -11,7 +11,7 @@
49 # set redis listener
50 juju-log "Install upstart init script"
51 install -o root -g root -m 0644 ${HOME}/files/charm/logstash-agent.conf /etc/init/logstash-agent.conf
52-sed -i "s|BASEPATH|${BASEPATH}|g" /etc/init/logstash-agent.conf
53+sed -i "s|BASEPATH|${BASEPATH}|g;s|VERSION|${VERSION}|g" /etc/init/logstash-agent.conf
54 juju-log "create logstash user"
55 [ -z "$(id ${USER})"] && useradd ${USER}
56 juju-log "create skeleton dir"
57@@ -21,18 +21,21 @@
58 mkdir -p ${BASEPATH}/logs
59 juju-log "install logstash and create config files"
60 # Check if a local copy of the jar exists
61-if [ -f ${HOME}/files/charm/logstash-${VERSION}-monolithic.jar ]
62+if [ -f ${HOME}/files/charm/logstash-${VERSION}.tar.gz ]
63 then
64- install -o root -g root -m 0644 ${HOME}/files/charm/logstash-${VERSION}-monolithic.jar ${BASEPATH}/bin/logstash-monolithic.jar
65+ install -o root -g root -m 0644 ${HOME}/files/charm/logstash-${VERSION}.tar.gz ${BASEPATH}/bin/logstash.tar.gz
66 else
67 # Download logstash monolithic jar and checksum
68- wget -q -O ${BASEPATH}/bin/logstash-monolithic.jar ${BASEURL}/logstash-${VERSION}-monolithic.jar
69- if [[ $(md5sum "${BASEPATH}/bin/logstash-monolithic.jar" | cut -d " " -f 1) != ${CHECKSUM} ]]; then
70- juju-log --log-level CRITICAL "Checksum of ${BASEPATH}/bin/logstash-monolithic.jar failed"
71+ wget -q -O ${BASEPATH}/bin/logstash.tar.gz ${BASEURL}/logstash-${VERSION}.tar.gz
72+ if [[ $(md5sum "${BASEPATH}/bin/logstash.tar.gz" | cut -d " " -f 1) != ${CHECKSUM} ]]; then
73+ juju-log --log-level CRITICAL "Checksum of ${BASEPATH}/bin/logstash.tar.gz failed"
74 exit 1
75 fi
76 fi
77
78+juju-log "unpacking logstash"
79+tar zxf ${BASEPATH}/bin/logstash.tar.gz -C ${BASEPATH}/bin/
80+
81 juju-log "install syslog input config"
82 install -o root -g root -m 0644 ${HOME}/files/charm/input_file_syslog.conf ${BASEPATH}/conf.d/input_file_syslog.conf
83 sed -i "s|BASEPATH|${BASEPATH}|g" ${BASEPATH}/conf.d/input_file_syslog.conf
84@@ -41,4 +44,4 @@
85 echo "output { file { path => \"${BASEPATH}/logs/logstash-output.log\" } } " > ${BASEPATH}/conf.d/output_file.conf
86
87 juju-log "Make sure ${USER} user owns the whole kit and kaboodle"
88-chown -R ${USER}. ${BASEPATH}
89\ No newline at end of file
90+chown -R ${USER}. ${BASEPATH}

Subscribers

People subscribed via source and target branches

to all changes: