Fail dockerfile or start.sh if puppet exits 1
Previous tests only verified exit code is less than 4, but sometimes error 1 can occur for certain cases, including parse failure or template issues. Change-Id: I226f1147f8c62c5be7fc7cedb01645770939a7d9 Partial-Bug: #1392698
This commit is contained in:
parent
caf72f3e77
commit
5a4c173969
|
@ -10,7 +10,7 @@ RUN rm -rf /etc/yum.repos.d/*; echo -e "[nailgun]\nname=Nailgun Local Repo\nbase
|
|||
ADD etc /etc
|
||||
ADD start.sh /usr/local/bin/start.sh
|
||||
|
||||
RUN puppet apply --detailed-exitcodes -d -v /etc/puppet/modules/nailgun/examples/astute-only.pp; [ $? -lt 4 ]
|
||||
RUN puppet apply --detailed-exitcodes -d -v /etc/puppet/modules/nailgun/examples/astute-only.pp; [[ $? == 0 || $? == 2 ]]
|
||||
|
||||
RUN chmod +x /usr/local/bin/start.sh;echo -e "[nailgun]\nname=Nailgun Local Repo\nbaseurl=file:/var/www/nailgun/centos/x86_64\ngpgcheck=0" > /etc/yum.repos.d/nailgun.repo; yum clean all
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ ADD etc /etc
|
|||
ADD start.sh /usr/local/bin/start.sh
|
||||
|
||||
#Workaround for dnsmasq startup and create blank SSH key during build
|
||||
RUN echo -e "NETWORKING=yes\nHOSTNAME=$HOSTNAME" > /etc/sysconfig/network; mkdir -p /root/.ssh; chmod 700 /root/.ssh; touch /root/.ssh/id_rsa.pub; /etc/init.d/httpd start && puppet apply --detailed-exitcodes -dv /etc/puppet/modules/nailgun/examples/cobbler-only.pp; [ $? -lt 4 ]
|
||||
RUN echo -e "NETWORKING=yes\nHOSTNAME=$HOSTNAME" > /etc/sysconfig/network; mkdir -p /root/.ssh; chmod 700 /root/.ssh; touch /root/.ssh/id_rsa.pub; /etc/init.d/httpd start && puppet apply --detailed-exitcodes -dv /etc/puppet/modules/nailgun/examples/cobbler-only.pp; [[ $? == 0 || $? == 2 ]]
|
||||
|
||||
RUN chmod +x /usr/local/bin/start.sh;echo -e "[nailgun]\nname=Nailgun Local Repo\nbaseurl=file:/var/www/nailgun/centos/x86_64\ngpgcheck=0" > /etc/yum.repos.d/nailgun.repo; yum clean all
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ RUN yum clean all
|
|||
|
||||
ADD etc /etc
|
||||
|
||||
RUN puppet apply --detailed-exitcodes -d -v /etc/puppet/modules/nailgun/examples/keystone-only.pp; [ $? -lt 4 ]
|
||||
RUN puppet apply --detailed-exitcodes -d -v /etc/puppet/modules/nailgun/examples/keystone-only.pp; [[ $? == 0 || $? == 2 ]]
|
||||
|
||||
ADD start.sh /usr/local/bin/start.sh
|
||||
RUN chmod +x /usr/local/bin/start.sh
|
||||
|
|
|
@ -7,7 +7,7 @@ rpm --rebuilddb
|
|||
|
||||
exitcode=0
|
||||
puppet apply --detailed-exitcodes -v /etc/puppet/modules/nailgun/examples/keystone-only.pp || exitcode=$?
|
||||
if [ $exitcode -ge 4 ]; then
|
||||
if [[ $exitcode != 0 && $exitcode != 2 ]]; then
|
||||
echo Puppet apply failed with exit code: $exitcode
|
||||
exit $exitcode
|
||||
fi
|
||||
|
|
|
@ -9,7 +9,7 @@ RUN rm -rf /etc/yum.repos.d/*; echo -e "[nailgun]\nname=Nailgun Local Repo\nbase
|
|||
ADD etc /etc
|
||||
ADD start.sh /usr/local/bin/start.sh
|
||||
|
||||
RUN mkdir -p /var/lib/hiera && touch /etc/puppet/hiera.yaml /var/lib/hiera/common.yaml; /usr/bin/puppet apply --detailed-exitcodes -d -v /etc/puppet/modules/mcollective/examples/mcollective-server-only.pp; [ $? -lt 4 ]
|
||||
RUN mkdir -p /var/lib/hiera && touch /etc/puppet/hiera.yaml /var/lib/hiera/common.yaml; /usr/bin/puppet apply --detailed-exitcodes -d -v /etc/puppet/modules/mcollective/examples/mcollective-server-only.pp; [[ $? == 0 || $? == 2 ]]
|
||||
|
||||
#FIXME(mattymo): Workaround to make diagnostic snapshots work
|
||||
RUN yum install -y nailgun Shotgun; mkdir -p /opt/nailgun/bin /var/www/nailgun/dump; ln -s /usr/bin/nailgun_dump /opt/nailgun/bin/nailgun_dump
|
||||
|
|
|
@ -12,7 +12,7 @@ RUN rm -rf /etc/yum.repos.d/*;echo -e "[nailgun]\nname=Nailgun Local Repo\nbaseu
|
|||
ADD etc /etc
|
||||
ADD start.sh /usr/local/bin/start.sh
|
||||
|
||||
RUN puppet apply --detailed-exitcodes -d -v /etc/puppet/modules/nailgun/examples/nailgun-only.pp; [ $? -lt 4 ]
|
||||
RUN puppet apply --detailed-exitcodes -d -v /etc/puppet/modules/nailgun/examples/nailgun-only.pp; [[ $? == 0 || $? == 2 ]]
|
||||
RUN mkdir -p /var/log/remote /var/www/nailgun
|
||||
|
||||
#clean everything up
|
||||
|
|
|
@ -9,8 +9,7 @@ ADD etc /etc
|
|||
ADD start.sh /usr/local/bin/start.sh
|
||||
|
||||
RUN mkdir -p /var/www/nailgun;chmod 755 /var/www/nailgun
|
||||
RUN puppet apply --detailed-exitcodes -d -v /etc/puppet/modules/nailgun/examples/nginx-only.pp; [ $? -lt 4 ]
|
||||
|
||||
RUN puppet apply --detailed-exitcodes -d -v /etc/puppet/modules/nailgun/examples/nginx-only.pp; [[ $? == 0 || $? == 2 ]]
|
||||
|
||||
RUN echo -e "[nailgun]\nname=Nailgun Local Repo\nbaseurl=file:/var/www/nailgun/centos/x86_64\ngpgcheck=0" > /etc/yum.repos.d/nailgun.repo; yum clean all; chmod +x /usr/local/bin/start.sh
|
||||
|
||||
|
|
|
@ -10,8 +10,7 @@ RUN rm -rf /etc/yum.repos.d/*;echo -e "[nailgun]\nname=Nailgun Local Repo\nbaseu
|
|||
ADD etc /etc
|
||||
ADD start.sh /usr/local/bin/start.sh
|
||||
|
||||
RUN puppet apply --detailed-exitcodes -d -v /etc/puppet/modules/nailgun/examples/ostf-only.pp; [ $? -lt 4 ]
|
||||
|
||||
RUN puppet apply --detailed-exitcodes -d -v /etc/puppet/modules/nailgun/examples/ostf-only.pp; [[ $? == 0 || $? == 2 ]]
|
||||
|
||||
RUN echo -e "[nailgun]\nname=Nailgun Local Repo\nbaseurl=file:/var/www/nailgun/centos/x86_64\ngpgcheck=0" > /etc/yum.repos.d/nailgun.repo; yum clean all; chmod +x /usr/local/bin/start.sh
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ RUN rm -rf /etc/yum.repos.d/*; echo -e "[nailgun]\nname=Nailgun Local Repo\nbase
|
|||
ADD etc /etc
|
||||
ADD start.sh /usr/local/bin/start.sh
|
||||
|
||||
RUN mkdir -p /var/lib/hiera /var/log/rabbitmq; touch /var/lib/hiera/common.yaml;puppet apply --detailed-exitcodes -d -v /etc/puppet/modules/nailgun/examples/rabbitmq-only.pp; [ $? -lt 4 ]
|
||||
RUN mkdir -p /var/lib/hiera /var/log/rabbitmq; touch /var/lib/hiera/common.yaml;puppet apply --detailed-exitcodes -d -v /etc/puppet/modules/nailgun/examples/rabbitmq-only.pp; [[ $? == 0 || $? == 2 ]]
|
||||
|
||||
|
||||
RUN echo -e "[nailgun]\nname=Nailgun Local Repo\nbaseurl=file:/var/www/nailgun/centos/x86_64\ngpgcheck=0" > /etc/yum.repos.d/nailgun.repo; yum clean all; chmod +x /usr/local/bin/start.sh
|
||||
|
|
|
@ -10,7 +10,7 @@ chown -R rabbitmq:rabbitmq /var/log/rabbitmq
|
|||
|
||||
exitcode=0
|
||||
puppet apply --detailed-exitcodes -v /etc/puppet/modules/nailgun/examples/rabbitmq-only.pp || exitcode=$?
|
||||
if [ $exitcode -ge 4 ]; then
|
||||
if [[ $exitcode != 0 && $exitcode != 2 ]]; then
|
||||
echo Puppet apply failed with exit code: $exitcode
|
||||
exit $exitcode
|
||||
fi
|
||||
|
|
|
@ -10,8 +10,7 @@ RUN rm -rf /etc/yum.repos.d/*; echo -e "[nailgun]\nname=Nailgun Local Repo\nbase
|
|||
ADD etc /etc
|
||||
ADD start.sh /usr/local/bin/start.sh
|
||||
|
||||
RUN puppet apply --detailed-exitcodes -d -v /etc/puppet/modules/nailgun/examples/puppetsync-only.pp; [ $? -lt 4 ]
|
||||
|
||||
RUN puppet apply --detailed-exitcodes -d -v /etc/puppet/modules/nailgun/examples/puppetsync-only.pp; [[ $? == 0 || $? == 2 ]]
|
||||
|
||||
RUN echo -e "[nailgun]\nname=Nailgun Local Repo\nbaseurl=file:/var/www/nailgun/centos/x86_64\ngpgcheck=0" > /etc/yum.repos.d/nailgun.repo; yum clean all;chmod +x /usr/local/bin/start.sh
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ ADD start.sh /usr/local/bin/start.sh
|
|||
|
||||
# let's disable some services and commands since we don't need them in our container
|
||||
RUN echo -e '#!/bin/bash\n#chkconfig: 345 20 80\nexit 0' > /etc/init.d/rsyslog;echo -e '#!/bin/bash\n#chkconfig: 345 20 80\nexit 0' > /etc/init.d/iptables;echo -e '#!/bin/bash\n#chkconfig: 345 20 80\nexit 0' > /sbin/iptables;chmod +x /etc/init.d/iptables /sbin/iptables /etc/init.d/rsyslog
|
||||
RUN touch /etc/puppet/hiera.yaml;/usr/bin/puppet apply --detailed-exitcodes -d -v /etc/puppet/modules/nailgun/examples/rsyslog-only.pp; [ $? -lt 4 ]
|
||||
RUN touch /etc/puppet/hiera.yaml;/usr/bin/puppet apply --detailed-exitcodes -d -v /etc/puppet/modules/nailgun/examples/rsyslog-only.pp; [[ $? == 0 || $? == 2 ]]
|
||||
RUN echo -e "[nailgun]\nname=Nailgun Local Repo\nbaseurl=file:/var/www/nailgun/centos/x86_64\ngpgcheck=0" > /etc/yum.repos.d/nailgun.repo; yum clean all;chmod +x /usr/local/bin/start.sh
|
||||
|
||||
EXPOSE 514 514/udp
|
||||
|
|
Loading…
Reference in New Issue