Skip to content

Commit

Permalink
handle non existent revisions for track
Browse files Browse the repository at this point in the history
  • Loading branch information
debdutdeb committed Nov 11, 2024
1 parent fc9d5b4 commit 1af5179
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
required: false
type: string
default: 'false'
secrets:
snapcraft-credential:
required: false
outputs:
snap-basename:
value: ${{ jobs.build.outputs.snap-basename }}
Expand All @@ -35,6 +38,7 @@ jobs:
commit: ${{ steps.prepare.outputs.commit }}
run: ${{ steps.prepare.outputs.run }}
candidate: ${{ steps.prepare.outputs.candidate }}
last-channel: ${{ steps.prepare.outputs.last-channel }}
runs-on: ubuntu-latest
steps:
- name: 'Clone repository'
Expand All @@ -45,6 +49,8 @@ jobs:
- name: 'Prepare for next steps'
id: prepare
shell: bash
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.snapcraft-credential }}
run: |
version=${{ inputs.tag }}
snap_track="${version:0:1}.x"
Expand Down Expand Up @@ -86,6 +92,13 @@ jobs:
echo "run=$run" >> $GITHUB_OUTPUT
echo "commit=$commit" >>$GITHUB_OUTPUT
if ! snapcraft list-revisions rocketchat-server | tail -n '+2' | grep -q "$snap_track/stable"; then
last_channel="$((${version:0:1}-1)).x/stable"
fi
echo "last_channel: $last_channel"
echo "last-channel=$last_channel" >> $GITHUB_OUTPUT
build:
needs:
- prepare
Expand Down Expand Up @@ -145,6 +158,7 @@ jobs:
- name: 'Run tests'
shell: bash
env:
ROCKETCHAT_PREVIOUS_CHANNEL: ${{ needs.prepare.outputs.last-channel }}
ROCKETCHAT_TAG: ${{ inputs.tag }}
run: |
sudo apt-get --no-install-recommends install jo jq -y
Expand Down
5 changes: 5 additions & 0 deletions helpers/mongo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ MAX_MONGOD_START_RETRY_COUNT=30
MAX_MONGOD_PRIMARY_WAIT_SECONDS=5
MAX_MONGOD_PRIMARY_RETRY_COUNT=10

mongo() {
# TODO switch to mongosh commands all over
mongosh "$@"
}

is_mongod_running() {
local pid_file
if ! pid_file=$(yq -e e .processManagement.pidFilePath $SNAP_DATA/mongod.conf); then
Expand Down

0 comments on commit 1af5179

Please sign in to comment.