summaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
authorAustin S. Hemmelgarn <austin@netdata.cloud>2021-03-04 07:35:05 -0500
committerGitHub <noreply@github.com>2021-03-04 07:35:05 -0500
commitdbed7b51fc2348246b64958d1c38902509731419 (patch)
tree23a51eab868ecd94d12bf12e1295e36a995bd6d3 /.github
parent7907774e5ab3b028d22b001a964a2963bc2144da (diff)
Changed Docker image tagging to use semver tags for releases. (#10648)
* Changed Docker image tagging to use semver tags for releases. This allows users to use image names like `netdata/netdata:1` or `netdata/netdata@1.29` and track the most up-to-date release that matches that version prefix. Such usage is a common practice for projects using semantic versioning like we are. This has a side effect, however, of remivng the `v` from the start of our version tags. Not having it is also more consistent with how a vast majority of other projects handle version tags, but users will need to be notified about the change. * Proper backwards compatability. * Add documentation about Docker image tags. * Update packaging/docker/README.md Co-authored-by: Joel Hans <joel.g.hans@gmail.com> Co-authored-by: Joel Hans <joel.g.hans@gmail.com>
Diffstat (limited to '.github')
-rwxr-xr-x.github/scripts/gen-docker-tags.py13
-rw-r--r--.github/workflows/docker.yml2
2 files changed, 14 insertions, 1 deletions
diff --git a/.github/scripts/gen-docker-tags.py b/.github/scripts/gen-docker-tags.py
new file mode 100755
index 0000000000..6c62511557
--- /dev/null
+++ b/.github/scripts/gen-docker-tags.py
@@ -0,0 +1,13 @@
+#!/usr/bin/env python3
+
+import sys
+
+REPO = 'netdata/netdata'
+
+version = sys.argv[1].split('.')
+
+MAJOR = ':'.join([REPO, version[0]])
+MINOR = ':'.join([REPO, '.'.join(version[0:2])])
+PATCH = ':'.join([REPO, '.'.join(version[0:3])])
+
+print(','.join([MAJOR, MINOR, PATCH]))
diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml
index 04f91bff55..5d5e8b0a7b 100644
--- a/.github/workflows/docker.yml
+++ b/.github/workflows/docker.yml
@@ -30,7 +30,7 @@ jobs:
if: github.event_name == 'workflow_dispatch' && github.event.inputs.version != 'nightly'
run: |
echo "publish=true" >> $GITHUB_ENV
- echo "tags=netdata/netdata:latest,netdata/netdata:stable,netdata/netdata:${{ github.event.inputs.version }}" >> $GITHUB_ENV
+ echo "tags=netdata/netdata:latest,netdata/netdata:stable,$(.github/scripts/gen-docker-tags.py ${{ github.event.inputs.version }})" >> $GITHUB_ENV
- name: Determine if we should push changes and which tags to use
if: github.event_name == 'workflow_dispatch' && github.event.inputs.version == 'nightly'
run: |