mirror of
https://github.com/nextcloud/nextcloudpi.git
synced 2026-01-10 15:12:01 -03:30
ncp-check-version: Add check for staged rollouts
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
This commit is contained in:
parent
27fa01299d
commit
46d33f7698
@ -15,6 +15,18 @@ git clone -b "$BRANCH" --depth 20 -q --bare https://github.com/nextcloud/nextclo
|
||||
|
||||
cd "$TMPDIR" || exit 1
|
||||
VER=$( git describe --always --tags | grep -oP "v\d+\.\d+\.\d+" )
|
||||
|
||||
[[ -f "/usr/local/etc/instance.cfg" ]] && {
|
||||
cohorte_id="$(jq .cohorteId /usr/local/etc/instance.cfg)"
|
||||
[[ -f "./staged_rollouts/${VER}.txt" ]] && {
|
||||
grep "^${cohorte_id}$" "./staged_rollouts/${VER}.txt" || {
|
||||
echo "Skipping version $VER - cohorte ${cohorte_id} not yet active"
|
||||
cd / || exit 1
|
||||
exit 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
grep -qP "v\d+\.\d+\.\d+" <<< "$VER" && { # check format
|
||||
echo "$VER" > /var/run/.ncp-latest-version
|
||||
|
||||
|
||||
@ -72,4 +72,15 @@ if needs_decrypt; then
|
||||
apache2ctl -k graceful
|
||||
fi
|
||||
|
||||
[[ -f /usr/local/etc/instance.cfg ]] || {
|
||||
cohorte_id=$((1 + RANDOM % 100))
|
||||
cat > /usr/local/etc/instance.cfg <<EOF
|
||||
{
|
||||
"cohorteId": ${cohorte_id},
|
||||
"canary": false
|
||||
}
|
||||
EOF
|
||||
}
|
||||
|
||||
|
||||
exit 0
|
||||
|
||||
@ -84,6 +84,14 @@ rm /.ncp-image
|
||||
cd -
|
||||
rm -rf "${TMPDIR}"
|
||||
|
||||
cohorte_id=$((RANDOM % 100))
|
||||
cat <<EOF > /usr/local/etc/instance.cfg
|
||||
{
|
||||
"cohorteId": ${cohorte_id},
|
||||
"canary": false
|
||||
}
|
||||
EOF
|
||||
|
||||
IP="$(get_ip)"
|
||||
|
||||
echo "Done.
|
||||
|
||||
11
updates/1.52.5.sh
Normal file
11
updates/1.52.5.sh
Normal file
@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
[[ -f /usr/local/etc/instance.cfg ]] || {
|
||||
cohorte_id=$((RANDOM % 100))
|
||||
cat > /usr/local/etc/instance.cfg <<EOF
|
||||
{
|
||||
"cohorteId": ${cohorte_id},
|
||||
"canary": false
|
||||
}
|
||||
EOF
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user