Compare commits

...

2 Commits

Author SHA1 Message Date
6d07971816 disable auto_tagdisable auto_tag
All checks were successful
continuous-integration/drone/push Build is passing
2020-02-05 01:50:52 -08:00
1a5e30978e incorporate upstream 'latest' dir
All checks were successful
continuous-integration/drone/push Build is passing
2020-02-05 01:48:15 -08:00
4 changed files with 44 additions and 34 deletions

View File

@ -10,7 +10,6 @@ steps:
from_secret: docker_username from_secret: docker_username
password: password:
from_secret: docker_password from_secret: docker_password
auto_tag: true
tags: tags:
- ${DRONE_COMMIT_SHA} - ${DRONE_COMMIT_SHA}
- ${DRONE_BRANCH} - ${DRONE_BRANCH}

View File

@ -1,16 +1,21 @@
FROM debian:jessie FROM debian:stretch
ADD scripts/build.sh /build.sh ADD scripts/build.sh /build.sh
ADD scripts/run.sh /run.sh ADD scripts/run.sh /run.sh
RUN chmod +x /run.sh /build.sh && sync && sleep 1 && /build.sh RUN chmod +x /run.sh /build.sh && sync && sleep 1 && /build.sh
RUN touch /etc/netdata/.opt-out-from-anonymous-statistics
WORKDIR / WORKDIR /
ENV NETDATA_PORT=19999 SSMTP_TLS=YES SSMTP_SERVER=smtp.gmail.com SSMTP_PORT=587 SSMTP_HOSTNAME=localhost ENV NETDATA_PORT=19999 SMTP_TLS=on SMTP_STARTTLS=on SMTP_SERVER=smtp.example.com SMTP_PORT=587 SMTP_FROM=localhost
# supposedly it now respects this
ENV DO_NOT_TRACK=1 ENV DO_NOT_TRACK=1
EXPOSE $NETDATA_PORT EXPOSE $NETDATA_PORT
VOLUME /etc/netdata/override
ENTRYPOINT ["/run.sh"] ENTRYPOINT ["/run.sh"]

View File

@ -2,22 +2,20 @@
set -e set -e
DEBIAN_FRONTEND=noninteractive DEBIAN_FRONTEND=noninteractive
# some mirrors have issues, i skipped httpredir in favor of an eu mirror # belt and suspenders
export DO_NOT_TRACK=1
echo "deb http://ftp.nl.debian.org/debian/ jessie main" > /etc/apt/sources.list
echo "deb http://security.debian.org/debian-security jessie/updates main" >> /etc/apt/sources.list
# install dependencies for build # install dependencies for build
apt-get -qq update apt-get -qq update
apt-get -y install zlib1g-dev uuid-dev libmnl-dev gcc make curl git autoconf autogen automake pkg-config netcat-openbsd jq apt-get -y install zlib1g-dev uuid-dev libmnl-dev gcc make curl git autoconf autogen automake pkg-config netcat-openbsd jq libuv1-dev liblz4-dev libjudy-dev libssl-dev
apt-get -y install autoconf-archive lm-sensors nodejs python python-mysqldb python-yaml apt-get -y install autoconf-archive lm-sensors nodejs python python-mysqldb python-yaml libjudydebian1 libuv1 liblz4-1 openssl
apt-get -y install ssmtp mailutils apcupsd apt-get -y install msmtp msmtp-mta apcupsd fping
# fetch netdata # fetch netdata
git clone https://github.com/netdata/netdata.git /netdata.git git clone https://github.com/netdata/netdata.git /netdata.git
cd /netdata.git cd /netdata.git
# v1.19.0 release:
git checkout 5000257f0171271cb3ee2cf0fe02e8a2154ddf2e git checkout 5000257f0171271cb3ee2cf0fe02e8a2154ddf2e
# use the provided installer # use the provided installer
@ -26,23 +24,18 @@ git checkout 5000257f0171271cb3ee2cf0fe02e8a2154ddf2e
touch /etc/netdata/.opt-out-from-anonymous-statistics touch /etc/netdata/.opt-out-from-anonymous-statistics
# removed hack on 2017/1/3
#chown root:root /usr/libexec/netdata/plugins.d/apps.plugin
#chmod 4755 /usr/libexec/netdata/plugins.d/apps.plugin
# remove build dependencies # remove build dependencies
cd / cd /
rm -rf /netdata.git rm -rf /netdata.git
dpkg -P zlib1g-dev uuid-dev libmnl-dev gcc make git autoconf autogen automake pkg-config dpkg -P zlib1g-dev uuid-dev libmnl-dev gcc make git autoconf autogen automake pkg-config libuv1-dev liblz4-dev libjudy-dev libssl-dev
apt-get -y autoremove apt-get -y autoremove
apt-get clean apt-get clean
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# symlink access log and error log to stdout/stderr # symlink access log and error log to stdout/stderr
ln -sf /dev/stdout /var/log/netdata/access.log ln -sf /dev/stdout /var/log/netdata/access.log
ln -sf /dev/stdout /var/log/netdata/debug.log ln -sf /dev/stdout /var/log/netdata/debug.log
ln -sf /dev/stderr /var/log/netdata/error.log ln -sf /dev/stderr /var/log/netdata/error.log

View File

@ -4,34 +4,41 @@
chown root:root /usr/share/netdata/web/ -R chown root:root /usr/share/netdata/web/ -R
echo -n "" > /usr/share/netdata/web/version.txt echo -n "" > /usr/share/netdata/web/version.txt
# set up ssmtp # set up msmtp
if [[ $SSMTP_TO ]]; then if [[ $SMTP_TO ]]; then
cat << EOF > /etc/ssmtp/ssmtp.conf cat << EOF > /etc/msmtprc
root=$SSMTP_TO account default
mailhub=$SSMTP_SERVER:$SSMTP_PORT aliases /etc/msmtp_aliases
UseSTARTTLS=$SSMTP_TLS from $SMTP_FROM
hostname=$SSMTP_HOSTNAME host $SMTP_SERVER
FromLineOverride=NO port $SMTP_PORT
tls $SMTP_TLS
tls_starttls $SMTP_STARTTLS
tls_certcheck off
EOF EOF
cat << EOF > /etc/ssmtp/revaliases cat << EOF > /etc/msmtp_aliases
netdata:netdata@$SSMTP_HOSTNAME:$SSMTP_SERVER:$SSMTP_PORT netdata: $SMTP_TO
root:netdata@$SSMTP_HOSTNAME:$SSMTP_SERVER:$SSMTP_PORT root: $SMTP_TO
EOF EOF
fi fi
if [[ $SSMTP_USER ]]; then if [[ $SMTP_USER ]]; then
cat << EOF >> /etc/ssmtp/ssmtp.conf cat << EOF >> /etc/msmtprc
AuthUser=$SSMTP_USER auth on
user $SMTP_USER
EOF EOF
fi fi
if [[ $SSMTP_PASS ]]; then if [[ $SMTP_PASS ]]; then
cat << EOF >> /etc/ssmtp/ssmtp.conf cat << EOF >> /etc/msmtprc
AuthPass=$SSMTP_PASS password $SMTP_PASS
EOF EOF
fi fi
# copy conf from NETDATA_STOCK_CONFIG_DIR (normally under /usr/lib/netdata/conf.d) to NETDATA_USER_CONFIG_DIR (normally under /etc/netdata)
cp /usr/lib/netdata/conf.d/health_alarm_notify.conf /etc/netdata
if [[ $SLACK_WEBHOOK_URL ]]; then if [[ $SLACK_WEBHOOK_URL ]]; then
sed -i -e "s@SLACK_WEBHOOK_URL=\"\"@SLACK_WEBHOOK_URL=\"${SLACK_WEBHOOK_URL}\"@" /etc/netdata/health_alarm_notify.conf sed -i -e "s@SLACK_WEBHOOK_URL=\"\"@SLACK_WEBHOOK_URL=\"${SLACK_WEBHOOK_URL}\"@" /etc/netdata/health_alarm_notify.conf
fi fi
@ -107,4 +114,10 @@ for f in /etc/netdata/override/*; do
done done
# main entrypoint # main entrypoint
touch /etc/netdata/python.d.conf
# belt and suspenders
export DO_NOT_TRACK=1
touch /etc/netdata/.opt-out-from-anonymous-statistics
exec /usr/sbin/netdata -D -u root -s /host -p ${NETDATA_PORT} ${NETDATA_ARGS} "$@" exec /usr/sbin/netdata -D -u root -s /host -p ${NETDATA_PORT} ${NETDATA_ARGS} "$@"