summaryrefslogtreecommitdiffstats
path: root/packaging
diff options
context:
space:
mode:
authorMansour Behabadi <57921115+ncmans@users.noreply.github.com>2020-01-29 11:03:22 +1100
committerGitHub <noreply@github.com>2020-01-29 11:03:22 +1100
commit165aa68c940c636d9554919cef32203bc6373ffe (patch)
treecdf89ed713b84141801d6a1c021cc0ba4e79ce1d /packaging
parent1477784048319e84127e466add6eb4a092c235e1 (diff)
Add release channel customization to docker build (#7373)
* Add release channel customization to docker build * Add release channel to travis config * Build releases with stable channel * Update packaging/docker/build.sh Co-Authored-By: Konstantinos Natsakis <5933427+knatsakis@users.noreply.github.com> * Update packaging/docker/build.sh Co-Authored-By: Konstantinos Natsakis <5933427+knatsakis@users.noreply.github.com> Co-authored-by: Mansour Behabadi <mansour@oxplot.com> Co-authored-by: Konstantinos Natsakis <5933427+knatsakis@users.noreply.github.com>
Diffstat (limited to 'packaging')
-rw-r--r--packaging/docker/Dockerfile6
-rwxr-xr-xpackaging/docker/build.sh6
-rwxr-xr-xpackaging/manual_nightly_deployment.sh2
3 files changed, 12 insertions, 2 deletions
diff --git a/packaging/docker/Dockerfile b/packaging/docker/Dockerfile
index d2ea04bb9c..e8d36c159a 100644
--- a/packaging/docker/Dockerfile
+++ b/packaging/docker/Dockerfile
@@ -7,6 +7,9 @@ ARG ARCH=amd64
# This image contains preinstalled dependecies
FROM netdata/builder:${ARCH} as builder
+# One of 'nightly' or 'stable'
+ARG RELEASE_CHANNEL=nightly
+
ENV JUDY_VER 1.0.5
# Copy source
@@ -16,7 +19,8 @@ WORKDIR /opt/netdata.git
# Install from source
RUN chmod +x netdata-installer.sh && \
cp -rp /deps/* /usr/local/ && \
- ./netdata-installer.sh --dont-wait --dont-start-it
+ ./netdata-installer.sh --dont-wait --dont-start-it \
+ $([ "$RELEASE_CHANNEL" = stable ] && echo --stable-channel)
# files to one directory
RUN mkdir -p /app/usr/sbin/ \
diff --git a/packaging/docker/build.sh b/packaging/docker/build.sh
index d478945feb..a1e6f6481f 100755
--- a/packaging/docker/build.sh
+++ b/packaging/docker/build.sh
@@ -19,6 +19,11 @@ ARCH_MAP=(["i386"]="386" ["amd64"]="amd64" ["armhf"]="arm" ["aarch64"]="arm64")
DEVEL_ARCHS=(amd64)
[ "${ARCHS}" ] || ARCHS="${!ARCH_MAP[@]}" # Use default ARCHS unless ARCHS are externally provided
+if [ "${RELEASE_CHANNEL}" != "nightly" ] && [ "${RELEASE_CHANNEL}" != "stable" ]; then
+ echo "RELEASE_CHANNEL must be set to either 'nightly' or 'stable' - build cannot proceed"
+ exit 1
+fi
+
if [ -z ${REPOSITORY} ]; then
REPOSITORY="${TRAVIS_REPO_SLUG}"
if [ -z ${REPOSITORY} ]; then
@@ -64,6 +69,7 @@ for ARCH in ${ARCHS[@]}; do
echo "Building tag ${TAG}.."
eval docker build --no-cache \
--build-arg ARCH="${ARCH}" \
+ --build-arg RELEASE_CHANNEL="${RELEASE_CHANNEL}" \
--tag "${TAG}" \
--file packaging/docker/Dockerfile ./
echo "..Done!"
diff --git a/packaging/manual_nightly_deployment.sh b/packaging/manual_nightly_deployment.sh
index a0999bb188..259ffb1ee7 100755
--- a/packaging/manual_nightly_deployment.sh
+++ b/packaging/manual_nightly_deployment.sh
@@ -60,7 +60,7 @@ publish_docker() {
fi
echo "Building Docker images.."
- packaging/docker/build.sh
+ RELEASE_CHANNEL=nightly packaging/docker/build.sh
echo "Publishing Docker images.."
packaging/docker/publish.sh