diff --git a/events/triggers/use-beta-builds b/events/triggers/use-beta-builds new file mode 100755 index 0000000..252e9b5 --- /dev/null +++ b/events/triggers/use-beta-builds @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +# SPDX-FileCopyrightText: 2021-2022 Citadel and contributors +# +# SPDX-License-Identifier: GPL-3.0-or-later + +CITADEL_ROOT="$(readlink -f $(dirname "${BASH_SOURCE[0]}")/../..)" + +"${CITADEL_ROOT}/scripts/set-update-channel" beta diff --git a/events/triggers/use-stable-builds b/events/triggers/use-stable-builds new file mode 100755 index 0000000..9a60e13 --- /dev/null +++ b/events/triggers/use-stable-builds @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +# SPDX-FileCopyrightText: 2021-2022 Citadel and contributors +# +# SPDX-License-Identifier: GPL-3.0-or-later + +CITADEL_ROOT="$(readlink -f $(dirname "${BASH_SOURCE[0]}")/../..)" + +"${CITADEL_ROOT}/scripts/set-update-channel" stable diff --git a/scripts/set-update-channel b/scripts/set-update-channel new file mode 100755 index 0000000..7a2f919 --- /dev/null +++ b/scripts/set-update-channel @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +# SPDX-FileCopyrightText: 2021-2022 Citadel and contributors +# +# SPDX-License-Identifier: GPL-3.0-or-later + +NODE_ROOT="$(readlink -f $(dirname "${BASH_SOURCE[0]}")/../..)" + +# IN ${NODE_ROOT}/.env, change the UPDATE_CHANNEL to the desired channel ($1) +# If $1 is not given, fail +if [ -z "$1" ]; then + echo "Usage: $0 " + echo "Channel can currently either be 'stable' or 'beta'" + exit 1 +fi +sed -i "s/UPDATE_CHANNEL=.*/UPDATE_CHANNEL=${1}/" "${NODE_ROOT}/.env"