Skip to content

Commit 5313bb0

Browse files
authored
Zitadel: Fix release tarball crawling (#3716)
1 parent 86577a0 commit 5313bb0

File tree

2 files changed

+32
-32
lines changed

2 files changed

+32
-32
lines changed

ct/zitadel.sh

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -20,39 +20,39 @@ color
2020
catch_errors
2121

2222
function update_script() {
23-
header_info
24-
check_container_storage
25-
check_container_resources
26-
if [[ ! -f /etc/systemd/system/zitadel.service ]]; then
27-
msg_error "No ${APP} Installation Found!"
28-
exit
29-
fi
30-
RELEASE=$(curl -fsSL https://github.com/zitadel/zitadel/releases/latest | grep location: | cut -d '/' -f 8 | tr -d '\r')
31-
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt | grep -oP '\d+\.\d+\.\d+')" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
32-
msg_info "Stopping $APP"
33-
systemctl stop zitadel
34-
msg_ok "Stopped $APP"
23+
header_info
24+
check_container_storage
25+
check_container_resources
26+
if [[ ! -f /etc/systemd/system/zitadel.service ]]; then
27+
msg_error "No ${APP} Installation Found!"
28+
exit
29+
fi
30+
RELEASE=$(curl -fsSL https://api.github.com/repos/zitadel/zitadel/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
31+
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt | grep -oP '\d+\.\d+\.\d+')" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
32+
msg_info "Stopping $APP"
33+
systemctl stop zitadel
34+
msg_ok "Stopped $APP"
3535

36-
msg_info "Updating $APP to ${RELEASE}"
37-
cd /tmp || exit
38-
curl -fsSL https://github.com/zitadel/zitadel/releases/download/"$RELEASE"/zitadel-linux-amd64.tar.gz | tar -xz
39-
mv zitadel-linux-amd64/zitadel /usr/local/bin
40-
$STD zitadel setup --masterkeyFile /opt/zitadel/.masterkey --config /opt/zitadel/config.yaml --init-projections=true
41-
echo "${RELEASE}" >/opt/${APP}_version.txt
42-
msg_ok "Updated $APP to ${RELEASE}"
36+
msg_info "Updating $APP to ${RELEASE}"
37+
cd /tmp || exit
38+
curl -fsSL "https://github.com/zitadel/zitadel/releases/download/v$RELEASE/zitadel-linux-amd64.tar.gz" | tar -xz
39+
mv zitadel-linux-amd64/zitadel /usr/local/bin
40+
$STD zitadel setup --masterkeyFile /opt/zitadel/.masterkey --config /opt/zitadel/config.yaml --init-projections=true
41+
echo "${RELEASE}" >/opt/${APP}_version.txt
42+
msg_ok "Updated $APP to ${RELEASE}"
4343

44-
msg_info "Starting $APP"
45-
systemctl start zitadel
46-
msg_ok "Started $APP"
44+
msg_info "Starting $APP"
45+
systemctl start zitadel
46+
msg_ok "Started $APP"
4747

48-
msg_info "Cleaning Up"
49-
rm -rf /tmp/zitadel-linux-amd64
50-
msg_ok "Cleanup Completed"
51-
msg_ok "Update Successful"
52-
else
53-
msg_ok "No update required. ${APP} is already at ${RELEASE}"
54-
fi
55-
exit
48+
msg_info "Cleaning Up"
49+
rm -rf /tmp/zitadel-linux-amd64
50+
msg_ok "Cleanup Completed"
51+
msg_ok "Update Successful"
52+
else
53+
msg_ok "No update required. ${APP} is already at ${RELEASE}"
54+
fi
55+
exit
5656
}
5757

5858
start

install/zitadel-install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ $STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME OWNER $DB_ADMIN_USER;"
3939
msg_ok "Installed PostgreSQL"
4040

4141
msg_info "Installing Zitadel"
42-
RELEASE=$(curl -fsSL https://github.com/zitadel/zitadel/releases/latest | grep location: | cut -d '/' -f 8 | tr -d '\r')
43-
curl -fsSL https://github.com/zitadel/zitadel/releases/download/$RELEASE/zitadel-linux-amd64.tar.gz | tar -xz
42+
RELEASE=$(curl -fsSL https://api.github.com/repos/zitadel/zitadel/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
43+
curl -fsSL "https://github.com/zitadel/zitadel/releases/download/v$RELEASE/zitadel-linux-amd64.tar.gz" | tar -xz
4444
mv zitadel-linux-amd64/zitadel /usr/local/bin
4545
msg_ok "Installed Zitadel"
4646

0 commit comments

Comments
 (0)