|
|
@ -10,15 +10,12 @@ ifeq ($(GIT_TAG),) |
|
|
|
GIT_TAG := $(shell git describe --always)
|
|
|
|
GIT_TAG := $(shell git describe --always)
|
|
|
|
endif |
|
|
|
endif |
|
|
|
|
|
|
|
|
|
|
|
# get latest k3s version: grep the tag JSON field, extract the tag and replace + with - (difference between git and dockerhub tags)
|
|
|
|
# get latest k3s version: grep the tag and replace + with - (difference between git and dockerhub tags)
|
|
|
|
ifneq (${GITHUB_API_TOKEN},) |
|
|
|
K3S_TAG := $(shell curl --silent "https://update.k3s.io/v1-release/channels/stable" | egrep -o '/v[^ ]+"' | sed -E 's/\/|\"//g' | sed -E 's/\+/\-/')
|
|
|
|
K3S_TAG := $(shell curl --silent -H "Authorization: token: ${GITHUB_API_TOKEN}" "https://api.github.com/repos/rancher/k3s/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sed -E 's/\+/\-/')
|
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
K3S_TAG := $(shell curl --silent "https://api.github.com/repos/rancher/k3s/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sed -E 's/\+/\-/')
|
|
|
|
|
|
|
|
endif |
|
|
|
|
|
|
|
ifeq ($(K3S_TAG),) |
|
|
|
ifeq ($(K3S_TAG),) |
|
|
|
$(warning K3S_TAG undefined: couldn't get latest k3s image tag!) |
|
|
|
$(warning K3S_TAG undefined: couldn't get latest k3s image tag!) |
|
|
|
$(warning Output of curl: $(shell curl --silent "https://api.github.com/repos/rancher/k3s/releases/latest")) |
|
|
|
$(warning Output of curl: $(shell curl --silent "curl --silent "https://update.k3s.io/v1-release/channels/stable"")) |
|
|
|
$(error exiting) |
|
|
|
$(error exiting) |
|
|
|
endif |
|
|
|
endif |
|
|
|
|
|
|
|
|
|
|
|