@cryptotaxi247 / netdata-1 / commits / 47a74dc94

Fix nightly builds and cron autoupdater (#5232)

* add gating before using polyverse * workaround for installations which doesn't use newer installer * fix #5225; #5229; #5228; #5208

Paweł Krupa committed Jan 20, 2019 at 20:43 UTC 47a74dc941ff94930d455183f931924f8bc58a2b
3 files changed +23 -6
netdata-installer.sh
+8
@@ -926,12 +926,20 @@ if [ "${AUTOUPDATE}" = "1" ]; then
926 rm -f "${crondir}/netdata-updater.sh"
927 fi
928 progress "Installing new netdata-updater in cron"
929 +
930 + rm ${installer_dir}/netdata-updater.sh || : #TODO(paulfantom): this workaround should be removed after v1.13.0-rc1. It just needs to be propagated
931 +
932 rm -f "${crondir}/netdata-updater"
933 if [ -f "${installer_dir}/packaging/installer/netdata-updater.sh" ]; then
934 sed "s|THIS_SHOULD_BE_REPLACED_BY_INSTALLER_SCRIPT|${NETDATA_USER_CONFIG_DIR}/.environment|" "${installer_dir}/packaging/installer/netdata-updater.sh" > ${crondir}/netdata-updater || exit 1
935 + #TODO(paulfantom): Following line is a workaround and should be removed after v1.13.0-rc1. It just needs time to be propagated.
936 + sed "s|THIS_SHOULD_BE_REPLACED_BY_INSTALLER_SCRIPT|${NETDATA_USER_CONFIG_DIR}/.environment|" "${installer_dir}/packaging/installer/netdata-updater.sh" > ${installer_dir}/netdata-updater.sh || exit 1
937 else
938 sed "s|THIS_SHOULD_BE_REPLACED_BY_INSTALLER_SCRIPT|${NETDATA_USER_CONFIG_DIR}/.environment|" "${netdata_source_dir}/packaging/installer/netdata-updater.sh" > ${crondir}/netdata-updater || exit 1
939 + #TODO(paulfantom): Following line is a workaround and should be removed after v1.13.0-rc1. It just needs time to be propagated.
940 + sed "s|THIS_SHOULD_BE_REPLACED_BY_INSTALLER_SCRIPT|${NETDATA_USER_CONFIG_DIR}/.environment|" "${netdata_source_dir}/packaging/installer/netdata-updater.sh" > ${installer_source_dir}/netdata-updater.sh || exit 1
941 fi
942 +
943 chmod 0755 ${crondir}/netdata-updater
944 echo >&2 "Update script is located at ${TPUT_GREEN}${TPUT_BOLD}${crondir}/netdata-updater${TPUT_RESET}"
945 echo >&2
packaging/docker/Dockerfile
+7 -5
@@ -71,11 +71,13 @@ RUN apk --no-cache add curl \
71 py-yaml \
72 python
73
74 -# Subscribe to Polyverse's Polymorphic Linux repositories and reinstall all packages, so they are scrambled
75 -RUN curl https://sh.polyverse.io | sh -s install gcxce5byVQbtRz0iwfGkozZwy support+netdata@polyverse.io && \
76 - apk update && \
77 - apk upgrade --available --no-cache && \
78 - sed -in 's/^#//g' /etc/apk/repositories
74 +# Conditional subscribiton to Polyverse's Polymorphic Linux repositories
75 +RUN if [ "$(uname -m)" == "x86_64" ]; then \
76 + curl https://sh.polyverse.io | sh -s install gcxce5byVQbtRz0iwfGkozZwy support+netdata@polyverse.io; \
77 + apk update; \
78 + apk upgrade --available --no-cache; \
79 + sed -in 's/^#//g' /etc/apk/repositories; \
80 + fi
81
82
83 # Copy files over
packaging/installer/netdata-updater.sh
+8 -1
@@ -71,7 +71,14 @@ failed() {
71 update() {
72 [ -z "${tmp}" ] && info "Running on a terminal - (this script also supports running headless from crontab)"
73
74 - dir=$(mktemp -d)
74 + # Check if tmp is mounted as noexec
75 + if grep -Eq '^[^ ]+ /tmp [^ ]+ ([^ ]*,)?noexec[, ]' /proc/mounts; then
76 + pattern="/opt/netdata-updater-XXXXXX"
77 + else
78 + pattern="/tmp/netdata-updater-XXXXXX"
79 + fi
80 +
81 + dir=$(mktemp -d "$pattern")
82
83 cd "$dir"
84