Skip to content

Commit

Permalink
snap: support specifying last channel
Browse files Browse the repository at this point in the history
  • Loading branch information
debdutdeb committed Nov 11, 2024
1 parent 81da010 commit 95aa4d4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions snap/snap.bats
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,15 @@ setup_file() {

# bats test_tags=pre
@test "Should install previous stable version" {
assert [ -n "$ROCKETCHAT_TAG" ]
run sudo snap install rocketchat-server --channel "${ROCKETCHAT_TAG%%.*}.x/stable"
local channel=
if [ -n "$ROCKETCHAT_PREVIOUS_CHANNEL" ]; then
channel="$ROCKETCHAT_PREVIOUS_CHANNEL"
elif [ -n "$ROCKETCHAT_TAG" ]; then
channel="${ROCKETCHAT_TAG%%.*}.x/stable"
else
fail "either ROCKETCHAT_TAG or ROCKETCHAT_PREVIOUS_CHANNEL must be set"
fi
run sudo snap install rocketchat-server --channel "$channel"
assert_success
}

Expand Down

0 comments on commit 95aa4d4

Please sign in to comment.