diff options
Diffstat (limited to 'makeself')
-rwxr-xr-x | makeself/install-or-update.sh | 2 | ||||
-rwxr-xr-x | makeself/jobs/70-netdata-git.install.sh | 4 | ||||
-rwxr-xr-x | makeself/jobs/99-makeself.install.sh | 68 | ||||
-rw-r--r-- | makeself/makeself.lsm | 2 |
4 files changed, 46 insertions, 30 deletions
diff --git a/makeself/install-or-update.sh b/makeself/install-or-update.sh index b64e7be335..34630cf169 100755 --- a/makeself/install-or-update.sh +++ b/makeself/install-or-update.sh @@ -162,7 +162,9 @@ progress "starting netdata" restart_netdata "/opt/netdata/bin/netdata" if [ $? -eq 0 ] then + download_netdata_conf "${NETDATA_USER}:${NETDATA_GROUP}" "/opt/netdata/etc/netdata/netdata.conf" "http://localhost:19999/netdata.conf" netdata_banner "is installed and running now!" else + generate_netdata_conf "${NETDATA_USER}:${NETDATA_GROUP}" "/opt/netdata/etc/netdata/netdata.conf" "http://localhost:19999/netdata.conf" netdata_banner "is installed now!" fi diff --git a/makeself/jobs/70-netdata-git.install.sh b/makeself/jobs/70-netdata-git.install.sh index 0486ce11a8..a9e6b39b48 100755 --- a/makeself/jobs/70-netdata-git.install.sh +++ b/makeself/jobs/70-netdata-git.install.sh @@ -16,8 +16,12 @@ run ./netdata-installer.sh --install "${NETDATA_INSTALL_PARENT}" \ --dont-start-it \ ${NULL} +# delete the generated netdata.conf, so that the static installer will generate a new one +rm "${NETDATA_INSTALL_PATH}/etc/netdata/netdata.conf" + if [ ${NETDATA_BUILD_WITH_DEBUG} -eq 0 ] then run strip ${NETDATA_INSTALL_PATH}/bin/netdata run strip ${NETDATA_INSTALL_PATH}/usr/libexec/netdata/plugins.d/apps.plugin + run strip ${NETDATA_INSTALL_PATH}/usr/libexec/netdata/plugins.d/cgroup-network fi diff --git a/makeself/jobs/99-makeself.install.sh b/makeself/jobs/99-makeself.install.sh index 465a319527..528d18fcb9 100755 --- a/makeself/jobs/99-makeself.install.sh +++ b/makeself/jobs/99-makeself.install.sh @@ -2,12 +2,44 @@ . $(dirname "${0}")/../functions.sh "${@}" || exit 1 +run cd "${NETDATA_SOURCE_PATH}" || exit 1 + +# ----------------------------------------------------------------------------- +# find the netdata version + +NOWNER="unknown" +ORIGIN="$(git config --get remote.origin.url || echo "unknown")" +if [[ "${ORIGIN}" =~ ^git@github.com:.*/netdata.*$ ]] + then + NOWNER="${ORIGIN/git@github.com:/}" + NOWNER="${NOWNER/\/netdata*/}" + +elif [[ "${ORIGIN}" =~ ^https://github.com/.*/netdata.*$ ]] + then + NOWNER="${ORIGIN/https:\/\/github.com\//}" + NOWNER="${NOWNER/\/netdata*/}" +fi + +# make sure it does not have any slashes in it +NOWNER="${NOWNER//\//_}" + +if [ "${NOWNER}" = "firehol" ] + then + NOWNER= +else + NOWNER="-${NOWNER}" +fi + +VERSION="$(git describe || echo "undefined")" +[ -z "${VERSION}" ] && VERSION="undefined" + +FILE_VERSION="${VERSION}-$(uname -m)-$(date +"%Y%m%d-%H%M%S")${NOWNER}" + # ----------------------------------------------------------------------------- # copy the files needed by makeself installation run mkdir -p "${NETDATA_INSTALL_PATH}/system" -run cd "${NETDATA_SOURCE_PATH}" || exit 1 cp \ makeself/post-installer.sh \ @@ -65,6 +97,9 @@ rm "${NETDATA_INSTALL_PATH}/sbin" \ # ----------------------------------------------------------------------------- # create the makeself archive +cat "${NETDATA_MAKESELF_PATH}/makeself.lsm" |\ + sed "s|NETDATA_VERSION|${FILE_VERSION}|g" >"${NETDATA_MAKESELF_PATH}/makeself.lsm.tmp" + "${NETDATA_MAKESELF_PATH}/makeself.sh" \ --gzip \ --complevel 9 \ @@ -72,7 +107,7 @@ rm "${NETDATA_INSTALL_PATH}/sbin" \ --needroot \ --target "${NETDATA_INSTALL_PATH}" \ --header "${NETDATA_MAKESELF_PATH}/makeself-header.sh" \ - --lsm "${NETDATA_MAKESELF_PATH}/makeself.lsm" \ + --lsm "${NETDATA_MAKESELF_PATH}/makeself.lsm.tmp" \ --license "${NETDATA_MAKESELF_PATH}/makeself-license.txt" \ --help-header "${NETDATA_MAKESELF_PATH}/makeself-help-header.txt" \ "${NETDATA_INSTALL_PATH}" \ @@ -81,37 +116,12 @@ rm "${NETDATA_INSTALL_PATH}/sbin" \ ./system/post-installer.sh \ ${NULL} +rm "${NETDATA_MAKESELF_PATH}/makeself.lsm.tmp" # ----------------------------------------------------------------------------- # copy it to the netdata build dir -NOWNER="unknown" -ORIGIN="$(git config --get remote.origin.url || echo "unknown")" -if [[ "${ORIGIN}" =~ ^git@github.com:.*/netdata.*$ ]] - then - NOWNER="${ORIGIN/git@github.com:/}" - NOWNER="${NOWNER/\/netdata*/}" - -elif [[ "${ORIGIN}" =~ ^https://github.com/.*/netdata.*$ ]] - then - NOWNER="${ORIGIN/https:\/\/github.com\//}" - NOWNER="${NOWNER/\/netdata*/}" -fi - -# make sure it does not have any slashes in it -NOWNER="${NOWNER//\//_}" - -if [ "${NOWNER}" = "firehol" ] - then - NOWNER= -else - NOWNER="-${NOWNER}" -fi - -VERSION="$(git describe || echo "undefined")" -[ -z "${VERSION}" ] && VERSION="undefined" - -FILE="netdata-${VERSION}-$(uname -m)-$(date +"%Y%m%d-%H%M%S")${NOWNER}.gz.run" +FILE="netdata-${FILE_VERSION}.gz.run" cp "${NETDATA_INSTALL_PATH}.gz.run" "${FILE}" echo >&2 "Self-extracting installer copied to '${FILE}'" diff --git a/makeself/makeself.lsm b/makeself/makeself.lsm index 0267962948..6bd4703db2 100644 --- a/makeself/makeself.lsm +++ b/makeself/makeself.lsm @@ -1,6 +1,6 @@ Begin3 Title: netdata -Version: 1.6.0 +Version: NETDATA_VERSION Description: netdata is a system for distributed real-time performance and health monitoring. It provides unparalleled insights, in real-time, of everything happening on the system it runs (including applications such as web and database servers), using |