mirror of
https://github.com/luzifer-docker/kubectl.git
synced 2024-12-20 19:11:18 +00:00
Add update-version script
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
75d26b0bce
commit
d80c773bae
1 changed files with 32 additions and 0 deletions
32
update-version.sh
Executable file
32
update-version.sh
Executable file
|
@ -0,0 +1,32 @@
|
|||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
### ---- ###
|
||||
|
||||
echo "Switch back to master"
|
||||
git checkout master
|
||||
git reset --hard origin/master
|
||||
|
||||
### ---- ###
|
||||
|
||||
version=$(curl -s "https://lv.luzifer.io/v1/catalog/kubernetes/latest/version")
|
||||
grep -q "KUBECTL_VERSION=${version}$" Dockerfile && exit 0 || echo "Update required"
|
||||
|
||||
sed -Ei \
|
||||
-e "s/KUBECTL_VERSION=v[0-9.]+/KUBECTL_VERSION=v${version}/" \
|
||||
Dockerfile
|
||||
|
||||
### ---- ###
|
||||
|
||||
echo "Testing build..."
|
||||
docker build .
|
||||
|
||||
### ---- ###
|
||||
|
||||
echo "Updating repository..."
|
||||
git add Dockerfile
|
||||
git -c user.name='Luzifer.io Jenkins' -c user.email='jenkins@luzifer.io' \
|
||||
commit -m "kubectl ${version}"
|
||||
git tag ${version}
|
||||
|
||||
git push -q https://${GH_USER}:${GH_TOKEN}@github.com/luzifer-docker/kubectl.git master --tags
|
Loading…
Reference in a new issue