-
Notifications
You must be signed in to change notification settings - Fork 32
/
update.sh
executable file
·37 lines (28 loc) · 1.6 KB
/
update.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env bash
set -e
# Gather latest version of telegram
version=$(curl -XGET --head https://telegram.org/dl/desktop/linux |grep location |cut -d '/' -f 5 |cut -d '.' -f 2-4)
sed -i 's/\(Telegram Version \)[0-9]*\.[0-9]*\.[0-9]*$/\1'"${version}"'/' Dockerfile
# Local build to validate
docker build --build-arg telegram_version="${version}" -t "local-build/telegram:${version}" .
# Commit with signature, tag and push code.
git commit -am "Telegram version ${version}" -S
git tag -am "Telegram version ${version}" "${version}"
git push --follow-tags
# Tag and Push to GitHub Packages
docker tag "local-build/telegram:${version}" "xorilog/telegram:${version}"
docker tag "local-build/telegram:${version}" "xorilog/telegram:latest"
docker push "xorilog/telegram:${version}"
docker push "xorilog/telegram:latest"
# Tag and Push to GitHub Packages
docker tag "local-build/telegram:${version}" "docker.pkg.github.com/xorilog/docker-telegram/telegram:${version}"
docker push "docker.pkg.github.com/xorilog/docker-telegram/telegram:${version}"
# Tag and Push to GitHub Container Registry
docker tag "local-build/telegram:${version}" "ghcr.io/xorilog/telegram:${version}"
docker push "ghcr.io/xorilog/telegram:${version}"
# Tag and Push as latest to GitHub Packages
docker tag "local-build/telegram:${version}" "docker.pkg.github.com/xorilog/docker-telegram/telegram:latest"
docker push "docker.pkg.github.com/xorilog/docker-telegram/telegram:latest"
# Tag and Push as latest to GitHub Container Registry
docker tag "local-build/telegram:${version}" "ghcr.io/xorilog/telegram:latest"
docker push "ghcr.io/xorilog/telegram:latest"