@cryptotaxi247 / netdata-1 / commits / 165aa68c9

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>

Mansour Behabadi committed Jan 29, 2020 at 11:03 UTC 165aa68c940c636d9554919cef32203bc6373ffe
4 files changed +18 -2
.travis.yml
+6
@@ -5,6 +5,10 @@ addons:
5 apt:
6 packages: ['moreutils']
7
8 +env:
9 + global:
10 + - RELEASE_CHANNEL=nightly
11 +
12 before_install:
13 - exec > >(ts -s '%H:%M:%.S ') 2>&1
14 - source .travis/utils.sh
@@ -462,6 +466,8 @@ jobs:
466 # We only publish if a TAG has been set during packaging
467 - stage: Publish for release
468 _template: &RELEASE_TEMPLATE
469 + env:
470 + - RELEASE_CHANNEL: stable
471 git:
472 depth: false
473 script:
packaging/docker/Dockerfile
+5 -1
@@ -7,6 +7,9 @@ ARG ARCH=amd64
7 # This image contains preinstalled dependecies
8 FROM netdata/builder:${ARCH} as builder
9
10 +# One of 'nightly' or 'stable'
11 +ARG RELEASE_CHANNEL=nightly
12 +
13 ENV JUDY_VER 1.0.5
14
15 # Copy source
@@ -16,7 +19,8 @@ WORKDIR /opt/netdata.git
19 # Install from source
20 RUN chmod +x netdata-installer.sh && \
21 cp -rp /deps/* /usr/local/ && \
19 - ./netdata-installer.sh --dont-wait --dont-start-it
22 + ./netdata-installer.sh --dont-wait --dont-start-it \
23 + $([ "$RELEASE_CHANNEL" = stable ] && echo --stable-channel)
24
25 # files to one directory
26 RUN mkdir -p /app/usr/sbin/ \
packaging/docker/build.sh
+6
@@ -19,6 +19,11 @@ ARCH_MAP=(["i386"]="386" ["amd64"]="amd64" ["armhf"]="arm" ["aarch64"]="arm64")
19 DEVEL_ARCHS=(amd64)
20 [ "${ARCHS}" ] || ARCHS="${!ARCH_MAP[@]}" # Use default ARCHS unless ARCHS are externally provided
21
22 +if [ "${RELEASE_CHANNEL}" != "nightly" ] && [ "${RELEASE_CHANNEL}" != "stable" ]; then
23 + echo "RELEASE_CHANNEL must be set to either 'nightly' or 'stable' - build cannot proceed"
24 + exit 1
25 +fi
26 +
27 if [ -z ${REPOSITORY} ]; then
28 REPOSITORY="${TRAVIS_REPO_SLUG}"
29 if [ -z ${REPOSITORY} ]; then
@@ -64,6 +69,7 @@ for ARCH in ${ARCHS[@]}; do
69 echo "Building tag ${TAG}.."
70 eval docker build --no-cache \
71 --build-arg ARCH="${ARCH}" \
72 + --build-arg RELEASE_CHANNEL="${RELEASE_CHANNEL}" \
73 --tag "${TAG}" \
74 --file packaging/docker/Dockerfile ./
75 echo "..Done!"
packaging/manual_nightly_deployment.sh
+1 -1
@@ -60,7 +60,7 @@ publish_docker() {
60 fi
61
62 echo "Building Docker images.."
63 - packaging/docker/build.sh
63 + RELEASE_CHANNEL=nightly packaging/docker/build.sh
64
65 echo "Publishing Docker images.."
66 packaging/docker/publish.sh